First, upload the “checkPhotoResistors” file (see addenda) and upload it to your board. Open the serial monitor and point the eye toward a dim, constant light area. Find the approximate values for each direction (front, back, right, and left) and note them. Take these and compute front-back and left-right.
Now open “eye_light_seeking_demo” (see addenda). At the top, record the front-back value as the backOffset and the left-right value as the rightOffset. You can now upload the code to your arm and see it seek light! Use a flashlight or other light source to direct it. If it starts to move unpredictably (moving continuously in the same direction or oscillating) press in on the joystick from manual control to halt the program. If it is oscillating, increase the threshold value. If it won’t move, decrease this value. If it moves in the same direction at all times, first check that the room doesn’t have a bright spot, then recalibrate the backOffset and rightOffset values.
Comments