Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int ledPinW= 3;
- const int ledPinB= 5;
- const int ledPinG= 6;
- const int Pot= A0;
- int potVal;
- void setup() {
- // put your setup code here, to run once:
- pinMode (ledPinW, OUTPUT);
- pinMode (ledPinB, OUTPUT);
- pinMode (ledPinG, OUTPUT);
- pinMode (Pot, INPUT);
- Serial. begin (9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- potVal= analogRead (Pot);
- potVal= map (potVal, 0, 1023, 0, 200);
- analogWrite(ledPinW, potVal);
- analogWrite(ledPinB, potVal);
- analogWrite(ledPinG, potVal);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement