Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int photocell = A1;
- int photoread = 0;
- int yellow = 10;
- int blue = 9;
- int potent = A0;
- int potentread = 0;
- int potentmap = 0;
- int photomap = 0;
- void setup() {
- // put your setup code here, to run once:
- pinMode(yellow, OUTPUT);
- pinMode(blue, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- photoread = analogRead(photocell);
- //Serial.println(photoread);
- potentread = analogRead(potent);
- Serial.println(potentread);
- potentmap = map(potentread, 0, 1023, 0, 255);
- photomap = map(photoread, 0, 1023, 0, 255);
- analogWrite(yellow, potentmap);
- analogWrite(blue, photomap);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement