I am trying to get the microbit to talk to other devices so I need to create tx and rx on the GPIO pins. I am trying to use this function but no matter how I arrange it, including deleting “microbit.”, all I get are syntax errors. Has anybody got an example of how this command should be written?
microbit.uart.init(baudrate=9600, bits=8, parity=None, stop=1, *, tx=None, rx=None)
According to the instructions the following command must be executed before the program terminates to restore the python console. ``uart.init(115200)’’. What happens if your program crashes and can't get to this command does your microbit become un-programmable, a bin job?
Microbit UART
Re: Microbit UART
It's extremely difficult to damage the micro:bit. When you change the settings of your UART, it will simply work with those settings from that moment. I suppose the recommendation is there so that you can still have your REPL working, for debugging and error messages.
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Microbit UART
Code: Select all
microbit.uart.init(baudrate=9600, bits=8, parity=None, stop=1, *, tx=pin0, rx=pin1)