|
|
Zeile 11: |
Zeile 11: |
| [[20. Lektion: Raspberry Pi Pico W]]<br> | | [[20. Lektion: Raspberry Pi Pico W]]<br> |
| [[21. Lektion: Pin's]]<br> | | [[21. Lektion: Pin's]]<br> |
− | | + | [[22. Lektion: Neopixel]]<br> |
− | [[19. Lektion: Neopixel]]<br> | + | |
| * Problem Stromversorgung! | | * Problem Stromversorgung! |
| ** https://www.exp-tech.de/zubehoer/neopixel/leds/5902/adafruit-neopixel-diffused-5mm-through-hole-led-5-pack?c=1215 | | ** https://www.exp-tech.de/zubehoer/neopixel/leds/5902/adafruit-neopixel-diffused-5mm-through-hole-led-5-pack?c=1215 |
Zeile 20: |
Zeile 19: |
| ** https://www.berrybase.de/neopixel-breakout-board-mit-1-ws2812-5050-rgb-led?c=2447 | | ** https://www.berrybase.de/neopixel-breakout-board-mit-1-ws2812-5050-rgb-led?c=2447 |
| ** https://www.berrybase.de/neopixel-rgbw-mini-button-pcb-10er-pack?c=2447 | | ** https://www.berrybase.de/neopixel-rgbw-mini-button-pcb-10er-pack?c=2447 |
− | [[20. Lektion: Onewire]]<br> | + | [[23. Lektion: Onewire]]<br> |
− | [[21. Lektion: UART]]<br> | + | [[24. Lektion: UART]]<br> |
− | [[22. Lektion: SPI]]<br> | + | [[25. Lektion: SPI]]<br> |
− | [[23. Lektion: I2C]]<br> | + | [[26. Lektion: I2C]]<br> |
| * TCA9548a | | * TCA9548a |
| ** https://github.com/mcauser/microphyton-tca9548a | | ** https://github.com/mcauser/microphyton-tca9548a |
− | [[24. Lektion: ADC]]<br> | + | [[27. Lektion: ADC]]<br> |
| * https://randomnerdtutorials.com/raspberry-pi-pico-analog-inputs-micropython/ | | * https://randomnerdtutorials.com/raspberry-pi-pico-analog-inputs-micropython/ |
| ** ADC des Raspberry Pi Pico | | ** ADC des Raspberry Pi Pico |
Zeile 39: |
Zeile 38: |
| *** https://www.grzesina.de/az/blog_robotcar/ads1115rc.py | | *** https://www.grzesina.de/az/blog_robotcar/ads1115rc.py |
| *** https://how2electronics.com/ads1115-16-bit-adc-module-with-raspberry-pi-pico/ | | *** https://how2electronics.com/ads1115-16-bit-adc-module-with-raspberry-pi-pico/ |
− | [[25. Lektion: DAC]]<br> | + | [[28. Lektion: DAC]]<br> |
− | [[26. Lektion: Puls Weiten Modulation (PWM)]]<br> | + | [[29. Lektion: Puls Weiten Modulation (PWM)]]<br> |
| * https://randomnerdtutorials.com/raspberry-pi-pico-pwm-micropython/ | | * https://randomnerdtutorials.com/raspberry-pi-pico-pwm-micropython/ |
− | [[27. Lektion: Watch Dog Timer (WDT)]]<br> | + | [[30. Lektion: Watch Dog Timer (WDT)]]<br> |
− | [[28. Lektion: Interrupts]]<br> | + | [[31. Lektion: Interrupts]]<br> |
− | [[29. Lektion: Timer]]<br> | + | [[32. Lektion: Timer]]<br> |
| | | |
| ==== 2. Abend==== | | ==== 2. Abend==== |
Version vom 5. Oktober 2023, 21:24 Uhr
Micropython Kurs 2023 - Teil 2
Hier werden wir den Umgang mit der Microcontroller spezifischen Hardware lernen.
1. Abend
Di. 16.1.24
Erster Hardware Kontakt
19. Lektion: Vorstellung des Experimentierboards
20. Lektion: Raspberry Pi Pico W
21. Lektion: Pin's
22. Lektion: Neopixel
23. Lektion: Onewire
24. Lektion: UART
25. Lektion: SPI
26. Lektion: I2C
27. Lektion: ADC
28. Lektion: DAC
29. Lektion: Puls Weiten Modulation (PWM)
30. Lektion: Watch Dog Timer (WDT)
31. Lektion: Interrupts
32. Lektion: Timer
2. Abend
21.11.2023
30. Lektion: Das Filesystem
Wlan
Unix-Zeit
ACHTUNG ESP32 und Pico arbeiten mit unterschiedlichen Epochen:
MicroPython v1.20.0 on 2023-04-26; Raspberry Pi Pico W with RP2040
>>> import time
>>> time.gmtime(0)
(1970, 1, 1, 0, 0, 0, 3, 1)
>>>
MicroPython v1.20.0 on 2023-04-26; ESP32 module with ESP32
>>> import time
>>> time.gmtime(0)
(2000, 1, 1, 0, 0, 0, 5, 1)
>>>
NTP/RTC
Die RTC des ESP32 soll sehr ungenau sein.
MicroPython v1.20.0 on 2023-04-26; ESP32S3 module with ESP32S3
Type "help()" for more information.
>>> import network
>>> import ntptime
>>> from machine import RTC
# WLAN einrichten
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
True
>>> wlan.connect('SSID', 'PW')
>>> wlan.isconnected()
False
>>> wlan.isconnected()
True
>>> wlan.ifconfig()
('192.168.5.109', '255.255.255.0', '192.168.5.1', '192.168.5.1')
# Die RTC mit NTP einstellen
>>> ntptime.settime()
# Die RTC einrichten
>>> rtc = RTC()
>>> rtc.datetime()
(2023, 9, 5, 1, 15, 39, 56, 427762)
>>> rtc.datetime()
(2023, 9, 5, 1, 16, 14, 5, 837765)
>>> rtc.datetime()
(2023, 9, 5, 1, 16, 21, 42, 597764)
>>> dir(ntptime)
['__class__', '__name__', '__dict__', '__file__', 'socket', 'struct', 'time', 'timeout', 'utime', '__version__', 'host', 'settime']
>>> ntptime.time()
747246194
>>> rtc.datetime()
(2023, 9, 5, 1, 16, 23, 49, 897771)
>>> ntptime.time()
747246234
>>> ntptime.utime
<module 'utime'>
>>> rtc.datetime()
(2023, 9, 5, 1, 16, 24, 29, 867765)
>>> ntptime.time()
747246276
>>> import time
>>> dir(time)
['__class__', '__name__', '__dict__', 'gmtime', 'localtime', 'mktime', 'sleep', 'sleep_ms', 'sleep_us', 'ticks_add', 'ticks_cpu', 'ticks_diff', 'ticks_ms', 'ticks_us', 'time', 'time_ns']
>>> time.gmtime()
(2023, 9, 5, 16, 25, 39, 1, 248)
>>> time.localtime()
(2023, 9, 5, 16, 25, 57, 1, 248)
>>> time.mktime(rtc.datetime())
747191787
>>> ntptime.time()
747246461
>>> time.mktime(rtc.datetime())
747191787
>>> ntptime.time()
747246472
>>> time.mktime(rtc.datetime())
747191788
>>> ntptime.time()
747246489
>>>
Datum und Uhrzeit
Links:
3. Abend
28.11.2023
4. Abend
- List comprehensions
- Dokumentation
- Menue erstellen
- Compiler
- Sortieren
- Wertgleichheit == und Identität is
- 16. Lektion: Funktionen.extend()
- Generatoren
- Regulare Expressions
Sortieren
Mitgliedschaft
Bytearray / Bytestring
Werden nur zur Vorbereitung auf eine serielle Datenübertragung verwendet.
Datenstrukturen werden in einzelne Bytes zerlegt.
python-bytes-to-string-how-to-convert-a-bytestring
python-bytes
5. Abend
Kritik
$ jupyter notebook
Navigation
Zurück zu Micropython Kurs 2023 - Teil 2
Zurück zur "Micropython Kurs 2023" Startseite
Zurück zur Programmieren Startseite
Zurück zur Wiki Startseite