WiPy 2.0 + Expansion Board 2.0 SD Card and UART1
-
Hi,
It is possible to use the SD Card and the UART1 serial port at the same time?
If not, Can I change the TX, RX pins for UART1?
There is any table for the alternative function of the pins (alt parameter)?Thanks and best regards,
-
Hi,
I had the same problem. I resolve it using the next code:
from machine import SD
import osuart=UART(1,baudrate=115200,pins=('P12','P11')) ## it is important to create uart before sd
#uart.init(115200, bits=8, parity=None, stop=1,pins=('P3','P4'))
#uart.init(115200, bits=8, parity=None, stop=1,pins=('P10','P9'))
#uart.init(115200, bits=8, parity=None, stop=1,pins=('P12','P11'))while(uart.any()==0):
pass
uart.readall()sd = SD()
os.mount(sd, '/sd')check the content
os.listdir('/sd')
try some standard file operations
f = open('/sd/test.txt', 'w')
f.write('Testing SD card write operations + serial to HPoseidon')
f.close()
f = open('/sd/test.txt', 'r')
f.readall()
f.close()I hope it will be useful. Sorry for mi English.
Regards
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login