User Manual
3/6/2018 Light Follower Module - Wiki
http://wiki.sunfounder.cc/index.php?title=Light_Follower_Module 2/4
Step 1. Install the Arduino IDE in your computer. For detailed steps, refer tohttp://wiki.sunfounder.cc/index.php?
title=Install_Arduino_Software
Step 2. Connect the Arduino Uno board. Wiring:
Light Follower Module ------ Arduino Uno
5V ----------------------- VCC
GND ----------------------- GND
AD0 ----------------------- A0
AD1 ----------------------- A1
AD2 ----------------------- A2
Step 3. Upload the sketch. Copy the following code to arduino IDE ,before clicking the Upload (right arrow button) icon, set
the Port and Board under Toolsmenu.
Test Code
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print("AD0:");
Serial.print(analogRead(A0));
Serial.print(" \t ");
Serial.print("AD1:");
Serial.print(analogRead(A1));
Serial.print(" \t ");
Serial.print("AD2:");
Serial.println(analogRead(A2));
delay(500);
}
Step 4. Check the value on Serial Monitor. Click the icon at the right upper corner. When any of the photo-sensors on
the module approaches the light source, the corresponding AD value will decrease; once it moves away from the light, the value
will increase, as shown below: