I’m glad to hear that you got the examples working and are trying to take the next step!
For an overview of the features of our demo code, you can look at how the
Data variables are used on the A-Star side, or look at how they are manipulated on the Pi side in
a_star.py. We don’t have a detailed specification of the interface, since this is just intended as a starting point. The idea is that once you get the demo working, you’ll want to customize
a_star.py for your own application.
So for example,
rightMotor are 16-bit variables stored at positions 6 and 8 in
Data. (You have to count the bytes stored earlier in that struct to determine these numbers.) Rather than wait for a “command”, the main loop on the A-Star constantly sets the motor speeds to the values stored in these variables. To change speeds, the Pi needs to initiate an I²C write starting at position 6, which it does with the
motors method in
As another example, if you look at how
notes are used, it is like a “command”: the Pi sets
playNotes to 1 when writing to
notes, and the A-Star sets it back to 0 after starting the sequence playing, so that it only plays a given sequence once. You could probably come up with other, more sophisticated ways of defining “commands” through the data structure.
Of course, there’s a lot you’ll need to understand about Python, Arduino, and I²C to go further with this. Please let me know if there’s anything else that I can help with.