When using the Amiga in conjunction with an Arduino, is it better to write the Arduino code in its default language and send it to the Amiga to be converted to Python or do the provided packages work better if all Arduino programs are written in Python using MicroPython to begin with?
I’d be happy to give some advice here. Can you clarify a little more on (1) how you are connecting the Arduino to the Amiga, (2) your use case, & (3) what you mean by:
send it to the Amiga to be converted to Python
Hey Kyle, I’m working with Carl on this. We plan to power a circuit (which includes an Arduino, a motor driver, and a linear actuator) through the M12 24V accessory port of the Amiga. We also plan to connect the Arduino via USB to the Amiga. Our goal is to create a custom application on the Amiga which will allow us to autonomously move the Amiga forward while simultaneously controlling the linear actuator through the Arduino. How would you recommend we pass information between the Amiga and the Arduino (for example the Amiga’s speed, position, and Boolean information from the Arduino)?
If additional clarification is needed we would be happy to provide. Any help with this is very appreciated! Thanks for your time!
Sounds like a fun project!
I would use serial communication between the brain and the arduino in that case. It shouldn’t matter what language you use on the Arduino, since you’ll just need to decode the serial messages (bytes) you pass between devices. So use Python if you want to repurpose your parsing code, or Arduino C if you don’t mind implementing that small component twice.
This isn’t something we’ve played with, but some googling shows it’s pretty common. Here’s a link, for example:
Hi Kyle, Carl again. For this example of serial communication, I take it that the Python IDLE would be replaced with the Ubuntu OS that connects to the Amiga. In that case, does the “pip install pyserial” work in the same way on Ubuntu as the commands to install the farm-ng libraries without many changes?
Yes that’s correct. And yeah they work exactly the same.
You can start out with the
amiga-app-template (see link at bottom), add
requirements.txt, and use the serial code from the hackster.io example (or something similar) in a forever running loop in the app. We have a lot of docs for setting up the app template, as well as tutorials for creating custom apps that’ll help you with this process.
You could prototype the serial comms with the app template directly on the amiga if you don’t want to set up the necessary environment on your PC.
Or you could optionally prototype the serial comms with a laptop to start out. Then if you commit & push your prototype, you can clone your app template with serial comms onto the amiga and test it there.