Skip to main content

Timeline for Interactive shell for Arduino

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
May 2, 2021 at 13:34 comment added Eric Duminil @EmilyL. I realize I'm probably too nitpicky with all the good pieces of advice here, but for example, I wouldn't like to have to add all the commands in main.cpp even though they have already been defined somewhere else, in the corresponding libraries. I'll simply try to refactor the code and try to use the suggestions here, and see which one are easy to implement.
May 2, 2021 at 1:24 comment added Emily L. @EricDuminil the suggestion with extern'ing the commands array will fail to compile with a "multiple definition" error during the linking stage if you define it more than once. So you'd define your functions in separate files like you do, have matching header files that declare the functions and just have one main file where you add all of them (after including the matching header files) to the commands array.
May 1, 2021 at 18:02 comment added Eric Duminil Excellent, thanks. I wrote this lib for a "CO2 traffic light" (transfer.hft-stuttgart.de/gitlab/co2ampel/ampel-firmware), which is a microcontroller + CO2 sensor + LED ring. Depending on user configuration and compile flags, the ESP sends measured data over Serial/CSV/MQTT/HTTP/LoRaWAN. The corresponding commands are defined in separate files, or might not be defined at all. Your Command[] commands = {make_command("name", function, "doc"), ...} suggestion would only work if the array is defined exactly once, right?
May 1, 2021 at 17:27 comment added G. Sliepen While originally the Arduino was synonymous to the 8-bit AVR architecture, this project now supports a lot of other architectures, including 32-bit ARM and Xtensa architectures. OP mentions they are writing code for the ESP8266 and ESP32. These devices have a lot more RAM and ROM than a typical AVR chip like the ATmega328, although it's of course still a good thing to avoid unnecessary memory usage.
May 1, 2021 at 13:55 history edited Emily L. CC BY-SA 4.0
added 605 characters in body
May 1, 2021 at 13:49 history answered Emily L. CC BY-SA 4.0