Pinbelegung:
| ESP32 Pin | LA66 Pin | Beschreibung |
|---|---|---|
| 17 | 11 | TX-Pin am LA-Modul, RX-Pin am ESP |
| 18 | 10 | RX-Pin am LA-Modul, TX-Pin am ESP |
| GND | GND | GND - Level |
| 3.3V | 3.3 V | Stromversorgung |
Programmcode:
import machine
import time
TX_PIN = 17
RX_PIN = 18
uart = machine.UART(1, baudrate=9600, tx=TX_PIN, rx=RX_PIN)
def send_command(cmd):
uart.write(cmd + "\r\n")
time.sleep(0.5)
if uart.any():
response = uart.read()
try:
print("RX:", response.decode("ascii"))
except UnicodeDecodeError:
print("RX (raw):", response)
# Test
send_command("AT")
Stromverbrauch:
0.042 mA solange er nichts sendet.