connecting PyBoard to other devices like RPi

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

connecting PyBoard to other devices like RPi

Post by kamikaze » Fri Dec 16, 2016 10:31 pm

what is the best way (I2C, SPI, UART etc.) to connect PyBoard to device like RPi? It is planned to send data to RPi and get something from it too. RPi is being a "main" device while PyBoard is planned as a standalone slave that lives its own life most of the time.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: connecting PyBoard to other devices like RPi

Post by dhylands » Sat Dec 17, 2016 12:10 am

I plug mine into the USB serial on the RPi. It behaves essentially identical to plugging it into my linux development machine.

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: connecting PyBoard to other devices like RPi

Post by kamikaze » Sat Dec 17, 2016 2:17 am

dhylands wrote:I plug mine into the USB serial on the RPi. It behaves essentially identical to plugging it into my linux development machine.
and how do they send "data" to each other? any examples? :roll:

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: connecting PyBoard to other devices like RPi

Post by dhylands » Sat Dec 17, 2016 3:05 am

I have an example here:
https://github.com/dhylands/json-ipc

which allows the host (RPi or linux PC) to send and receive packets containing JSON data. This happens to use JSON, but it could be anything.

I have other code for sending bioloid format packets of binary data as well if you're interested. It uses the same (or mostly the same) low level serial code as the JSON stuff.

Post Reply