-
Notifications
You must be signed in to change notification settings - Fork 227
2Y0A21 SENSOR
Jaume Olivé Petrus edited this page Aug 25, 2017
·
13 revisions
What | Comments | |
---|---|---|
Identifier | 2Y0A21 | Infrared sensor |
Interface | ADC | |
Provides | distance | centimeters |
Properties | none | |
Datasheet |
-- Attach sensor using an external ADC (ADS1115) / channel 0
s = sensor.attach("2Y0A21", adc.ADS1115, 0)
while true do
print("distance: "..s:read("distance").." cm")
tmr.delayms(500)
end