This document shows you how to get started with your IR sensor.
What is the IR sensor?
The IR sensor allows Marty to sense the world around him. Each Marty comes with an IR sensor as standard. The sensor will allow Marty to detect objects in-front and underneath the foot!
How do IR Sensors Work?
- Infrared light is emitted from the IR LED emitter
- The beam of light hits the object and gets reflected back in an angle
- The reflected light will reach the light detector
- The sensor in the light detector determines the position/distance of the object
IR Sensor Set Up
If you have not used your IR sensor before you will need to configure it in our Marty The Robot v2 App. After connecting to your Marty navigate to the configure page then Add Ons. In the list of Add Ons you will see one with the type “IRFoot”. Name the add on “LeftIRFootr” or “RightIRFoot” Then click update name
If you have removed your IR sensor you can add it back by following this video.
Using IR Sensing in Marty Blocks
Like the IR obstacle detector, your IR ground sensor will return 'true' or 'false': this time it will say 'true' if a surface is detected below the foot or 'false' if there is no surface detected below the foot.
This is useful if you want to create some code that tells Marty to stay away from edges of a table, this might look like the picture below in Marty Blocks: