|
1 | | -# Presto |
| 1 | +# Presto <!-- omit in toc --> |
2 | 2 |
|
3 | 3 | Most of your interaction with Presto will be through the `presto` module. |
4 | 4 |
|
5 | 5 | It will help you set up PicoGraphics, touch, WiFi, ambient lighting and more. |
6 | 6 |
|
| 7 | +- [Getting Started](#getting-started) |
| 8 | +- [Features](#features) |
| 9 | + - [Updating The Display](#updating-the-display) |
| 10 | + - [Touch](#touch) |
| 11 | + - [Back/Ambient Lights](#backambient-lights) |
| 12 | + - [Auto LEDs](#auto-leds) |
| 13 | + - [Manual LEDs](#manual-leds) |
| 14 | + - [Wireless](#wireless) |
| 15 | + |
7 | 16 | ## Getting Started |
8 | 17 |
|
9 | 18 | Create a new Presto instance: |
@@ -58,43 +67,22 @@ To access touch information you can use: |
58 | 67 |
|
59 | 68 | ### Back/Ambient Lights |
60 | 69 |
|
| 70 | +#### Auto LEDs |
| 71 | + |
61 | 72 | If you've set `ambient_light=True` then Presto will automatically update the LEDs |
62 | 73 | to match the screen content. |
63 | 74 |
|
64 | 75 | Note - you can disable this with `presto.auto_ambient_leds(False)`. |
65 | 76 |
|
66 | | -Otherwise you can use either MicroPython's `neopixel` library or our `Plasma` to |
67 | | -drive the LEDs. |
| 77 | +#### Manual LEDs |
68 | 78 |
|
69 | | -#### Using the NeoPixel Library |
70 | | - |
71 | | -```python |
72 | | -import neopixel |
73 | | - |
74 | | -NUM_LEDS = 7 |
75 | | -LED_PIN = 33 |
76 | | - |
77 | | -lights = neopixel.NeoPixel(machine.Pin(LED_PIN), NUM_LEDS) |
78 | | - |
79 | | -lights[0] = (255, 255, 0) |
80 | | - |
81 | | -lights.write() |
82 | | -``` |
83 | | - |
84 | | -#### Using the Plasma Library |
| 79 | +With Presto's auto backlighting disabled you can control the LED colours |
| 80 | +manually, like so: |
85 | 81 |
|
86 | 82 |
|
87 | 83 | ```python |
88 | | -import plasma |
89 | | - |
90 | | -NUM_LEDS = 7 |
91 | | -LED_PIN = 33 |
92 | | - |
93 | | -lights = plasma.WS2812(NUM_LEDS, 0, 0, LED_PIN) |
94 | | -lights.start() |
95 | | - |
96 | | -lights.set_hsv(0, 0.5, 1.0, 1.0) |
97 | | -lights.set_rgb(1, 255, 255, 0) |
| 84 | +presto.set_led_hsv(0, 0.5, 1.0, 1.0) |
| 85 | +presto.set_led_rgb(1, 255, 255, 0) |
98 | 86 | ``` |
99 | 87 |
|
100 | 88 | ### Wireless |
|
0 commit comments