Pololu-rpi-slave-arduino-library command list?

Having a great time with the A-Star 32U4 Robot Controller SV with Raspberry Pi Bridge, but I am having trouble moving past the examples. I read and reviewed:

but am not at a sufficient level of understanding to extract the commands in a usable and customizable format.

Looking for just a basic command overview to explain the individual commands used to:

  • Read from and write to the buffer in Python on the Raspberry Pi side
  • Read from and write to the buffer on the A-Star 32U4 side
  • Send commands to actuate motors and other A-Star 32U4 side actions (just read from above buffer and regex match?)

Any pointers will be greatly appreciated… did i miss a section somewhere?

Hello,

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 Data and a_star.py for your own application.

So for example, leftMotor and 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 a_star.py.

As another example, if you look at how playNotes and notes[14] 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.

-Paul

I see that I have a significantly higher amount of learning ahead of me than expected on this project.

Based on initial googling, it sounds like the Data variables could be a static register analog to IP packets, a concept with which I am more comfortable.

Thank you for this response Paul, it is very helpful and I think I better understand!