Advertisement
inagantid20

Exploring RGB Activity

Jun 15th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. /*
  2. *Divya Inaganti
  3. *June 14, 2017
  4. *How to use a photoresistor activity
  5. */
  6. const int PinRed= 9;
  7. const int PinGreen=10;
  8. const int PinBlue= 11;
  9. void setup()
  10. {
  11. Serial.begin (9600);
  12. // pinMode(photoPin, INPUT);
  13. pinMode (PinRed, OUTPUT);
  14. pinMode (PinGreen, OUTPUT);
  15. pinMode (PinBlue, OUTPUT);
  16. analogWrite(PinRed, 255);
  17. analogWrite(PinGreen, 0);
  18. analogWrite(PinBlue,0);
  19. delay(200);
  20. analogWrite(PinRed, 0);
  21. analogWrite(PinGreen, 255);
  22. analogWrite(PinBlue,0);
  23. delay(200);
  24. analogWrite(PinRed, 0);
  25. analogWrite(PinGreen, 0);
  26. analogWrite(PinBlue,255);
  27. delay(200);
  28. }
  29. void loop()
  30. {
  31.  
  32.  
  33.  
  34.  
  35. //
  36. //
  37. //Read (photoPin);
  38. // lightVal= map(photoValue, 0, 1020, 255, 0);
  39. // Serial.print ("Photoresistor value = ");
  40. // Serial.print(photoValue);
  41. // Serial.print ("lightVal = ");
  42. // Serial.println(lightVal);
  43. // delay(100);
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement