Therefore in order to avoid this problem, I have attached a laser in one of the corners of bottom boards of the turntable and attached a light sensor in the same corner but of the top board.
The photograph below shows how the turntable looks:
This photograph is of the strip-board and the Arduino board with the wiring of the resistor and sensor in place:
This is the code used in Arduino to set the laser and light sensor to work:
void loop(){
digitalWrite(15,HIGH);
digitalWrite(13,HIGH);
The coding above is telling the Arduino to turn on the laser and power the light resistor.
if(analogRead(0)>700){
coords=0;
}
The above coding basically states that when the light resistor is triggered, set the current co-ordinates to 0.
No comments:
Post a Comment