Regbot firmware: Difference between revisions

From Rsewiki
Line 11: Line 11:
This function holds the main loop:
This function holds the main loop:
*  listen for incoming commands (from USB) and service data subscriptions.
*  listen for incoming commands (from USB) and service data subscriptions.
*  At regular intervals (1ms)
*  At regular intervals (1ms):
** Read sensors,
** Read sensors,
** Run control
** Run control
** Implement on actuators
** Implement on actuators
** Do data logging
** Do data logging

Revision as of 10:02, 11 March 2025

Back to Regbot

Main structure

The main (Arduino) file is regbot.ino

Arduino starts by calling a setup() function. This function sets up all modules and used libraries.

Arduino then calls loop(). This function holds the main loop:

  • listen for incoming commands (from USB) and service data subscriptions.
  • At regular intervals (1ms):
    • Read sensors,
    • Run control
    • Implement on actuators
    • Do data logging