Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Rachel Monger
- * 6/14/17
- * Analog Photoresistor Version 2 RGB
- */
- const int pinRed=6;
- const int pinGreen=9;
- const int pinBlue=10;
- void setup()
- {
- Serial.begin(9600);
- pinMode(pinRed, INPUT);
- pinMode(pinGreen, OUTPUT);
- pinMode(pinBlue, OUTPUT);
- analogWrite(pinRed, 255);
- analogWrite(pinGreen, 0);
- analogWrite(pinBlue, 0);
- delay(200);
- analogWrite(pinRed, 0);
- analogWrite(pinGreen, 255);
- analogWrite(pinBlue, 0);
- delay(200);
- analogWrite(pinRed, 0);
- analogWrite(pinGreen, 0);
- analogWrite(pinBlue, 255);
- delay(200);
- }
- void loop()
- {
- //
- //// photoValue = analogRead(photoPin);
- //// lightVal = map(photoValue, 0,930, 255,0);
- //// lightVal = constrain(lightVal, 0,255);
- //// Serial.print (" Photoresistor value = ");
- //// Serial.print(photoValue);
- //// Serial.print (" lightVal = ");
- //// Serial.print(lightVal);
- //// delay(100);
- ////
- }
Advertisement
Add Comment
Please, Sign In to add comment