mongerr

RGB Code

Jun 14th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. /*
  2. * Rachel Monger
  3. * 6/14/17
  4. * Analog Photoresistor Version 2 RGB
  5. */
  6.  
  7. const int pinRed=6;
  8. const int pinGreen=9;
  9. const int pinBlue=10;
  10.  
  11. void setup()
  12. {
  13. Serial.begin(9600);
  14. pinMode(pinRed, INPUT);
  15. pinMode(pinGreen, OUTPUT);
  16. pinMode(pinBlue, OUTPUT);
  17.  
  18. analogWrite(pinRed, 255);
  19. analogWrite(pinGreen, 0);
  20. analogWrite(pinBlue, 0);
  21. delay(200);
  22. analogWrite(pinRed, 0);
  23. analogWrite(pinGreen, 255);
  24. analogWrite(pinBlue, 0);
  25. delay(200);
  26. analogWrite(pinRed, 0);
  27. analogWrite(pinGreen, 0);
  28. analogWrite(pinBlue, 255);
  29. delay(200);
  30.  
  31. }
  32.  
  33. void loop()
  34. {
  35. //
  36. //// photoValue = analogRead(photoPin);
  37. //// lightVal = map(photoValue, 0,930, 255,0);
  38. //// lightVal = constrain(lightVal, 0,255);
  39. //// Serial.print (" Photoresistor value = ");
  40. //// Serial.print(photoValue);
  41. //// Serial.print (" lightVal = ");
  42. //// Serial.print(lightVal);
  43. //// delay(100);
  44. ////
  45. }
Advertisement
Add Comment
Please, Sign In to add comment