Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte led;
- int joystick;
- void setup() {
- for (byte n = 2; n < 9; n++)
- pinMode(n, OUTPUT);
- Serial.begin(115200);
- }
- void loop() {
- joystick = analogRead(A0);
- Serial.println(joystick);
- led = map(joystick, 0, 950, 8, 2);
- digitalWrite(led, 1);
- delay(10);
- digitalWrite(led, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement