daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int RGBRedPin = 9;    
  2. int RGBGreenPin = 10;
  3. int RGBBluePin = 11;  
  4. int analogRotation=A0;
  5. int waitTime=1000;
  6. void setup() {
  7.  pinMode(RGBRedPin, OUTPUT);  
  8.   pinMode(RGBGreenPin, OUTPUT);  
  9.   pinMode(RGBBluePin, OUTPUT);  
  10.   pinMode(analogRotation, INPUT);
  11.   Serial.begin(9600);
  12. }
  13.  
  14. void loop() {
  15.   waitTime=analogRead(analogRotation);
  16.   Serial.println(analogRead(analogRotation));
  17.    digitalWrite(RGBRedPin, HIGH);
  18. delay(waitTime);              
  19. digitalWrite(RGBRedPin, LOW);  
  20.   digitalWrite(RGBGreenPin, HIGH);
  21. delay(waitTime);              
  22. digitalWrite(RGBGreenPin, LOW);  
  23.   digitalWrite(RGBBluePin, HIGH);
  24. delay(waitTime);              
  25. digitalWrite(RGBBluePin, LOW);  
  26.  
  27. }
RAW Paste Data
Top