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