Skip to content

Commit

Permalink
potentiometer try me leds
Browse files Browse the repository at this point in the history
  • Loading branch information
scammo committed Mar 25, 2024
1 parent c0d9d38 commit 38208b6
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion content/projekte/try_me_leds.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ void loop() {
Aller erste Version:
![Aller erste Version Try me leds](/try-me-leds/try_me_leds_1.jpg)

## LEDs mit Potentiometer

Schließe einen Potentiometer an den A0 (Analog 0) Pin und ändere dann folgenden Code:

```
void loop() {
for (int i = 0; i <= NUM_LEDS; i++) {
leds[i-2] = CRGB::Black;
leds[i-1] = CRGB::Black;
leds[i] = CRGB::Green;
leds[i+1] = CRGB::Green;
FastLED.show();
// map(value, fromLow, fromHigh, toLow, toHigh)
delay(map(analogRead(A0), 0, 255, 0, 400));
Serial.println(A0);
}
}
```

[map() infos in der Arduino Doku](https://www.arduino.cc/reference/en/language/functions/math/map/)

## DemoReel 100 auf dem "Arduino DEMO"

Expand Down Expand Up @@ -198,4 +218,8 @@ void juggle() {
}
}
```
```

## Sonstiges

[USB B dust cover stl](https://www.printables.com/de/model/473014-usb-b-port-cap)

0 comments on commit 38208b6

Please sign in to comment.