Micropython Kurs 2023 - Teil 2
Teil 2
Hier werden wir den Umgang mit der Microcontroller spezifischen Hardware lernen.
1. Abend
14.11.2023
Erster Hardware Kontakt
18. Lektion: Pin's
19. Lektion: Neopixel
- 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/5310/breadboard-friendly-rgb-smart-neopixel-pack-of-4?c=1215
- https://www.berrybase.de/adressierbare-ws2812-rgb-led-pth-5mm-diffus-5er-pack?c=2428
- https://www.berrybase.de/adressierbare-ws2812-rgb-led-pth-5mm-klar-5er-pack?c=2428
- 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
20. Lektion: Onewire
21. Lektion: UART
22. Lektion: SPI
23. Lektion: I2C
- ADC des Raspberry Pi Pico
- ADC des ESP32
- ADC ADS1115
- https://www.ti.com/lit/ds/symlink/ads1115.pdf?ts=1693292712477&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252Fde-de%252FADS1115
- https://www.az-delivery.de/products/analog-digitalwandler-ads1115-mit-i2c-interface?variant=19034185039968
- https://www.berrybase.de/ads1115-4-kanal-16-bit-ad-wandler-breakout-board
- https://github.com/wollewald/ADS1115_mpy
- https://github.com/robert-hh/ads1x15
- https://pypi.org/project/ADS1115-mic-py/
- https://www.grzesina.de/az/blog_robotcar/ads1115rc.py
- https://how2electronics.com/ads1115-16-bit-adc-module-with-raspberry-pi-pico/
25. Lektion: DAC
26. Lektion: Puls Weiten Modulation (PWM)
27. Lektion: Watch Dog Timer (WDT)
28. Lektion: Interrupts
29. Lektion: Timer
2. Abend
21.11.2023
Wlan
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
- Display anschließen
- Webserver
- Raspberry Pi Pico
- MicroWebSrv
- Andere Links mit Sockets:
- Raspberry Pi Pico
4. Abend
5. Abend
Kritik
$ jupyter notebook