Guest User

Untitled

a guest
Oct 18th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. // the setup routine runs once when you press reset:
  2. void setup() {
  3. Serial.begin(9600);
  4. }
  5.  
  6. void loop() {
  7. //photoresistor on A0 pin
  8. int photoresValue = analogRead(A0);
  9. photoresValue *= 0.25;
  10. Serial.print(photoresValue);
  11. Serial.print(",");
  12.  
  13. //potentiometer on A1 pin
  14. int potValue = analogRead(A1);
  15. potValue *= 0.25;
  16. Serial.println(potValue);
  17. delay(1); // delay in between reads for stability
  18. }
Add Comment
Please, Sign In to add comment