Data Sheet
4/27/2018 OpenCR1.0
http://emanual.robotis.com/docs/en/parts/controller/opencr10/ 41/50
tilt sensor and led are connected to OpenCR. so that red/blue led is on/off when tilted
and red/blue led is off/on when not tilted.
Connect the Tilt Sensor, Led_blue, and Led_red signal pins to D0, D1, and D2.
7. 7. 2. 2. Result
OpenCR 02 Tilt Sensor Example
7. 7. 3. Rotation Sensor
It is rotation sensor test on the OpenCR board.
Specification
Rotation Sensor Specification
Rotation Angle : 3600 degrees
Supply Voltage : 3.3V to 5V
Interface : Analog
#define tilt 0
#define led_blue 1
#define led_red 2
void setup()
{
pinMode(tilt, INPUT);
pinMode(led_blue, OUTPUT);
pinMode(led_red, OUTPUT);
}
void loop()
{
if(digitalRead(tilt) == HIGH)
{
digitalWrite(led_blue, HIGH);
digitalWrite(led_red, LOW);
}
else
{
digitalWrite(led_blue, LOW);
digitalWrite(led_red, HIGH);
}
}
OpenCR1.0
Back to Top ▲