DIGITAL INPUT
- In sake to detect the obstacles we have to equip the robot with the "touch sensor". This sensor is basically a switch or a key, which toggles it's output between GND and +5 V voltage potentials.
- Follow video instructions to construct bumper in front of the robot.
Questions:
- Do you hear "clicking" sound when you push the bumper?
- Name the mechanical mechanism where smaller force on one end can cause greater force on the other end of the mechanism.
Tasks: CONNECT THE SWITCH
The key has three connecting terminals. Each of one is marked with the number 1, 2 or 3. Connect them in right order. Connect the key terminals in order that are specified in presentation and listed as:
- connect to RobDuino C0 terminal.
- connect to RobDuino voltage terminal GND.
- connect to RobDuino voltage terminal +5V.
Questions:
- What is the output voltage (measure it) of the sensor when the robot is (or is NOT) touching the obstacle?
- How many different states can we measure at the output of the sensor?
- Name several more examples where digital sensor can take place.
Summary:
Digital sensors
The output of a digital sensor can be just in two states:
- logical "0" - presented in voltage as 0 V.
- logical "1" - presented in voltage as +5V.
Issues:
Robot has no power since I connected the key as a sensor.
Probably the key or switch is connected wrong and there is short connection between the GND and +5V voltage terminals. Unconnect the key or switch and verify if the power is back.
Tasks: READING DIGITAL INPUT
- Write the program shown in the presentation to test the readings of the digital sensor.
- Then … complete the program to turn OFF the LED when the bumper is not touching anything.
- Next … Change IF statements into single one IF-THEN-ELSE statement.
- Advanced … Solve the problem without IF statement.
Questions:
- Check if the LED on the output terminal D3 is turend ON when the bummper is pressed.
Summary:
<++>
<++>
Issues:
<++>
<++>