Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int photoPin =A2;
- int lightVal;
- void setup() {
- // put your setup code here, to run once:
- pinMode (photoPin, INPUT);
- Serial.begin (9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- lightVal = analogRead (photoPin);
- Serial.println (lightVal);
- //max is 143 and the min is 5
- //depends on how you use it
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement