Search found 5 matches

by moneyman
Sat Jun 15, 2019 7:48 pm
Forum: MicroPython pyboard
Topic: Import Pyserial Module
Replies: 10
Views: 896

Re: Import Pyserial Module

Hi all, Another question I have is if there is any way to set an interrupt for every time data reaches USB_VCP. I have an infinite loop running elsewhere in the code but I want to be able to keep reading from this port in case I want to keep sending new data from the RPi. Any suggestions and example...
by moneyman
Tue Jun 11, 2019 9:23 pm
Forum: MicroPython pyboard
Topic: Import Pyserial Module
Replies: 10
Views: 896

Re: Import Pyserial Module

dhylands wrote:
Mon Jun 10, 2019 10:23 pm
You need to instantiate an object. Your code should look like:

Code: Select all

usb = pyb.USB_VCP()
usb.write(b'helllo\r\n')
. Note that b'hello\r\n' 'hello\r\n'.encode() or ('hello\r\n').encode() all produce the same thing (namely b'hello\r\n')
This worked perfectly. Thank you all so much for the help!
by moneyman
Mon Jun 10, 2019 9:10 pm
Forum: MicroPython pyboard
Topic: Import Pyserial Module
Replies: 10
Views: 896

Re: Import Pyserial Module

Thank you all for the responses. I've found using the pyb.UCB_VCP method to be easiest because it still allows me to use the USB connection on both ends. However, a follow up question I have is with the write function of this class. I am attempting to do the following: USB_VCP.write(("hello\r\n").en...
by moneyman
Sun Jun 09, 2019 3:27 pm
Forum: MicroPython pyboard
Topic: Import Pyserial Module
Replies: 10
Views: 896

Re: Import Pyserial Module

Thanks for the response. Is there any way I can do the same with a serial connection over USB using the pyserial module? I'm trying to connect the Pyboard to the Raspberry Pi.
by moneyman
Thu Jun 06, 2019 8:39 pm
Forum: MicroPython pyboard
Topic: Import Pyserial Module
Replies: 10
Views: 896

Import Pyserial Module

Hi guys, I'm wrote code in main.py of the Pyboard using the pyserial module. Unfortunately, when I run the program, the pyboard does not know what the serial module is. How can I import this module through REPL given that the Pyboard is a bare metal computer and thus does not have access to the term...