Skip to content

Commit 8c9d903

Browse files
committed
Fixes bug when initializing UART with defined rx and tx pins.
1 parent cb4e96a commit 8c9d903

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/dfplayer/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ def __init__(self,uart_id,tx_pin_id=None,rx_pin_id=None):
99

1010
#not all boards can set the pins for the uart channel
1111
if tx_pin_id or rx_pin_id:
12-
self.tx_pin=machine.Pin(tx_pin_id,machine.Pin.OUT)
13-
self.rx_pin=machine.Pin(rx_pin_id,machine.Pin.IN)
14-
self.uart.init(9600, bits=8, parity=None, stop=1, tx=self.tx_pin, rx=self.rx_pin)
12+
self.uart.init(9600, bits=8, parity=None, stop=1, tx=tx_pin_id, rx=rx_pin_id)
1513
else:
1614
self.uart.init(9600, bits=8, parity=None, stop=1)
1715

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy