How to write to code to measure the distance and display using code bricks and upload it to Arduino.
- Open Junkbot software.
- Click on the robots and drag .
- To read the values of touch sensor use brick from the robots.
- This brick actually helps to read the touch sensor, say if you touch the touch sensor the reading should be equal to 1.
3.The Touch sensor will give 1 reading, then buzzer will make a sound and the servo motor will set as angle 90 , else servo will be set as angle 0.
The statement we use brick from control.
4.To set the servo motor a statement will be used from robots.
5.To turn on the buzzer a brick should be used.
Code brick program