From 6f77e40cb666798c77f1614154cacd90316ee1cf Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 27 Jun 2025 16:01:45 +0200 Subject: [PATCH 1/9] Fixes for analog reading --- platformio.ini | 2 +- src/main.cpp | 165 ++++++++++++++++++++++++++++--------------------- 2 files changed, 96 insertions(+), 71 deletions(-) diff --git a/platformio.ini b/platformio.ini index d43a997..4b0f15d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -95,4 +95,4 @@ lib_deps = ; arduino-libraries/Servo@^1.2.0 robtillaart/DHTNEW@^0.4.18 adafruit/Adafruit SleepyDog Library@^1.6.5 -build_flags = -std=c++2a -DMAX_SERVOS=0 \ No newline at end of file +build_flags = -std=c++2a -DMAX_SERVOS=0 -DENABLE_ADAFRUIT_WATCHDOG=1 \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index de2dbe8..4776ea4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -201,31 +201,33 @@ constexpr auto MAX_ANALOG_PINS_SUPPORTED = get_total_pins_not(analog_read_pins, analog_read_pins_size, 2047); // maximum number of pins supported -constexpr auto MAX_DIGITAL_PINS_SUPPORTED = NUM_DIGITAL_PINS; +constexpr auto MAX_PINS_SUPPORTED = NUM_DIGITAL_PINS + MAX_ANALOG_PINS_SUPPORTED; // probably too high but good enough // #define // a descriptor for digital pins struct pin_descriptor { byte pin_number; PIN_MODES pin_mode; - bool reporting_enabled; // If true, then send reports if an input pin + bool digital_reporting_enabled; // If true, then send reports if an input pin + bool analog_reporting_enabled; // If true, then send reports if an input pin int last_value; // Last value read for input mode + int differential; // difference between current and last value needed + // to generate a report + }; // an array of digital_pin_descriptors -pin_descriptor the_digital_pins[MAX_DIGITAL_PINS_SUPPORTED]; +pin_descriptor the_digital_pins[MAX_PINS_SUPPORTED]; // a descriptor for digital pins -struct analog_pin_descriptor { - byte pin_number; - PIN_MODES pin_mode; - bool reporting_enabled; // If true, then send reports if an input pin - int last_value; // Last value read for input mode - int differential; // difference between current and last value needed - // to generate a report -}; +// struct analog_pin_descriptor { +// byte pin_number; +// PIN_MODES pin_mode; +// bool reporting_enabled; // If true, then send reports if an input pin +// int last_value; // Last value read for input mode +// }; -// an array of analog_pin_descriptors -analog_pin_descriptor the_analog_pins[MAX_ANALOG_PINS_SUPPORTED]; +// // an array of analog_pin_descriptors +// analog_pin_descriptor the_analog_pins[40]; unsigned long current_millis; // for analog input loop unsigned long previous_millis; // for analog input loop @@ -333,11 +335,12 @@ void set_pin_mode() { PIN_MODES mode; pin = command_buffer[0]; mode = (PIN_MODES)command_buffer[1]; - + Serial2.println("Setting pin mode: " + String(pin) + " to " + + String(mode)); switch (mode) { case INPUT_PULL_DOWN: the_digital_pins[pin].pin_mode = mode; - the_digital_pins[pin].reporting_enabled = command_buffer[2]; + the_digital_pins[pin].digital_reporting_enabled = command_buffer[2]; the_digital_pins[pin].last_value = -1; #ifndef INPUT_PULLDOWN // for boards that do not support INPUT_PULLDOWN, fall // back to INPUT @@ -347,13 +350,13 @@ void set_pin_mode() { break; case INPUT_MODE: //[SET_PIN_MODE = 1, pin, digital_in_type, report_enable] the_digital_pins[pin].pin_mode = mode; - the_digital_pins[pin].reporting_enabled = command_buffer[2]; + the_digital_pins[pin].digital_reporting_enabled = command_buffer[2]; the_digital_pins[pin].last_value = -1; pinMode(pin, INPUT); break; case INPUT_PULL_UP: the_digital_pins[pin].pin_mode = mode; - the_digital_pins[pin].reporting_enabled = command_buffer[2]; + the_digital_pins[pin].digital_reporting_enabled = command_buffer[2]; the_digital_pins[pin].last_value = -1; pinMode(pin, INPUT_PULLUP); break; @@ -363,15 +366,16 @@ void set_pin_mode() { break; case ANALOG_INPUT: // [SET_PIN_MODE = 1, adc_pin, ANALOG_IN = 5, diff_high, // diff_low, report_enable ] - the_analog_pins[pin].pin_mode = mode; - the_analog_pins[pin].differential = + pinMode(pin, INPUT); + the_digital_pins[pin].pin_mode = mode; + the_digital_pins[pin].differential = (command_buffer[2] << 8) + command_buffer[3]; - the_analog_pins[pin].reporting_enabled = command_buffer[4]; - the_analog_pins[pin].last_value = -1; - send_debug_info(pin, the_analog_pins[pin].differential); + the_digital_pins[pin].analog_reporting_enabled = command_buffer[4]; + the_digital_pins[pin].last_value = -1; + send_debug_info(pin, the_digital_pins[pin].differential); break; case PWM: - + pinMode(pin, OUTPUT); break; default: break; @@ -411,31 +415,29 @@ void modify_reporting() { switch (command_buffer[0]) { case REPORTING_DISABLE_ALL: - for (int i = 0; i < MAX_DIGITAL_PINS_SUPPORTED; i++) { - the_digital_pins[i].reporting_enabled = false; - } - for (int i = 0; i < MAX_ANALOG_PINS_SUPPORTED; i++) { - the_analog_pins[i].reporting_enabled = false; + for (int i = 0; i < MAX_PINS_SUPPORTED; i++) { + the_digital_pins[i].digital_reporting_enabled = false; + the_digital_pins[i].analog_reporting_enabled = false; } break; case REPORTING_ANALOG_ENABLE: - if (the_analog_pins[pin].pin_mode != NOT_SET) { - the_analog_pins[pin].reporting_enabled = true; + if (the_digital_pins[pin].pin_mode != NOT_SET) { + the_digital_pins[pin].analog_reporting_enabled = true; } break; case REPORTING_ANALOG_DISABLE: - if (the_analog_pins[pin].pin_mode != NOT_SET) { - the_analog_pins[pin].reporting_enabled = false; + if (the_digital_pins[pin].pin_mode != NOT_SET) { + the_digital_pins[pin].analog_reporting_enabled = false; } break; case REPORTING_DIGITAL_ENABLE: if (the_digital_pins[pin].pin_mode != NOT_SET) { - the_digital_pins[pin].reporting_enabled = true; + the_digital_pins[pin].digital_reporting_enabled = true; } break; case REPORTING_DIGITAL_DISABLE: if (the_digital_pins[pin].pin_mode != NOT_SET) { - the_digital_pins[pin].reporting_enabled = false; + the_digital_pins[pin].digital_reporting_enabled = false; } break; default: @@ -446,9 +448,9 @@ void modify_reporting() { void get_firmware_version() { byte report_message[] = {FIRMWARE_REPORT, FIRMWARE_MAJOR, FIRMWARE_MINOR}; pinMode(LED_BUILTIN, OUTPUT); - digitalWrite(LED_BUILTIN, LOW); + digitalWrite(LED_BUILTIN, HIGH); // Serial.write(report_message, 4); - send_message(report_message); + send_message<3>(report_message); } // void are_you_there() { @@ -536,15 +538,19 @@ void servo_detach() { **********************************/ void sonar_new() { + send_debug_info(9, sonars_index); // [SONAR_NEW = 13, trigger_pin, echo_pin] if (sonars_index >= MAX_SONARS) { return; } + sonars[sonars_index].usonic = new NewPing((uint8_t)command_buffer[0], (uint8_t)command_buffer[1], 400); sonars[sonars_index].trigger_pin = command_buffer[0]; sonars_index++; // next index, so it is the number of sonars sonar_scan_interval = 100 / sonars_index; // always scan all sonars in 100ms + send_debug_info(9, sonars_index); + } /*********************************** @@ -650,7 +656,8 @@ void get_next_command() { return; } command_entry = command_table[command]; - + Serial2.print("Command: "); + Serial2.println(command); if (packet_length > 1) { // get the data for that command for (int i = 0; i < packet_length - 1; i++) { @@ -676,11 +683,11 @@ void scan_digital_inputs() { byte report_message[4] = {DIGITAL_REPORT, 0, 0}; - for (int i = 0; i < MAX_DIGITAL_PINS_SUPPORTED; i++) { + for (int i = 0; i < MAX_PINS_SUPPORTED; i++) { if (the_digital_pins[i].pin_mode == INPUT_MODE || the_digital_pins[i].pin_mode == INPUT_PULL_UP || the_digital_pins[i].pin_mode == INPUT_PULL_DOWN) { - if (the_digital_pins[i].reporting_enabled) { + if (the_digital_pins[i].digital_reporting_enabled) { // if the value changed since last read value = (byte)digitalRead(the_digital_pins[i].pin_number); if (value != the_digital_pins[i].last_value) { @@ -714,24 +721,28 @@ void scan_analog_inputs() { current_millis = millis(); if (current_millis - previous_millis > analog_sampling_interval) { previous_millis += analog_sampling_interval; - for (int i = 0; i < MAX_ANALOG_PINS_SUPPORTED; i++) { - if (the_analog_pins[i].pin_mode == ANALOG_INPUT) { - if (the_analog_pins[i].reporting_enabled) { + for (int i = 0; i < MAX_PINS_SUPPORTED; i++) { + if (the_digital_pins[i].pin_mode == ANALOG_INPUT) { + if (the_digital_pins[i].analog_reporting_enabled) { // if the value changed since last read // adjust pin number for the actual read - adjusted_pin_number = (uint8_t)(analog_read_pins[i]); + adjusted_pin_number = i; // (uint8_t)(analog_read_pins[i]); value = analogRead(adjusted_pin_number); - differential = abs(value - the_analog_pins[i].last_value); - if (differential >= the_analog_pins[i].differential) { + differential = abs(value - the_digital_pins[i].last_value); + if (differential >= the_digital_pins[i].differential) { // send_debug_info(i, differential); // trigger value achieved, send out the report - the_analog_pins[i].last_value = value; + the_digital_pins[i].last_value = value; // input_message[1] = the_analog_pins[i].pin_number; report_message[1] = (byte)adjusted_pin_number; report_message[2] = highByte(value); // get high order byte report_message[3] = lowByte(value); // Serial.write(report_message, 5); send_message(report_message); + Serial2.print("Analog pin: "); + Serial2.print(adjusted_pin_number); + Serial2.print(" value: "); + Serial2.println(value); // delay(1); } } @@ -746,9 +757,10 @@ void scan_sonars() { if (sonars_index) { sonar_current_millis = millis(); if (sonar_current_millis - sonar_previous_millis > sonar_scan_interval) { + // send_debug_info(10, sonar_current_millis); sonar_previous_millis += sonar_scan_interval; distance = sonars[last_sonar_visited].usonic->ping() / US_ROUNDTRIP_CM; - if (distance != sonars[last_sonar_visited].last_value) { + if (distance != sonars[last_sonar_visited].last_value || true) { sonars[last_sonar_visited].last_value = distance; // [SONAR_REPORT = 11, trigger_pin, distance_m, distance_cm] @@ -757,6 +769,7 @@ void scan_sonars() { SONAR_DISTANCE, sonars[last_sonar_visited].trigger_pin, (byte)(distance / 100), (byte)(distance % 100)}; // Serial.write(report_message, 5); + // send_debug_info(0, distance); send_message(report_message); } last_sonar_visited++; @@ -906,25 +919,24 @@ void reset_data() { void init_pin_structures() { // create an array of pin_descriptors for 100 pins // establish the digital pin array - for (byte i = 0; i < MAX_DIGITAL_PINS_SUPPORTED; i++) { + for (byte i = 0; i < MAX_PINS_SUPPORTED; i++) { the_digital_pins[i].pin_number = i; the_digital_pins[i].pin_mode = NOT_SET; - the_digital_pins[i].reporting_enabled = false; + the_digital_pins[i].digital_reporting_enabled = false; + the_digital_pins[i].analog_reporting_enabled = false; the_digital_pins[i].last_value = -1; + the_digital_pins[i].differential = 0; // no differential by default } - // establish the analog pin array - for (byte i = 0; i < MAX_ANALOG_PINS_SUPPORTED; i++) { - the_analog_pins[i].pin_number = i; - the_analog_pins[i].pin_mode = NOT_SET; - the_analog_pins[i].reporting_enabled = false; - the_analog_pins[i].last_value = -1; - the_analog_pins[i].differential = 0; - } } +#define RXD2 16 +#define TXD2 17 + void setup() { Serial.begin(115200); + Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2); +Serial2.println("Starting up..."); // initialize the servo allocation map table init_pin_structures(); // for (int i = 0; i < 5; i++) { @@ -946,7 +958,7 @@ void loop() { static decltype(millis()) scan_delay = 10; if (!stop_reports) { // stop reporting if (millis() - last_scan >= (scan_delay)) { - digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); + // digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // Serial.println("Scanning inputs..."); // send_debug_info(10, 10); last_scan += scan_delay; @@ -959,7 +971,8 @@ void loop() { } } } - +static_assert(command_table[32] == &ping, + "command_table[32] must be ping"); static_assert(sizeof(command_buffer) == MAX_COMMAND_LENGTH, "command_buffer size must be equal to MAX_COMMAND_LENGTH"); static_assert(command_table[37] == &feature_detection, @@ -985,10 +998,10 @@ void feature_detection() { } else if (cmd == &sonar_new) { report_message[3] = MAX_SONARS; // sonar } else if (cmd == &set_pin_mode) { - report_message[3] = MAX_DIGITAL_PINS_SUPPORTED; + report_message[3] = NUM_DIGITAL_PINS; report_message[4] = MAX_ANALOG_PINS_SUPPORTED; - report_message[5] = ANALOG_PIN_OFFSET; - for (auto i = 0; i < analog_read_pins_size; i++) { + // report_message[5] = ANALOG_PIN_OFFSET; + for (auto i = 0; i < MAX_ANALOG_PINS_SUPPORTED; i++) { report_message[6 + i] = (uint8_t)analog_read_pins[i]; } } else if (cmd == &servo_attach) { @@ -1001,17 +1014,24 @@ void feature_detection() { } else if (cmd == &get_unique_id) { report_message[3] = 0; // TODO: implement } + } else { + report_message[2] = 0; // command not supported } } send_message(report_message); } template void send_message(const uint8_t (&message)[N]) { - while (Serial.availableForWrite() < (int)N + 3) { - delayMicroseconds(10); - } + // while (Serial.availableForWrite() < (int)N + 3) { + // Serial.println("Waiting for serial write..."); + // delayMicroseconds(10); + // } Serial.write((uint8_t)N); // send msg len - Serial.write(message, N); // send message + for(auto i = 0; i < N; i++) { + Serial.write((uint8_t)message[i]); // send msg len + + } + // Serial.write(message, N); // send message } void get_unique_id() { @@ -1035,7 +1055,7 @@ bool watchdog_enabled = false; uint32_t last_ping = 0; void ping() { static uint8_t random = -1; - +// digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); auto special_num = command_buffer[0]; if (!watchdog_enabled) { #if ENABLE_ADAFRUIT_WATCHDOG @@ -1045,14 +1065,18 @@ void ping() { // watchdog_enable(WATCHDOG_TIME, // 1); // Add watchdog requiring trigger every 5s watchdog_enabled = true; - srand(millis()); - random = rand() % 100; // create some random number to let computer side - // know it is the same run + // srand(millis()); + // random = rand() % 100; // create some random number to let computer side + // // know it is the same run random = 0x1B; } uint8_t out[] = {PONG_REPORT, // write type special_num, random, 0, 0, 0, 0}; // out[0] = out.size() - 1; // dont count the packet length + // send_debug_info(1, special_num); + // send_debug_info(2, random); + // Serial2.println("Pinging..."); + send_message(out); if (true) { // watchdog_update(); @@ -1062,4 +1086,5 @@ void ping() { last_ping = millis(); } + } \ No newline at end of file From 5c75af9edb922fd347dcb0161af1bd58f8dc5abd Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Mon, 30 Jun 2025 11:44:47 +0200 Subject: [PATCH 2/9] Add pico for testing, fix sonar & servo --- README.md | 24 +- include/boards/nanoatmega.hpp | 2 +- include/boards/pico.hpp | 22 + include/main.hpp | 1 + out.txt | 1292 +++++++++++++++++++++++++++++++++ platformio.ini | 14 +- src/main.cpp | 49 +- 7 files changed, 1377 insertions(+), 27 deletions(-) create mode 100644 include/boards/pico.hpp create mode 100644 out.txt diff --git a/README.md b/README.md index e1f5a93..f199459 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ Receive: To read a digital/analog pin, you need to send a command to set the pin mode and then, on-change, the data will be sent. It's possible to switch modes during operation, even input <-> output. Just send a new ```SET_PIN_MODE``` message. #### Analog -The pin must be in range of [0..5] (pico: 26+adc_pin == gpio_pin, 4==temp_sensor). differential is the minimal change for the value or it is not reported. +The pin must be in range of [0..MAX_PINS], check before that it's an analog pin. differential is the minimal change for the value or it is not reported. Differential is ```uint16_t```, with ```diff_high = diff>>8``` and ```diff_low = diff&0xFF```. @@ -205,7 +205,7 @@ If you only want to en/disable a single pin or type, send this message. modify_type can be any of - REPORTING_DISABLE_ALL = 0. Disable analog and digital inputs reporting. Set pin to 0. - REPORTING_ANALOG_ENABLE = 1. Enable a single analog pin. Needs to have been set as analog pin otherwise UB. -- REPORTING_ANALOG_DISABLE = 3. Disable a single analog pin. Pin in range ```[0..5]``` +- REPORTING_ANALOG_DISABLE = 3. Disable a single analog pin. Pin in range ```[0..MAX_PINS]``` - REPORTING_DIGITAL_ENABLE = 2. Enable a single digital pin. Needs to have been set as digital input, otherwise UB. - REPORTING_DIGITAL_DISABLE = 4. Disable a single digital pin. @@ -270,3 +270,23 @@ time in ms. ```py [ 2, 0, enabled] ``` + + + + +# TODO: +Check (done with pico arduino): +- sonar βœ…, TODO: no value +- servoβœ… +- motor driver +- analog in +- analog out +- intensity sens +- keypad +- encoders +- (modules?) + + + +# TODO: +- check with pico code \ No newline at end of file diff --git a/include/boards/nanoatmega.hpp b/include/boards/nanoatmega.hpp index 75a4bb0..c63c403 100644 --- a/include/boards/nanoatmega.hpp +++ b/include/boards/nanoatmega.hpp @@ -15,5 +15,5 @@ const auto A16 = 2047; const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; -const uint8_t MAX_SERVOS = 4; // PWM pins on Nano +#define MAX_SERVOS 4 // PWM pins on Nano #endif \ No newline at end of file diff --git a/include/boards/pico.hpp b/include/boards/pico.hpp new file mode 100644 index 0000000..65d1e40 --- /dev/null +++ b/include/boards/pico.hpp @@ -0,0 +1,22 @@ +#pragma once +#include + +#if defined(ARDUINO_RASPBERRY_PI_PICO) && defined(ARDUINO_ARCH_RP2040) +const auto A4 = 2047; +const auto A5 = 2047; +const auto A6 = 2047; +const auto A7 = 2047; +const auto A8 = 2047; +const auto A9 = 2047; +const auto A10 = 2047; +const auto A11 = 2047; +const auto A12 = 2047; +const auto A13 = 2047; +const auto A14 = 2047; +const auto A15 = 2047; +const auto A16 = 2047; +const auto A17 = 2047; +const auto A18 = 2047; +const auto A19 = 2047; +#define MAX_SERVOS 4 // PWM pins on Nano +#endif \ No newline at end of file diff --git a/include/main.hpp b/include/main.hpp index a99df00..8e8fa18 100644 --- a/include/main.hpp +++ b/include/main.hpp @@ -4,6 +4,7 @@ #include "boards/itsybitsy_m4.hpp" #include "boards/nanoatmega.hpp" #include "boards/stm32blackpill.hpp" +#include "boards/pico.hpp" #include void get_unique_id(); diff --git a/out.txt b/out.txt new file mode 100644 index 0000000..9d2ab42 --- /dev/null +++ b/out.txt @@ -0,0 +1,1292 @@ +[test-clang-format/cpp_style_check] ⭐ Run Set up job +[test-clang-format/cpp_style_check] πŸš€ Start image=catthehacker/ubuntu:act-latest +[Arduino Compile/build-2 ] ⭐ Run Set up job +[Arduino Compile/build-2 ] πŸš€ Start image=catthehacker/ubuntu:act-latest +[Arduino Compile/build-3 ] ⭐ Run Set up job +[Arduino Compile/build-3 ] πŸš€ Start image=catthehacker/ubuntu:act-latest +[Arduino Compile/build-4 ] ⭐ Run Set up job +[Arduino Compile/build-4 ] πŸš€ Start image=catthehacker/ubuntu:act-latest +[Arduino Compile/build-1 ] ⭐ Run Set up job +[Arduino Compile/build-1 ] πŸš€ Start image=catthehacker/ubuntu:act-latest +[Arduino Compile/build-2 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true +[Arduino Compile/build-4 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true +[Arduino Compile/build-1 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true +[Arduino Compile/build-3 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true +[test-clang-format/cpp_style_check] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true +[Arduino Compile/build-3 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-1 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-2 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-3 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-1 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[test-clang-format/cpp_style_check] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-2 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[test-clang-format/cpp_style_check] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-4 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-3 ] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir= +[Arduino Compile/build-2 ] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir= +[Arduino Compile/build-1 ] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir= +[Arduino Compile/build-2 ] βœ… Success - Set up job +[Arduino Compile/build-4 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-2 ] ☁ git clone 'https://github.com/actions/setup-python' # ref=v5 +[Arduino Compile/build-1 ] βœ… Success - Set up job +[Arduino Compile/build-3 ] βœ… Success - Set up job +[Arduino Compile/build-1 ] ☁ git clone 'https://github.com/actions/setup-python' # ref=v5 +[Arduino Compile/build-3 ] ☁ git clone 'https://github.com/actions/setup-python' # ref=v5 +[test-clang-format/cpp_style_check] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir= +[test-clang-format/cpp_style_check] βœ… Success - Set up job +[test-clang-format/cpp_style_check] ☁ git clone 'https://github.com/DoozyX/clang-format-lint-action' # ref=v0.14 +[Arduino Compile/build-4 ] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir= +[Arduino Compile/build-4 ] βœ… Success - Set up job +[Arduino Compile/build-4 ] ☁ git clone 'https://github.com/actions/setup-python' # ref=v5 +[Arduino Compile/build-2 ] Non-terminating error while running 'git clone': some refs were not updated +[Arduino Compile/build-2 ] πŸ§ͺ Matrix: map[board_fqbn:robotdyn_blackpill_f303cc] +[Arduino Compile/build-2 ] ⭐ Run Main actions/checkout@v4 +[Arduino Compile/build-2 ] 🐳 docker cp src=/home/arendjan/mirte/telemetrix4arduino/. dst=/home/arendjan/mirte/telemetrix4arduino +[Arduino Compile/build-2 ] βœ… Success - Main actions/checkout@v4 +[Arduino Compile/build-2 ] ⭐ Run Main Set up Python +[Arduino Compile/build-2 ] 🐳 docker cp src=/home/arendjan/.cache/act/actions-setup-python@v5/ dst=/var/run/act/actions/actions-setup-python@v5/ +[Arduino Compile/build-2 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/setup/index.js] user= workdir= +[Arduino Compile/build-2 ] ❓ ::group::Installed versions +[Arduino Compile/build-1 ] Non-terminating error while running 'git clone': some refs were not updated +[Arduino Compile/build-1 ] πŸ§ͺ Matrix: map[board_fqbn:nanoatmega328new] +[Arduino Compile/build-2 ] | Successfully set up CPython (3.13.5) +[Arduino Compile/build-2 ] ❓ ::endgroup:: +[Arduino Compile/build-2 ] ❓ add-matcher /run/act/actions/actions-setup-python@v5/.github/python.json +[Arduino Compile/build-2 ] βœ… Success - Main Set up Python +[Arduino Compile/build-2 ] βš™ ::set-env:: pythonLocation=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-2 ] βš™ ::set-env:: PKG_CONFIG_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib/pkgconfig +[Arduino Compile/build-2 ] βš™ ::set-env:: Python_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-2 ] βš™ ::set-env:: Python2_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-2 ] βš™ ::set-env:: Python3_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-2 ] βš™ ::set-env:: LD_LIBRARY_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib +[Arduino Compile/build-2 ] βš™ ::set-output:: python-version=3.13.5 +[Arduino Compile/build-2 ] βš™ ::set-output:: python-path=/opt/hostedtoolcache/Python/3.13.5/x64/bin/python +[Arduino Compile/build-1 ] ⭐ Run Main actions/checkout@v4 +[Arduino Compile/build-2 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-2 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64/bin +[Arduino Compile/build-1 ] 🐳 docker cp src=/home/arendjan/mirte/telemetrix4arduino/. dst=/home/arendjan/mirte/telemetrix4arduino +[Arduino Compile/build-2 ] ⭐ Run Main Install dependencies +[Arduino Compile/build-1 ] βœ… Success - Main actions/checkout@v4 +[Arduino Compile/build-2 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir= +[Arduino Compile/build-1 ] ⭐ Run Main Set up Python +[Arduino Compile/build-1 ] 🐳 docker cp src=/home/arendjan/.cache/act/actions-setup-python@v5/ dst=/var/run/act/actions/actions-setup-python@v5/ +[Arduino Compile/build-1 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/setup/index.js] user= workdir= +[Arduino Compile/build-3 ] Non-terminating error while running 'git clone': some refs were not updated +[Arduino Compile/build-3 ] πŸ§ͺ Matrix: map[board_fqbn:nanoatmega328] +[Arduino Compile/build-3 ] ⭐ Run Main actions/checkout@v4 +[Arduino Compile/build-1 ] ❓ ::group::Installed versions +[Arduino Compile/build-3 ] 🐳 docker cp src=/home/arendjan/mirte/telemetrix4arduino/. dst=/home/arendjan/mirte/telemetrix4arduino +[Arduino Compile/build-1 ] | Successfully set up CPython (3.13.5) +[Arduino Compile/build-1 ] ❓ ::endgroup:: +[Arduino Compile/build-1 ] ❓ add-matcher /run/act/actions/actions-setup-python@v5/.github/python.json +[Arduino Compile/build-1 ] βœ… Success - Main Set up Python +[Arduino Compile/build-1 ] βš™ ::set-env:: Python3_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-1 ] βš™ ::set-env:: LD_LIBRARY_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib +[Arduino Compile/build-1 ] βš™ ::set-env:: pythonLocation=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-1 ] βš™ ::set-env:: PKG_CONFIG_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib/pkgconfig +[Arduino Compile/build-1 ] βš™ ::set-env:: Python_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-1 ] βš™ ::set-env:: Python2_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-2 ] | Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (25.1.1) +[Arduino Compile/build-1 ] βš™ ::set-output:: python-path=/opt/hostedtoolcache/Python/3.13.5/x64/bin/python +[Arduino Compile/build-1 ] βš™ ::set-output:: python-version=3.13.5 +[Arduino Compile/build-1 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-1 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64/bin +[Arduino Compile/build-3 ] βœ… Success - Main actions/checkout@v4 +[Arduino Compile/build-1 ] ⭐ Run Main Install dependencies +[Arduino Compile/build-3 ] ⭐ Run Main Set up Python +[Arduino Compile/build-3 ] 🐳 docker cp src=/home/arendjan/.cache/act/actions-setup-python@v5/ dst=/var/run/act/actions/actions-setup-python@v5/ +[Arduino Compile/build-1 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir= +[test-clang-format/cpp_style_check] Non-terminating error while running 'git clone': some refs were not updated +[test-clang-format/cpp_style_check] ⭐ Run Main actions/checkout@v3 +[Arduino Compile/build-2 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[test-clang-format/cpp_style_check] 🐳 docker cp src=/home/arendjan/mirte/telemetrix4arduino/. dst=/home/arendjan/mirte/telemetrix4arduino +[test-clang-format/cpp_style_check] βœ… Success - Main actions/checkout@v3 +[test-clang-format/cpp_style_check] ⭐ Run Main DoozyX/clang-format-lint-action@v0.14 +[test-clang-format/cpp_style_check] 🐳 docker build -t act-doozyx-clang-format-lint-action-v0-14-dockeraction:latest /home/arendjan/.cache/act/DoozyX-clang-format-lint-action@v0.14 +[Arduino Compile/build-3 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/setup/index.js] user= workdir= +[Arduino Compile/build-1 ] | Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (25.1.1) +[test-clang-format/cpp_style_check] 🐳 docker pull image=act-doozyx-clang-format-lint-action-v0-14-dockeraction:latest platform= username= forcePull=false +[test-clang-format/cpp_style_check] 🐳 docker create image=act-doozyx-clang-format-lint-action-v0-14-dockeraction:latest platform= entrypoint=[] cmd=["--clang-format-executable" "/clang-format/clang-format14" "-r" "--color" "always" "--style" "llvm" "--inplace" "False" "--extensions" "h,cpp" "--exclude" "none" "."] network="container:act-test-clang-format-cpp-style-check-326e39a0d645c808983c597b24e14296cd95459c3cd88b8c4801f7d7b725c758" +[Arduino Compile/build-3 ] ❓ ::group::Installed versions +[Arduino Compile/build-1 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-3 ] | Successfully set up CPython (3.13.5) +[Arduino Compile/build-3 ] ❓ ::endgroup:: +[Arduino Compile/build-3 ] ❓ add-matcher /run/act/actions/actions-setup-python@v5/.github/python.json +[Arduino Compile/build-3 ] βœ… Success - Main Set up Python +[Arduino Compile/build-3 ] βš™ ::set-env:: PKG_CONFIG_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib/pkgconfig +[Arduino Compile/build-3 ] βš™ ::set-env:: Python_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-3 ] βš™ ::set-env:: Python2_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-3 ] βš™ ::set-env:: Python3_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-3 ] βš™ ::set-env:: LD_LIBRARY_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib +[Arduino Compile/build-3 ] βš™ ::set-env:: pythonLocation=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-2 ] | Requirement already satisfied: platformio in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (6.1.18) +[Arduino Compile/build-3 ] βš™ ::set-output:: python-version=3.13.5 +[Arduino Compile/build-3 ] βš™ ::set-output:: python-path=/opt/hostedtoolcache/Python/3.13.5/x64/bin/python +[Arduino Compile/build-2 ] | Requirement already satisfied: bottle==0.13.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.13.4) +[Arduino Compile/build-3 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-3 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64/bin +[Arduino Compile/build-2 ] | Requirement already satisfied: click<8.1.8,>=8.0.4 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (8.1.7) +[Arduino Compile/build-2 ] | Requirement already satisfied: colorama in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.4.6) +[Arduino Compile/build-2 ] | Requirement already satisfied: marshmallow==3.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.26.1) +[Arduino Compile/build-2 ] | Requirement already satisfied: pyelftools<1,>=0.27 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.32) +[Arduino Compile/build-2 ] | Requirement already satisfied: pyserial==3.5.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.5) +[Arduino Compile/build-2 ] | Requirement already satisfied: requests==2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.32.4) +[Arduino Compile/build-2 ] | Requirement already satisfied: semantic_version==2.10.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.10.0) +[Arduino Compile/build-2 ] | Requirement already satisfied: tabulate==0.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.9.0) +[Arduino Compile/build-2 ] | Requirement already satisfied: ajsonrpc==1.2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-2 ] | Requirement already satisfied: starlette<0.47,>=0.19 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.46.2) +[Arduino Compile/build-2 ] | Requirement already satisfied: uvicorn<0.35,>=0.16 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.34.3) +[Arduino Compile/build-2 ] | Requirement already satisfied: wsproto==1.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-2 ] | Requirement already satisfied: packaging>=17.0 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from marshmallow==3.*->platformio) (25.0) +[Arduino Compile/build-2 ] | Requirement already satisfied: charset_normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.4.2) +[Arduino Compile/build-2 ] | Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.10) +[Arduino Compile/build-2 ] | Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2.5.0) +[Arduino Compile/build-2 ] | Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2025.6.15) +[Arduino Compile/build-2 ] | Requirement already satisfied: anyio<5,>=3.6.2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from starlette<0.47,>=0.19->platformio) (4.9.0) +[Arduino Compile/build-2 ] | Requirement already satisfied: sniffio>=1.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from anyio<5,>=3.6.2->starlette<0.47,>=0.19->platformio) (1.3.1) +[Arduino Compile/build-2 ] | Requirement already satisfied: h11>=0.8 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from uvicorn<0.35,>=0.16->platformio) (0.16.0) +[Arduino Compile/build-3 ] ⭐ Run Main Install dependencies +[Arduino Compile/build-2 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-3 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir= +[test-clang-format/cpp_style_check] 🐳 docker run image=act-doozyx-clang-format-lint-action-v0-14-dockeraction:latest platform= entrypoint=[] cmd=["--clang-format-executable" "/clang-format/clang-format14" "-r" "--color" "always" "--style" "llvm" "--inplace" "False" "--extensions" "h,cpp" "--exclude" "none" "."] network="container:act-test-clang-format-cpp-style-check-326e39a0d645c808983c597b24e14296cd95459c3cd88b8c4801f7d7b725c758" +[Arduino Compile/build-4 ] Non-terminating error while running 'git clone': some refs were not updated +[Arduino Compile/build-4 ] πŸ§ͺ Matrix: map[board_fqbn:adafruit_itsybitsy_m4] +[Arduino Compile/build-2 ] βœ… Success - Main Install dependencies +[Arduino Compile/build-4 ] ⭐ Run Main actions/checkout@v4 +[Arduino Compile/build-4 ] 🐳 docker cp src=/home/arendjan/mirte/telemetrix4arduino/. dst=/home/arendjan/mirte/telemetrix4arduino +[Arduino Compile/build-2 ] ⭐ Run Main Install platformIO libraries +[Arduino Compile/build-4 ] βœ… Success - Main actions/checkout@v4 +[Arduino Compile/build-2 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir= +[Arduino Compile/build-4 ] ⭐ Run Main Set up Python +[Arduino Compile/build-4 ] 🐳 docker cp src=/home/arendjan/.cache/act/actions-setup-python@v5/ dst=/var/run/act/actions/actions-setup-python@v5/ +[Arduino Compile/build-4 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/setup/index.js] user= workdir= +[Arduino Compile/build-2 ] | ******************************************************************************** +[Arduino Compile/build-2 ] | If you like PlatformIO, please: +[Arduino Compile/build-2 ] | - star it on GitHub > https://github.com/platformio/platformio-core +[Arduino Compile/build-2 ] | - follow us on LinkedIn to stay up-to-date on the latest project news > https://www.linkedin.com/company/platformio/ +[Arduino Compile/build-2 ] | - try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide +[Arduino Compile/build-2 ] | ******************************************************************************** +[Arduino Compile/build-2 ] | +[Arduino Compile/build-2 ] | Resolving robotdyn_blackpill_f303cc dependencies... +[Arduino Compile/build-2 ] | Platform Manager: Installing ststm32 +[Arduino Compile/build-1 ] | Requirement already satisfied: platformio in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (6.1.18) +[Arduino Compile/build-1 ] | Requirement already satisfied: bottle==0.13.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.13.4) +[Arduino Compile/build-1 ] | Requirement already satisfied: click<8.1.8,>=8.0.4 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (8.1.7) +[Arduino Compile/build-1 ] | Requirement already satisfied: colorama in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.4.6) +[Arduino Compile/build-1 ] | Requirement already satisfied: marshmallow==3.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.26.1) +[Arduino Compile/build-1 ] | Requirement already satisfied: pyelftools<1,>=0.27 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.32) +[Arduino Compile/build-1 ] | Requirement already satisfied: pyserial==3.5.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.5) +[Arduino Compile/build-1 ] | Requirement already satisfied: requests==2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.32.4) +[Arduino Compile/build-1 ] | Requirement already satisfied: semantic_version==2.10.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.10.0) +[Arduino Compile/build-1 ] | Requirement already satisfied: tabulate==0.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.9.0) +[Arduino Compile/build-1 ] | Requirement already satisfied: ajsonrpc==1.2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-1 ] | Requirement already satisfied: starlette<0.47,>=0.19 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.46.2) +[Arduino Compile/build-1 ] | Requirement already satisfied: uvicorn<0.35,>=0.16 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.34.3) +[Arduino Compile/build-1 ] | Requirement already satisfied: wsproto==1.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-1 ] | Requirement already satisfied: packaging>=17.0 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from marshmallow==3.*->platformio) (25.0) +[Arduino Compile/build-1 ] | Requirement already satisfied: charset_normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.4.2) +[Arduino Compile/build-1 ] | Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.10) +[Arduino Compile/build-1 ] | Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2.5.0) +[Arduino Compile/build-1 ] | Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2025.6.15) +[Arduino Compile/build-1 ] | Requirement already satisfied: anyio<5,>=3.6.2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from starlette<0.47,>=0.19->platformio) (4.9.0) +[Arduino Compile/build-1 ] | Requirement already satisfied: sniffio>=1.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from anyio<5,>=3.6.2->starlette<0.47,>=0.19->platformio) (1.3.1) +[Arduino Compile/build-1 ] | Requirement already satisfied: h11>=0.8 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from uvicorn<0.35,>=0.16->platformio) (0.16.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (25.1.1) +[Arduino Compile/build-1 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-1 ] βœ… Success - Main Install dependencies +[Arduino Compile/build-3 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-1 ] ⭐ Run Main Install platformIO libraries +[Arduino Compile/build-4 ] ❓ ::group::Installed versions +[Arduino Compile/build-4 ] | Successfully set up CPython (3.13.5) +[Arduino Compile/build-4 ] ❓ ::endgroup:: +[Arduino Compile/build-4 ] ❓ add-matcher /run/act/actions/actions-setup-python@v5/.github/python.json +[Arduino Compile/build-1 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir= +[Arduino Compile/build-4 ] βœ… Success - Main Set up Python +[Arduino Compile/build-4 ] βš™ ::set-env:: Python2_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-4 ] βš™ ::set-env:: Python3_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-4 ] βš™ ::set-env:: LD_LIBRARY_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib +[Arduino Compile/build-4 ] βš™ ::set-env:: pythonLocation=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-4 ] βš™ ::set-env:: PKG_CONFIG_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib/pkgconfig +[Arduino Compile/build-4 ] βš™ ::set-env:: Python_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-4 ] βš™ ::set-output:: python-version=3.13.5 +[Arduino Compile/build-4 ] βš™ ::set-output:: python-path=/opt/hostedtoolcache/Python/3.13.5/x64/bin/python +[Arduino Compile/build-4 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-4 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64/bin +[test-clang-format/cpp_style_check] | Processing 4 files: ./src/i2c.cpp, ./src/main.cpp, ./lib/OpticalEncoder/OpticalEncoder.h, ./include/Telemetrix4Arduino.h +[Arduino Compile/build-4 ] ⭐ Run Main Install dependencies +[test-clang-format/cpp_style_check] | --- ./src/main.cpp (original) +[test-clang-format/cpp_style_check] | +++ ./src/main.cpp (reformatted) +[test-clang-format/cpp_style_check] | @@ -630,7 +630,7 @@ +[test-clang-format/cpp_style_check] |  // send_debug_info(0, packet_length); +[test-clang-format/cpp_style_check] | auto max_wait = 10; // wait for the command to be available +[test-clang-format/cpp_style_check] | while (max_wait-- > 0 && !Serial.available()) { +[test-clang-format/cpp_style_check] | - delayMicroseconds(10); +[test-clang-format/cpp_style_check] | + delayMicroseconds(10); +[test-clang-format/cpp_style_check] |  } +[test-clang-format/cpp_style_check] | if (packet_length == 0) { +[test-clang-format/cpp_style_check] | return; // no command to process, reset bytes +[test-clang-format/cpp_style_check] | @@ -933,7 +933,7 @@ +[test-clang-format/cpp_style_check] |  // digitalWrite(LED_BUILTIN, HIGH); +[test-clang-format/cpp_style_check] | // delay(100); +[test-clang-format/cpp_style_check] | // } +[test-clang-format/cpp_style_check] | - for(auto i = 0; i < 0xFF; i++) { +[test-clang-format/cpp_style_check] | + for (auto i = 0; i < 0xFF; i++) { +[test-clang-format/cpp_style_check] |  Serial.write(0); +[test-clang-format/cpp_style_check] | } +[test-clang-format/cpp_style_check] | // get_firmware_version(); +[test-clang-format/cpp_style_check] | @@ -946,7 +946,7 @@ +[test-clang-format/cpp_style_check] |  static decltype(millis()) scan_delay = 10; +[test-clang-format/cpp_style_check] | if (!stop_reports) { // stop reporting +[test-clang-format/cpp_style_check] | if (millis() - last_scan >= (scan_delay)) { +[test-clang-format/cpp_style_check] | - digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); +[test-clang-format/cpp_style_check] | + digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); +[test-clang-format/cpp_style_check] |  // Serial.println("Scanning inputs..."); +[test-clang-format/cpp_style_check] | // send_debug_info(10, 10); +[test-clang-format/cpp_style_check] | last_scan += scan_delay; +[test-clang-format/cpp_style_check] | @@ -1008,7 +1008,7 @@ +[test-clang-format/cpp_style_check] |  +[test-clang-format/cpp_style_check] | template void send_message(const uint8_t (&message)[N]) { +[test-clang-format/cpp_style_check] | while (Serial.availableForWrite() < (int)N + 3) { +[test-clang-format/cpp_style_check] | - delayMicroseconds(10); +[test-clang-format/cpp_style_check] | + delayMicroseconds(10); +[test-clang-format/cpp_style_check] |  } +[test-clang-format/cpp_style_check] | Serial.write((uint8_t)N); // send msg len +[test-clang-format/cpp_style_check] | Serial.write(message, N); // send message +[Arduino Compile/build-4 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir= +[test-clang-format/cpp_style_check] ❌ Failure - Main DoozyX/clang-format-lint-action@v0.14 +[test-clang-format/cpp_style_check] exit with `FAILURE`: 1 +[test-clang-format/cpp_style_check] ⭐ Run Complete job +[test-clang-format/cpp_style_check] βœ… Success - Complete job +[test-clang-format/cpp_style_check] 🏁 Job failed +[Arduino Compile/build-1 ] | ******************************************************************************** +[Arduino Compile/build-1 ] | If you like PlatformIO, please: +[Arduino Compile/build-1 ] | - star it on GitHub > https://github.com/platformio/platformio-core +[Arduino Compile/build-1 ] | - follow us on LinkedIn to stay up-to-date on the latest project news > https://www.linkedin.com/company/platformio/ +[Arduino Compile/build-1 ] | - try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide +[Arduino Compile/build-1 ] | ******************************************************************************** +[Arduino Compile/build-1 ] | +[Arduino Compile/build-1 ] | Resolving nanoatmega328new dependencies... +[Arduino Compile/build-1 ] | Platform Manager: Installing atmelavr +[Arduino Compile/build-3 ] | Requirement already satisfied: platformio in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (6.1.18) +[Arduino Compile/build-3 ] | Requirement already satisfied: bottle==0.13.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.13.4) +[Arduino Compile/build-3 ] | Requirement already satisfied: click<8.1.8,>=8.0.4 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (8.1.7) +[Arduino Compile/build-3 ] | Requirement already satisfied: colorama in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.4.6) +[Arduino Compile/build-3 ] | Requirement already satisfied: marshmallow==3.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.26.1) +[Arduino Compile/build-3 ] | Requirement already satisfied: pyelftools<1,>=0.27 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.32) +[Arduino Compile/build-3 ] | Requirement already satisfied: pyserial==3.5.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.5) +[Arduino Compile/build-3 ] | Requirement already satisfied: requests==2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.32.4) +[Arduino Compile/build-3 ] | Requirement already satisfied: semantic_version==2.10.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.10.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: tabulate==0.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.9.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: ajsonrpc==1.2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: starlette<0.47,>=0.19 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.46.2) +[Arduino Compile/build-3 ] | Requirement already satisfied: uvicorn<0.35,>=0.16 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.34.3) +[Arduino Compile/build-3 ] | Requirement already satisfied: wsproto==1.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: packaging>=17.0 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from marshmallow==3.*->platformio) (25.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: charset_normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.4.2) +[Arduino Compile/build-3 ] | Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.10) +[Arduino Compile/build-3 ] | Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2.5.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2025.6.15) +[Arduino Compile/build-3 ] | Requirement already satisfied: anyio<5,>=3.6.2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from starlette<0.47,>=0.19->platformio) (4.9.0) +[Arduino Compile/build-3 ] | Requirement already satisfied: sniffio>=1.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from anyio<5,>=3.6.2->starlette<0.47,>=0.19->platformio) (1.3.1) +[Arduino Compile/build-3 ] | Requirement already satisfied: h11>=0.8 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from uvicorn<0.35,>=0.16->platformio) (0.16.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (25.1.1) +[Arduino Compile/build-3 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-3 ] βœ… Success - Main Install dependencies +[Arduino Compile/build-4 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-3 ] ⭐ Run Main Install platformIO libraries +[Arduino Compile/build-3 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir= +[Arduino Compile/build-3 ] | ******************************************************************************** +[Arduino Compile/build-3 ] | If you like PlatformIO, please: +[Arduino Compile/build-3 ] | - star it on GitHub > https://github.com/platformio/platformio-core +[Arduino Compile/build-3 ] | - follow us on LinkedIn to stay up-to-date on the latest project news > https://www.linkedin.com/company/platformio/ +[Arduino Compile/build-3 ] | - try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide +[Arduino Compile/build-3 ] | ******************************************************************************** +[Arduino Compile/build-3 ] | +[Arduino Compile/build-3 ] | Resolving nanoatmega328 dependencies... +[Arduino Compile/build-3 ] | Platform Manager: Installing atmelavr +[Arduino Compile/build-4 ] | Requirement already satisfied: platformio in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (6.1.18) +[Arduino Compile/build-4 ] | Requirement already satisfied: bottle==0.13.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.13.4) +[Arduino Compile/build-4 ] | Requirement already satisfied: click<8.1.8,>=8.0.4 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (8.1.7) +[Arduino Compile/build-4 ] | Requirement already satisfied: colorama in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.4.6) +[Arduino Compile/build-4 ] | Requirement already satisfied: marshmallow==3.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.26.1) +[Arduino Compile/build-4 ] | Requirement already satisfied: pyelftools<1,>=0.27 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.32) +[Arduino Compile/build-4 ] | Requirement already satisfied: pyserial==3.5.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.5) +[Arduino Compile/build-4 ] | Requirement already satisfied: requests==2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.32.4) +[Arduino Compile/build-4 ] | Requirement already satisfied: semantic_version==2.10.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.10.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: tabulate==0.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.9.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: ajsonrpc==1.2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: starlette<0.47,>=0.19 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.46.2) +[Arduino Compile/build-4 ] | Requirement already satisfied: uvicorn<0.35,>=0.16 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.34.3) +[Arduino Compile/build-4 ] | Requirement already satisfied: wsproto==1.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: packaging>=17.0 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from marshmallow==3.*->platformio) (25.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: charset_normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.4.2) +[Arduino Compile/build-4 ] | Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.10) +[Arduino Compile/build-4 ] | Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2.5.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2025.6.15) +[Arduino Compile/build-4 ] | Requirement already satisfied: anyio<5,>=3.6.2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from starlette<0.47,>=0.19->platformio) (4.9.0) +[Arduino Compile/build-4 ] | Requirement already satisfied: sniffio>=1.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from anyio<5,>=3.6.2->starlette<0.47,>=0.19->platformio) (1.3.1) +[Arduino Compile/build-4 ] | Requirement already satisfied: h11>=0.8 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from uvicorn<0.35,>=0.16->platformio) (0.16.0) +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% 30% 40% 50% 60% +[Arduino Compile/build-4 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-4 ] βœ… Success - Main Install dependencies +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] ⭐ Run Main Install platformIO libraries +[Arduino Compile/build-1 ] | Platform Manager: atmelavr@5.1.0 has been installed! +[Arduino Compile/build-4 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir= +[Arduino Compile/build-1 ] | Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.70300.0 +[Arduino Compile/build-4 ] | ******************************************************************************** +[Arduino Compile/build-4 ] | If you like PlatformIO, please: +[Arduino Compile/build-4 ] | - star it on GitHub > https://github.com/platformio/platformio-core +[Arduino Compile/build-4 ] | - follow us on LinkedIn to stay up-to-date on the latest project news > https://www.linkedin.com/company/platformio/ +[Arduino Compile/build-4 ] | - try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide +[Arduino Compile/build-4 ] | ******************************************************************************** +[Arduino Compile/build-4 ] | +[Arduino Compile/build-4 ] | Resolving adafruit_itsybitsy_m4 dependencies... +[Arduino Compile/build-4 ] | Platform Manager: Installing atmelsam +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% 30% 40% 50% 60% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Platform Manager: atmelavr@5.1.0 has been installed! +[Arduino Compile/build-3 ] | Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.70300.0 +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Platform Manager: atmelsam@8.3.0 has been installed! +[Arduino Compile/build-4 ] | Tool Manager: Installing platformio/toolchain-gccarmnoneeabi @ ~1.90301.0 +[Arduino Compile/build-2 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-2 ] | Platform Manager: ststm32@19.2.0 has been installed! +[Arduino Compile/build-2 ] | Tool Manager: Installing platformio/toolchain-gccarmnoneeabi @ * +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Tool Manager: toolchain-atmelavr@1.70300.191015 has been installed! +[Arduino Compile/build-1 ] | Tool Manager: Installing platformio/framework-arduino-avr @ ~5.2.0 +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Tool Manager: toolchain-atmelavr@1.70300.191015 has been installed! +[Arduino Compile/build-3 ] | Tool Manager: Installing platformio/framework-arduino-avr @ ~5.2.0 +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Tool Manager: framework-arduino-avr@5.2.0 has been installed! +[Arduino Compile/build-3 ] | Tool Manager: Installing platformio/tool-scons @ ~4.40801.0 +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Tool Manager: tool-scons@4.40801.0 has been installed! +[Arduino Compile/build-3 ] | Library Manager: Installing teckel12/NewPing @ ^1.9.7 +[Arduino Compile/build-4 ] | Tool Manager: toolchain-gccarmnoneeabi@1.90301.200702 has been installed! +[Arduino Compile/build-4 ] | Tool Manager: Installing platformio/framework-arduino-samd-adafruit @ ~1.10716.0 +[Arduino Compile/build-2 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Library Manager: NewPing@1.9.7 has been installed! +[Arduino Compile/build-3 ] | Library Manager: Installing arduino-libraries/Stepper @ ^1.1.3 +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Tool Manager: framework-arduino-avr@5.2.0 has been installed! +[Arduino Compile/build-1 ] | Tool Manager: Installing platformio/tool-scons @ ~4.40801.0 +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Downloading 0% 10% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% +[Arduino Compile/build-3 ] | Library Manager: Stepper@1.1.3 has been installed! +[Arduino Compile/build-3 ] | Library Manager: Installing arduino-libraries/Servo @ ^1.2.0 +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Tool Manager: framework-arduino-samd-adafruit@1.10716.0 has been installed! +[Arduino Compile/build-4 ] | Tool Manager: Installing platformio/framework-cmsis @ ~2.50400.0 +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Tool Manager: tool-scons@4.40801.0 has been installed! +[Arduino Compile/build-1 ] | Library Manager: Installing teckel12/NewPing @ ^1.9.7 +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% 30% 40% 50% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Library Manager: Servo@1.2.2 has been installed! +[Arduino Compile/build-3 ] | Library Manager: Installing robtillaart/DHTNEW @ ^0.4.18 +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Library Manager: NewPing@1.9.7 has been installed! +[Arduino Compile/build-1 ] | Library Manager: Installing arduino-libraries/Stepper @ ^1.1.3 +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% 30% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Library Manager: DHTNEW@0.4.21 has been installed! +[Arduino Compile/build-3 ] | Library Manager: Installing adafruit/Adafruit SleepyDog Library @ ^1.6.5 +[Arduino Compile/build-1 ] | Downloading 0% 10% +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% +[Arduino Compile/build-1 ] | Library Manager: Stepper@1.1.3 has been installed! +[Arduino Compile/build-1 ] | Library Manager: Installing arduino-libraries/Servo @ ^1.2.0 +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Tool Manager: framework-cmsis@2.50400.181126 has been installed! +[Arduino Compile/build-4 ] | Tool Manager: Installing platformio/framework-cmsis-atmel @ ~1.2.2 +[Arduino Compile/build-3 ] | Downloading 0% 10% 20% +[Arduino Compile/build-3 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Library Manager: Adafruit SleepyDog Library@1.6.5 has been installed! +[Arduino Compile/build-3 ] βœ… Success - Main Install platformIO libraries +[Arduino Compile/build-3 ] ⭐ Run Main Run PlatformIO +[Arduino Compile/build-3 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir= +[Arduino Compile/build-3 ] | Processing nanoatmega328 (platform: atmelavr; board: nanoatmega328; framework: arduino) +[Arduino Compile/build-3 ] | -------------------------------------------------------------------------------- +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% 30% 40% 50% +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Library Manager: Servo@1.2.2 has been installed! +[Arduino Compile/build-1 ] | Library Manager: Installing robtillaart/DHTNEW @ ^0.4.18 +[Arduino Compile/build-3 ] | Verbose mode can be enabled via `-v, --verbose` option +[Arduino Compile/build-3 ] | CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328.html +[Arduino Compile/build-3 ] | PLATFORM: Atmel AVR (5.1.0) > Arduino Nano ATmega328 +[Arduino Compile/build-3 ] | HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash +[Arduino Compile/build-3 ] | DEBUG: Current (avr-stub) External (avr-stub, simavr) +[Arduino Compile/build-3 ] | PACKAGES: +[Arduino Compile/build-3 ] | - framework-arduino-avr @ 5.2.0 +[Arduino Compile/build-3 ] | - toolchain-atmelavr @ 1.70300.191015 (7.3.0) +[Arduino Compile/build-3 ] | LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf +[Arduino Compile/build-3 ] | LDF Modes: Finder ~ chain, Compatibility ~ soft +[Arduino Compile/build-3 ] | Found 11 compatible libraries +[Arduino Compile/build-3 ] | Scanning dependencies... +[Arduino Compile/build-3 ] | Dependency Graph +[Arduino Compile/build-3 ] | |-- NewPing @ 1.9.7 +[Arduino Compile/build-3 ] | |-- Stepper @ 1.1.3 +[Arduino Compile/build-3 ] | |-- Servo @ 1.2.2 +[Arduino Compile/build-3 ] | |-- DHTNEW @ 0.4.21 +[Arduino Compile/build-3 ] | |-- Adafruit SleepyDog Library @ 1.6.5 +[Arduino Compile/build-3 ] | |-- Wire @ 1.0 +[Arduino Compile/build-3 ] | |-- OpticalEncoder +[Arduino Compile/build-3 ] | Building in release mode +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/src/i2c.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/src/main.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib6de/NewPing/NewPing.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib227/Stepper/Stepper.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/avr/Servo.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/mbed/Servo.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/megaavr/Servo.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/nrf52/Servo.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/renesas/Servo.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/sam/Servo.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/samd/Servo.cpp.o +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/lib227/libStepper.a +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/lib6de/libNewPing.a +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/lib227/libStepper.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/stm32f4/Servo.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5f8/Servo/xmc/Servo.cpp.o +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/lib6de/libNewPing.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib5be/DHTNEW/dhtnew.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/Adafruit_SleepyDog.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogAVR.cpp.o +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/lib5f8/libServo.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogESP32.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogESP8266.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogKinetisK.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogKinetisL.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogNRF.cpp.o +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/lib5f8/libServo.a +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/lib5be/libDHTNEW.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogRP2040.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/libcc5/Adafruit SleepyDog Library/utility/WatchdogSAMD.cpp.o +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/lib5be/libDHTNEW.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib143/Wire/Wire.cpp.o +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/lib143/Wire/utility/twi.c.o +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/libcc5/libAdafruit SleepyDog Library.a +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/libFrameworkArduinoVariant.a +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/libcc5/libAdafruit SleepyDog Library.a +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/libFrameworkArduinoVariant.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/CDC.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/HardwareSerial.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/HardwareSerial0.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/HardwareSerial1.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/HardwareSerial2.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/HardwareSerial3.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/IPAddress.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/PluggableUSB.cpp.o +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/lib143/libWire.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/Print.cpp.o +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/lib143/libWire.a +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/Stream.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/Tone.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/USBCore.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/WInterrupts.c.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/WMath.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/WString.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/abi.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/hooks.c.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/main.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/new.cpp.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/wiring.c.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/wiring_analog.c.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/wiring_digital.c.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/wiring_pulse.S.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/wiring_pulse.c.o +[Arduino Compile/build-3 ] | Compiling .pio/build/nanoatmega328/FrameworkArduino/wiring_shift.c.o +[Arduino Compile/build-3 ] | Archiving .pio/build/nanoatmega328/libFrameworkArduino.a +[Arduino Compile/build-3 ] | Indexing .pio/build/nanoatmega328/libFrameworkArduino.a +[Arduino Compile/build-3 ] | Linking .pio/build/nanoatmega328/firmware.elf +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% 30% +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Library Manager: DHTNEW@0.4.21 has been installed! +[Arduino Compile/build-1 ] | Library Manager: Installing adafruit/Adafruit SleepyDog Library @ ^1.6.5 +[Arduino Compile/build-3 ] | Checking size .pio/build/nanoatmega328/firmware.elf +[Arduino Compile/build-3 ] | Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" +[Arduino Compile/build-3 ] | RAM: [==== ] 40.9% (used 838 bytes from 2048 bytes) +[Arduino Compile/build-3 ] | Flash: [==== ] 40.9% (used 12560 bytes from 30720 bytes) +[Arduino Compile/build-3 ] | Building .pio/build/nanoatmega328/firmware.hex +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-3 ] | ========================= [SUCCESS] Took 2.69 seconds ========================= +[Arduino Compile/build-3 ] | +[Arduino Compile/build-3 ] | Environment Status Duration +[Arduino Compile/build-3 ] | ------------- -------- ------------ +[Arduino Compile/build-3 ] | nanoatmega328 SUCCESS 00:00:02.692 +[Arduino Compile/build-3 ] | ========================= 1 succeeded in 00:00:02.692 ========================= +[Arduino Compile/build-3 ] βœ… Success - Main Run PlatformIO +[Arduino Compile/build-3 ] ⭐ Run Post Set up Python +[Arduino Compile/build-3 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/cache-save/index.js] user= workdir= +[Arduino Compile/build-4 ] | Tool Manager: framework-cmsis-atmel@1.2.2 has been installed! +[Arduino Compile/build-4 ] | Tool Manager: Installing platformio/tool-scons @ ~4.40801.0 +[Arduino Compile/build-3 ] βœ… Success - Post Set up Python +[Arduino Compile/build-3 ] ⭐ Run Complete job +[Arduino Compile/build-3 ] Cleaning up container for job build +[Arduino Compile/build-3 ] βœ… Success - Complete job +[Arduino Compile/build-3 ] 🏁 Job succeeded +[Arduino Compile/build-5 ] ⭐ Run Set up job +[Arduino Compile/build-5 ] πŸš€ Start image=catthehacker/ubuntu:act-latest +[Arduino Compile/build-5 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Downloading 0% 10% 20% +[Arduino Compile/build-1 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Library Manager: Adafruit SleepyDog Library@1.6.5 has been installed! +[Arduino Compile/build-1 ] βœ… Success - Main Install platformIO libraries +[Arduino Compile/build-1 ] ⭐ Run Main Run PlatformIO +[Arduino Compile/build-1 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir= +[Arduino Compile/build-5 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-1 ] | Processing nanoatmega328new (platform: atmelavr; board: nanoatmega328new; framework: arduino) +[Arduino Compile/build-1 ] | -------------------------------------------------------------------------------- +[Arduino Compile/build-5 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Tool Manager: tool-scons@4.40801.0 has been installed! +[Arduino Compile/build-4 ] | Library Manager: Installing teckel12/NewPing @ ^1.9.7 +[Arduino Compile/build-5 ] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir= +[Arduino Compile/build-5 ] βœ… Success - Set up job +[Arduino Compile/build-5 ] ☁ git clone 'https://github.com/actions/setup-python' # ref=v5 +[Arduino Compile/build-1 ] | Verbose mode can be enabled via `-v, --verbose` option +[Arduino Compile/build-1 ] | CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328new.html +[Arduino Compile/build-1 ] | PLATFORM: Atmel AVR (5.1.0) > Arduino Nano ATmega328 (New Bootloader) +[Arduino Compile/build-1 ] | HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash +[Arduino Compile/build-1 ] | DEBUG: Current (avr-stub) External (avr-stub, simavr) +[Arduino Compile/build-1 ] | PACKAGES: +[Arduino Compile/build-1 ] | - framework-arduino-avr @ 5.2.0 +[Arduino Compile/build-1 ] | - toolchain-atmelavr @ 1.70300.191015 (7.3.0) +[Arduino Compile/build-1 ] | LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf +[Arduino Compile/build-1 ] | LDF Modes: Finder ~ chain, Compatibility ~ soft +[Arduino Compile/build-1 ] | Found 11 compatible libraries +[Arduino Compile/build-1 ] | Scanning dependencies... +[Arduino Compile/build-1 ] | Dependency Graph +[Arduino Compile/build-1 ] | |-- NewPing @ 1.9.7 +[Arduino Compile/build-1 ] | |-- Stepper @ 1.1.3 +[Arduino Compile/build-1 ] | |-- Servo @ 1.2.2 +[Arduino Compile/build-1 ] | |-- DHTNEW @ 0.4.21 +[Arduino Compile/build-1 ] | |-- Adafruit SleepyDog Library @ 1.6.5 +[Arduino Compile/build-1 ] | |-- Wire @ 1.0 +[Arduino Compile/build-1 ] | |-- OpticalEncoder +[Arduino Compile/build-2 ] | Tool Manager: toolchain-gccarmnoneeabi@1.140201.0 has been installed! +[Arduino Compile/build-2 ] | Tool Manager: Installing platformio/framework-cmsis @ ~2.50900.0 +[Arduino Compile/build-1 ] | Building in release mode +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/src/i2c.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/src/main.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/libb7f/NewPing/NewPing.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib88e/Stepper/Stepper.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/avr/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/mbed/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/megaavr/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/nrf52/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/renesas/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/sam/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/samd/Servo.cpp.o +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/lib88e/libStepper.a +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/libb7f/libNewPing.a +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/lib88e/libStepper.a +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/libb7f/libNewPing.a +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/stm32f4/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/liba34/Servo/xmc/Servo.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/libe9a/DHTNEW/dhtnew.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/Adafruit_SleepyDog.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogAVR.cpp.o +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/liba34/libServo.a +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogESP32.cpp.o +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/liba34/libServo.a +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogESP8266.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogKinetisK.cpp.o +[Arduino Compile/build-5 ] Non-terminating error while running 'git clone': some refs were not updated +[Arduino Compile/build-5 ] πŸ§ͺ Matrix: map[board_fqbn:program_via_AVRISP_mkII] +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogKinetisL.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogNRF.cpp.o +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/libe9a/libDHTNEW.a +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogRP2040.cpp.o +[Arduino Compile/build-5 ] ⭐ Run Main actions/checkout@v4 +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib2f2/Adafruit SleepyDog Library/utility/WatchdogSAMD.cpp.o +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/libe9a/libDHTNEW.a +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib143/Wire/Wire.cpp.o +[Arduino Compile/build-5 ] 🐳 docker cp src=/home/arendjan/mirte/telemetrix4arduino/. dst=/home/arendjan/mirte/telemetrix4arduino +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/lib143/Wire/utility/twi.c.o +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/lib2f2/libAdafruit SleepyDog Library.a +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/libFrameworkArduinoVariant.a +[Arduino Compile/build-5 ] βœ… Success - Main actions/checkout@v4 +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/CDC.cpp.o +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/lib2f2/libAdafruit SleepyDog Library.a +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/libFrameworkArduinoVariant.a +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/HardwareSerial.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/HardwareSerial0.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/HardwareSerial1.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/HardwareSerial2.cpp.o +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/lib143/libWire.a +[Arduino Compile/build-5 ] ⭐ Run Main Set up Python +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/HardwareSerial3.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/IPAddress.cpp.o +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/lib143/libWire.a +[Arduino Compile/build-5 ] 🐳 docker cp src=/home/arendjan/.cache/act/actions-setup-python@v5/ dst=/var/run/act/actions/actions-setup-python@v5/ +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/PluggableUSB.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/Print.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/Stream.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/Tone.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/USBCore.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/WInterrupts.c.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/WMath.cpp.o +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Library Manager: NewPing@1.9.7 has been installed! +[Arduino Compile/build-4 ] | Library Manager: Installing arduino-libraries/Stepper @ ^1.1.3 +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/WString.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/abi.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/hooks.c.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/main.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/new.cpp.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/wiring.c.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/wiring_analog.c.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/wiring_digital.c.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/wiring_pulse.S.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/wiring_pulse.c.o +[Arduino Compile/build-1 ] | Compiling .pio/build/nanoatmega328new/FrameworkArduino/wiring_shift.c.o +[Arduino Compile/build-1 ] | Archiving .pio/build/nanoatmega328new/libFrameworkArduino.a +[Arduino Compile/build-1 ] | Indexing .pio/build/nanoatmega328new/libFrameworkArduino.a +[Arduino Compile/build-1 ] | Linking .pio/build/nanoatmega328new/firmware.elf +[Arduino Compile/build-5 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/setup/index.js] user= workdir= +[Arduino Compile/build-1 ] | Checking size .pio/build/nanoatmega328new/firmware.elf +[Arduino Compile/build-1 ] | Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" +[Arduino Compile/build-1 ] | RAM: [==== ] 40.9% (used 838 bytes from 2048 bytes) +[Arduino Compile/build-1 ] | Flash: [==== ] 40.9% (used 12560 bytes from 30720 bytes) +[Arduino Compile/build-1 ] | Building .pio/build/nanoatmega328new/firmware.hex +[Arduino Compile/build-5 ] ❓ ::group::Installed versions +[Arduino Compile/build-5 ] | Successfully set up CPython (3.13.5) +[Arduino Compile/build-5 ] ❓ ::endgroup:: +[Arduino Compile/build-5 ] ❓ add-matcher /run/act/actions/actions-setup-python@v5/.github/python.json +[Arduino Compile/build-5 ] βœ… Success - Main Set up Python +[Arduino Compile/build-5 ] βš™ ::set-env:: Python_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-5 ] βš™ ::set-env:: Python2_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-5 ] βš™ ::set-env:: Python3_ROOT_DIR=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-5 ] βš™ ::set-env:: LD_LIBRARY_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib +[Arduino Compile/build-5 ] βš™ ::set-env:: pythonLocation=/opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-5 ] βš™ ::set-env:: PKG_CONFIG_PATH=/opt/hostedtoolcache/Python/3.13.5/x64/lib/pkgconfig +[Arduino Compile/build-5 ] βš™ ::set-output:: python-version=3.13.5 +[Arduino Compile/build-5 ] βš™ ::set-output:: python-path=/opt/hostedtoolcache/Python/3.13.5/x64/bin/python +[Arduino Compile/build-5 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64 +[Arduino Compile/build-5 ] βš™ ::add-path:: /opt/hostedtoolcache/Python/3.13.5/x64/bin +[Arduino Compile/build-1 ] | ========================= [SUCCESS] Took 2.62 seconds ========================= +[Arduino Compile/build-1 ] | +[Arduino Compile/build-1 ] | Environment Status Duration +[Arduino Compile/build-1 ] | ---------------- -------- ------------ +[Arduino Compile/build-1 ] | nanoatmega328new SUCCESS 00:00:02.624 +[Arduino Compile/build-1 ] | ========================= 1 succeeded in 00:00:02.624 ========================= +[Arduino Compile/build-5 ] ⭐ Run Main Install dependencies +[Arduino Compile/build-1 ] βœ… Success - Main Run PlatformIO +[Arduino Compile/build-5 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir= +[Arduino Compile/build-1 ] ⭐ Run Post Set up Python +[Arduino Compile/build-1 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/cache-save/index.js] user= workdir= +[Arduino Compile/build-1 ] βœ… Success - Post Set up Python +[Arduino Compile/build-1 ] ⭐ Run Complete job +[Arduino Compile/build-1 ] Cleaning up container for job build +[Arduino Compile/build-1 ] βœ… Success - Complete job +[Arduino Compile/build-1 ] 🏁 Job succeeded +[Arduino Compile/build-5 ] | Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (25.1.1) +[Arduino Compile/build-2 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-4 ] | Downloading 0% 10% +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% +[Arduino Compile/build-4 ] | Library Manager: Stepper@1.1.3 has been installed! +[Arduino Compile/build-4 ] | Library Manager: Installing robtillaart/DHTNEW @ ^0.4.18 +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Requirement already satisfied: platformio in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (6.1.18) +[Arduino Compile/build-5 ] | Requirement already satisfied: bottle==0.13.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.13.4) +[Arduino Compile/build-5 ] | Requirement already satisfied: click<8.1.8,>=8.0.4 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (8.1.7) +[Arduino Compile/build-5 ] | Requirement already satisfied: colorama in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.4.6) +[Arduino Compile/build-5 ] | Requirement already satisfied: marshmallow==3.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.26.1) +[Arduino Compile/build-5 ] | Requirement already satisfied: pyelftools<1,>=0.27 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.32) +[Arduino Compile/build-5 ] | Requirement already satisfied: pyserial==3.5.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (3.5) +[Arduino Compile/build-5 ] | Requirement already satisfied: requests==2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.32.4) +[Arduino Compile/build-5 ] | Requirement already satisfied: semantic_version==2.10.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (2.10.0) +[Arduino Compile/build-5 ] | Requirement already satisfied: tabulate==0.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.9.0) +[Arduino Compile/build-5 ] | Requirement already satisfied: ajsonrpc==1.2.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-5 ] | Requirement already satisfied: starlette<0.47,>=0.19 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.46.2) +[Arduino Compile/build-5 ] | Requirement already satisfied: uvicorn<0.35,>=0.16 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (0.34.3) +[Arduino Compile/build-5 ] | Requirement already satisfied: wsproto==1.* in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from platformio) (1.2.0) +[Arduino Compile/build-5 ] | Requirement already satisfied: packaging>=17.0 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from marshmallow==3.*->platformio) (25.0) +[Arduino Compile/build-5 ] | Requirement already satisfied: charset_normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.4.2) +[Arduino Compile/build-5 ] | Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (3.10) +[Arduino Compile/build-5 ] | Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2.5.0) +[Arduino Compile/build-5 ] | Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from requests==2.*->platformio) (2025.6.15) +[Arduino Compile/build-2 ] | Tool Manager: framework-cmsis@2.50900.0 has been installed! +[Arduino Compile/build-2 ] | Tool Manager: Installing platformio/framework-arduinoststm32 @ ~4.21001.0 +[Arduino Compile/build-5 ] | Requirement already satisfied: anyio<5,>=3.6.2 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from starlette<0.47,>=0.19->platformio) (4.9.0) +[Arduino Compile/build-5 ] | Requirement already satisfied: sniffio>=1.1 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from anyio<5,>=3.6.2->starlette<0.47,>=0.19->platformio) (1.3.1) +[Arduino Compile/build-5 ] | Requirement already satisfied: h11>=0.8 in /opt/hostedtoolcache/Python/3.13.5/x64/lib/python3.13/site-packages (from uvicorn<0.35,>=0.16->platformio) (0.16.0) +[Arduino Compile/build-5 ] | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +[Arduino Compile/build-5 ] βœ… Success - Main Install dependencies +[Arduino Compile/build-5 ] ⭐ Run Main Install platformIO libraries +[Arduino Compile/build-5 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir= +[Arduino Compile/build-5 ] | ******************************************************************************** +[Arduino Compile/build-5 ] | If you like PlatformIO, please: +[Arduino Compile/build-5 ] | - star it on GitHub > https://github.com/platformio/platformio-core +[Arduino Compile/build-5 ] | - follow us on LinkedIn to stay up-to-date on the latest project news > https://www.linkedin.com/company/platformio/ +[Arduino Compile/build-5 ] | - try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide +[Arduino Compile/build-5 ] | ******************************************************************************** +[Arduino Compile/build-5 ] | +[Arduino Compile/build-5 ] | Resolving program_via_AVRISP_mkII dependencies... +[Arduino Compile/build-5 ] | Platform Manager: Installing atmelavr +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% 30% +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Library Manager: DHTNEW@0.4.21 has been installed! +[Arduino Compile/build-4 ] | Library Manager: Installing adafruit/Adafruit SleepyDog Library @ ^1.6.5 +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% 30% 40% 50% 60% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Platform Manager: atmelavr@5.1.0 has been installed! +[Arduino Compile/build-5 ] | Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.70300.0 +[Arduino Compile/build-4 ] | Downloading 0% 10% 20% +[Arduino Compile/build-4 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Library Manager: Adafruit SleepyDog Library@1.6.5 has been installed! +[Arduino Compile/build-4 ] βœ… Success - Main Install platformIO libraries +[Arduino Compile/build-4 ] ⭐ Run Main Run PlatformIO +[Arduino Compile/build-4 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir= +[Arduino Compile/build-2 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Processing adafruit_itsybitsy_m4 (platform: atmelsam; board: adafruit_itsybitsy_m4; framework: arduino) +[Arduino Compile/build-4 ] | -------------------------------------------------------------------------------- +[Arduino Compile/build-4 ] | Verbose mode can be enabled via `-v, --verbose` option +[Arduino Compile/build-4 ] | CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_itsybitsy_m4.html +[Arduino Compile/build-4 ] | PLATFORM: Atmel SAM (8.3.0) > Adafruit ItsyBitsy M4 +[Arduino Compile/build-4 ] | HARDWARE: SAMD51G19A 120MHz, 192KB RAM, 512KB Flash +[Arduino Compile/build-4 ] | DEBUG: Current (atmel-ice) External (atmel-ice, jlink) +[Arduino Compile/build-4 ] | PACKAGES: +[Arduino Compile/build-4 ] | - framework-arduino-samd-adafruit @ 1.10716.0 (1.7.16) +[Arduino Compile/build-4 ] | - framework-cmsis @ 2.50400.181126 (5.4.0) +[Arduino Compile/build-4 ] | - framework-cmsis-atmel @ 1.2.2 +[Arduino Compile/build-4 ] | - toolchain-gccarmnoneeabi @ 1.90301.200702 (9.3.1) +[Arduino Compile/build-4 ] | LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf +[Arduino Compile/build-4 ] | LDF Modes: Finder ~ chain, Compatibility ~ soft +[Arduino Compile/build-4 ] | Found 16 compatible libraries +[Arduino Compile/build-4 ] | Scanning dependencies... +[Arduino Compile/build-4 ] | Dependency Graph +[Arduino Compile/build-4 ] | |-- NewPing @ 1.9.7 +[Arduino Compile/build-4 ] | |-- Stepper @ 1.1.3 +[Arduino Compile/build-4 ] | |-- DHTNEW @ 0.4.21 +[Arduino Compile/build-4 ] | |-- Adafruit SleepyDog Library @ 1.6.5 +[Arduino Compile/build-4 ] | |-- Wire @ 1.0 +[Arduino Compile/build-4 ] | |-- OpticalEncoder +[Arduino Compile/build-4 ] | |-- Servo @ 1.1.4 +[Arduino Compile/build-4 ] | Building in release mode +[Arduino Compile/build-4 ] | Compiling .pio/build/adafruit_itsybitsy_m4/src/i2c.cpp.o +[Arduino Compile/build-4 ] | Compiling .pio/build/adafruit_itsybitsy_m4/src/main.cpp.o +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-4 ] | Compiling .pio/build/adafruit_itsybitsy_m4/lib13f/NewPing/NewPing.cpp.o +[Arduino Compile/build-4 ] | Compiling .pio/build/adafruit_itsybitsy_m4/lib924/Stepper/Stepper.cpp.o +[Arduino Compile/build-4 ] | src/main.cpp: In function 'void modify_reporting()': +[Arduino Compile/build-4 ] | src/main.cpp:414:23: warning: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Wsign-compare] +[Arduino Compile/build-4 ] | 414 | for (int i = 0; i < MAX_DIGITAL_PINS_SUPPORTED; i++) { +[Arduino Compile/build-4 ] | | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +[Arduino Compile/build-4 ] | src/main.cpp: In function 'void scan_digital_inputs()': +[Arduino Compile/build-4 ] | src/main.cpp:679:21: warning: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Wsign-compare] +[Arduino Compile/build-4 ] | 679 | for (int i = 0; i < MAX_DIGITAL_PINS_SUPPORTED; i++) { +[Arduino Compile/build-4 ] | | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +[Arduino Compile/build-4 ] | src/main.cpp: In function 'void setup()': +[Arduino Compile/build-4 ] | src/main.cpp:937:19: error: call of overloaded 'write(int)' is ambiguous +[Arduino Compile/build-4 ] | 937 | Serial.write(0); +[Arduino Compile/build-4 ] | | ^ +[Arduino Compile/build-4 ] | In file included from /root/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Arduino.h:158, +[Arduino Compile/build-4 ] | from include/Telemetrix4Arduino.h:2, +[Arduino Compile/build-4 ] | from src/main.cpp:3: +[Arduino Compile/build-4 ] | /root/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/USB/USBAPI.h:136:17: note: candidate: 'virtual size_t Serial_::write(uint8_t)' +[Arduino Compile/build-4 ] | 136 | virtual size_t write(uint8_t); +[Arduino Compile/build-4 ] | | ^~~~~ +[Arduino Compile/build-4 ] | In file included from /root/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Stream.h:26, +[Arduino Compile/build-4 ] | from /root/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/HardwareSerial.h:24, +[Arduino Compile/build-4 ] | from /root/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Arduino.h:77, +[Arduino Compile/build-4 ] | from include/Telemetrix4Arduino.h:2, +[Arduino Compile/build-4 ] | from src/main.cpp:3: +[Arduino Compile/build-4 ] | /root/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Print.h:51:12: note: candidate: 'size_t Print::write(const char*)' +[Arduino Compile/build-4 ] | 51 | size_t write(const char *str) { +[Arduino Compile/build-4 ] | | ^~~~~ +[Arduino Compile/build-4 ] | Compiling .pio/build/adafruit_itsybitsy_m4/lib6d7/DHTNEW/dhtnew.cpp.o +[Arduino Compile/build-4 ] | *** [.pio/build/adafruit_itsybitsy_m4/src/main.cpp.o] Error 1 +[Arduino Compile/build-4 ] | ========================== [FAILED] Took 2.47 seconds ========================== +[Arduino Compile/build-4 ] | +[Arduino Compile/build-4 ] | Environment Status Duration +[Arduino Compile/build-4 ] | --------------------- -------- ------------ +[Arduino Compile/build-4 ] | adafruit_itsybitsy_m4 FAILED 00:00:02.473 +[Arduino Compile/build-4 ] | ==================== 1 failed, 0 succeeded in 00:00:02.473 ==================== +[Arduino Compile/build-4 ] ❌ Failure - Main Run PlatformIO +[Arduino Compile/build-4 ] exitcode '1': failure +[Arduino Compile/build-4 ] ⭐ Run Complete job +[Arduino Compile/build-4 ] βœ… Success - Complete job +[Arduino Compile/build-4 ] 🏁 Job failed +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Tool Manager: toolchain-atmelavr@1.70300.191015 has been installed! +[Arduino Compile/build-5 ] | Tool Manager: Installing platformio/framework-arduino-avr @ ~5.2.0 +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Tool Manager: framework-arduino-avr@5.2.0 has been installed! +[Arduino Compile/build-5 ] | Tool Manager: Installing platformio/tool-scons @ ~4.40801.0 +[Arduino Compile/build-2 ] | Tool Manager: framework-arduinoststm32@4.21001.250617 has been installed! +[Arduino Compile/build-2 ] | Tool Manager: Installing platformio/tool-scons @ ~4.40801.0 +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Tool Manager: tool-scons@4.40801.0 has been installed! +[Arduino Compile/build-5 ] | Library Manager: Installing teckel12/NewPing @ ^1.9.7 +[Arduino Compile/build-2 ] | Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-2 ] | Tool Manager: tool-scons@4.40801.0 has been installed! +[Arduino Compile/build-2 ] | Library Manager: Installing teckel12/NewPing @ ^1.9.7 +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Library Manager: NewPing@1.9.7 has been installed! +[Arduino Compile/build-5 ] | Library Manager: Installing arduino-libraries/Stepper @ ^1.1.3 +[Arduino Compile/build-2 ] | Downloading 0% 10% 20% +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-2 ] | Library Manager: NewPing@1.9.7 has been installed! +[Arduino Compile/build-2 ] | Library Manager: Installing arduino-libraries/Stepper @ ^1.1.3 +[Arduino Compile/build-5 ] | Downloading 0% 10% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% +[Arduino Compile/build-5 ] | Library Manager: Stepper@1.1.3 has been installed! +[Arduino Compile/build-5 ] | Library Manager: Installing arduino-libraries/Servo @ ^1.2.0 +[Arduino Compile/build-2 ] | Downloading 0% 10% +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% +[Arduino Compile/build-2 ] | Library Manager: Stepper@1.1.3 has been installed! +[Arduino Compile/build-2 ] | Library Manager: Installing robtillaart/DHTNEW @ ^0.4.18 +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% 30% 40% 50% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Library Manager: Servo@1.2.2 has been installed! +[Arduino Compile/build-5 ] | Library Manager: Installing robtillaart/DHTNEW @ ^0.4.18 +[Arduino Compile/build-2 ] | Downloading 0% 10% 20% 30% +[Arduino Compile/build-2 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-2 ] | Library Manager: DHTNEW@0.4.21 has been installed! +[Arduino Compile/build-2 ] βœ… Success - Main Install platformIO libraries +[Arduino Compile/build-2 ] ⭐ Run Main Run PlatformIO +[Arduino Compile/build-2 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir= +[Arduino Compile/build-2 ] | Processing robotdyn_blackpill_f303cc (platform: ststm32; board: robotdyn_blackpill_f303cc; framework: arduino) +[Arduino Compile/build-2 ] | -------------------------------------------------------------------------------- +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% 30% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-5 ] | Library Manager: DHTNEW@0.4.21 has been installed! +[Arduino Compile/build-5 ] | Library Manager: Installing adafruit/Adafruit SleepyDog Library @ ^1.6.5 +[Arduino Compile/build-2 ] | Verbose mode can be enabled via `-v, --verbose` option +[Arduino Compile/build-2 ] | CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/robotdyn_blackpill_f303cc.html +[Arduino Compile/build-2 ] | PLATFORM: ST STM32 (19.2.0) > BlackPill F303CC +[Arduino Compile/build-2 ] | HARDWARE: STM32F303CCT6 72MHz, 40KB RAM, 256KB Flash +[Arduino Compile/build-2 ] | DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink) +[Arduino Compile/build-2 ] | PACKAGES: +[Arduino Compile/build-2 ] | - framework-arduinoststm32 @ 4.21001.250617 (2.10.1) +[Arduino Compile/build-2 ] | - framework-cmsis @ 2.50900.0 (5.9.0) +[Arduino Compile/build-2 ] | - toolchain-gccarmnoneeabi @ 1.140201.0 (14.2.1) +[Arduino Compile/build-2 ] | LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf +[Arduino Compile/build-2 ] | LDF Modes: Finder ~ chain, Compatibility ~ soft +[Arduino Compile/build-2 ] | Found 18 compatible libraries +[Arduino Compile/build-2 ] | Scanning dependencies... +[Arduino Compile/build-2 ] | Dependency Graph +[Arduino Compile/build-2 ] | |-- NewPing @ 1.9.7 +[Arduino Compile/build-2 ] | |-- Stepper @ 1.1.3 +[Arduino Compile/build-2 ] | |-- DHTNEW @ 0.4.21 +[Arduino Compile/build-2 ] | |-- Wire @ 1.0.0 +[Arduino Compile/build-2 ] | |-- OpticalEncoder +[Arduino Compile/build-2 ] | |-- Servo @ 1.1.2 +[Arduino Compile/build-2 ] | Building in release mode +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduinoVariant/PeripheralPins.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduinoVariant/PeripheralPins_SPARKY_F303CC.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduinoVariant/generic_clock.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduinoVariant/variant_BLACKPILL_F303CC.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduinoVariant/variant_SPARKY_F303CC.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduinoVariant/variant_generic.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_adc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_adc_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_can.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_ccb.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_cec.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_comp.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_comp_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_cordic.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_cortex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_crc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_crc_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_cryp.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_cryp_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dac.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dac_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dcache.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dcmi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dcmi_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dfsdm.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dfsdm_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dma.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dma2d.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dma_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dsi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_dts.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_eth.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_eth_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_exti.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_fdcan.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_firewall.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_flash.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_flash_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_flash_ramfunc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_fmac.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_fmpi2c.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_fmpi2c_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_fmpsmbus.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_fmpsmbus_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_gfxmmu.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_gfxtim.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_gpio.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_gpio_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_gpu2d.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_gtzc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_hash.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_hash_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_hcd.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_hrtim.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_hsem.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_i2c.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_i2c_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_i2s.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_i2s_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_i3c.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_icache.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_ipcc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_irda.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_iwdg.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_jpeg.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_lcd.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_lptim.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_ltdc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_ltdc_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_mdf.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_mdios.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_mdma.c.o +[Arduino Compile/build-5 ] | Downloading 0% 10% 20% +[Arduino Compile/build-5 ] | Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_mmc.c.o +[Arduino Compile/build-5 ] | Library Manager: Adafruit SleepyDog Library@1.6.5 has been installed! +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_mmc_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_nand.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_nor.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_opamp.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_opamp_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_ospi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_otfdec.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_pccard.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_pcd.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_pcd_ex.c.o +[Arduino Compile/build-5 ] βœ… Success - Main Install platformIO libraries +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_pka.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_pssi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_pwr.c.o +[Arduino Compile/build-5 ] ⭐ Run Main Run PlatformIO +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_pwr_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_qspi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_ramcfg.c.o +[Arduino Compile/build-5 ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir= +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_ramecc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_rcc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_rcc_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_rng.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_rng_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_rtc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_rtc_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sai.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sai_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sd.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sd_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sdadc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sdio.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sdram.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_smartcard.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_smartcard_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_smbus.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_smbus_ex.c.o +[Arduino Compile/build-5 ] | Processing program_via_AVRISP_mkII (platform: atmelavr; board: nanoatmega328new; framework: arduino) +[Arduino Compile/build-5 ] | -------------------------------------------------------------------------------- +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_spdifrx.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_spi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_spi_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_sram.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_subghz.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_swpmi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_tim.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_tim_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_tsc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_uart.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_uart_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_usart.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_usart_ex.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_wwdg.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HAL/stm32yyxx_hal_xspi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/HardwareTimer.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_adc.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_bdma.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_comp.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_cordic.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_crc.c.o +[Arduino Compile/build-5 ] | Verbose mode can be enabled via `-v, --verbose` option +[Arduino Compile/build-5 ] | CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328new.html +[Arduino Compile/build-5 ] | PLATFORM: Atmel AVR (5.1.0) > Arduino Nano ATmega328 (New Bootloader) +[Arduino Compile/build-5 ] | HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash +[Arduino Compile/build-5 ] | DEBUG: Current (avr-stub) External (avr-stub, simavr) +[Arduino Compile/build-5 ] | PACKAGES: +[Arduino Compile/build-5 ] | - framework-arduino-avr @ 5.2.0 +[Arduino Compile/build-5 ] | - toolchain-atmelavr @ 1.70300.191015 (7.3.0) +[Arduino Compile/build-5 ] | LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf +[Arduino Compile/build-5 ] | LDF Modes: Finder ~ chain, Compatibility ~ soft +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_crs.c.o +[Arduino Compile/build-5 ] | Found 11 compatible libraries +[Arduino Compile/build-5 ] | Scanning dependencies... +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_dac.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_delayblock.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_dlyb.c.o +[Arduino Compile/build-5 ] | Dependency Graph +[Arduino Compile/build-5 ] | |-- NewPing @ 1.9.7 +[Arduino Compile/build-5 ] | |-- Stepper @ 1.1.3 +[Arduino Compile/build-5 ] | |-- Servo @ 1.2.2 +[Arduino Compile/build-5 ] | |-- DHTNEW @ 0.4.21 +[Arduino Compile/build-5 ] | |-- Adafruit SleepyDog Library @ 1.6.5 +[Arduino Compile/build-5 ] | |-- Wire @ 1.0 +[Arduino Compile/build-5 ] | |-- OpticalEncoder +[Arduino Compile/build-5 ] | Building in release mode +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_dma.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_dma2d.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_exti.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/src/i2c.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_fmac.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/src/main.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_fmc.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libf60/NewPing/NewPing.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_fmpi2c.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libb59/Stepper/Stepper.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/avr/Servo.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/mbed/Servo.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_fsmc.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/megaavr/Servo.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/nrf52/Servo.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/renesas/Servo.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_gpio.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/sam/Servo.cpp.o +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/libf60/libNewPing.a +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/libb59/libStepper.a +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/samd/Servo.cpp.o +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/libf60/libNewPing.a +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/libb59/libStepper.a +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/stm32f4/Servo.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_hrtim.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/libe88/Servo/xmc/Servo.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_i2c.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib356/DHTNEW/dhtnew.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/Adafruit_SleepyDog.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_i3c.c.o +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/libe88/libServo.a +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogAVR.cpp.o +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/libe88/libServo.a +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogESP32.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogESP8266.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogKinetisK.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogKinetisL.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_icache.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogNRF.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogRP2040.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib654/Adafruit SleepyDog Library/utility/WatchdogSAMD.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_lpgpio.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib143/Wire/Wire.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_lptim.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/lib143/Wire/utility/twi.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_lpuart.c.o +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/libFrameworkArduinoVariant.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_mdma.c.o +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/libFrameworkArduinoVariant.a +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/CDC.cpp.o +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/lib356/libDHTNEW.a +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/lib654/libAdafruit SleepyDog Library.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_opamp.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_pka.c.o +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/lib654/libAdafruit SleepyDog Library.a +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/lib356/libDHTNEW.a +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/HardwareSerial.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_pwr.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/HardwareSerial0.cpp.o +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/lib143/libWire.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_rcc.c.o +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/lib143/libWire.a +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/HardwareSerial1.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/HardwareSerial2.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_rng.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/HardwareSerial3.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_rtc.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/IPAddress.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_sdmmc.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/PluggableUSB.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/Print.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/Stream.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_spi.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/Tone.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/USBCore.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_swpmi.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/WInterrupts.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_tim.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/WMath.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/WString.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_ucpd.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/abi.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/hooks.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_usart.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/main.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/new.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/wiring.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_usb.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/LL/stm32yyxx_ll_utils.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/wiring_analog.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/new.cpp.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/wiring_digital.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/wiring_pulse.S.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/wiring_pulse.c.o +[Arduino Compile/build-5 ] | Compiling .pio/build/program_via_AVRISP_mkII/FrameworkArduino/wiring_shift.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/PortNames.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/analog.cpp.o +[Arduino Compile/build-5 ] | Archiving .pio/build/program_via_AVRISP_mkII/libFrameworkArduino.a +[Arduino Compile/build-5 ] | Indexing .pio/build/program_via_AVRISP_mkII/libFrameworkArduino.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/bootloader.c.o +[Arduino Compile/build-5 ] | Linking .pio/build/program_via_AVRISP_mkII/firmware.elf +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/clock.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/core_callback.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/dwt.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/hw_config.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/interrupt.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/otp.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/pinmap.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/stm32_def.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/system_stm32yyxx.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/timer.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/stm32/uart.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/SrcWrapper/src/syscalls.c.o +[Arduino Compile/build-5 ] | Checking size .pio/build/program_via_AVRISP_mkII/firmware.elf +[Arduino Compile/build-5 ] | Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" +[Arduino Compile/build-5 ] | RAM: [==== ] 40.9% (used 838 bytes from 2048 bytes) +[Arduino Compile/build-5 ] | Flash: [==== ] 40.9% (used 12560 bytes from 30720 bytes) +[Arduino Compile/build-5 ] | Building .pio/build/program_via_AVRISP_mkII/firmware.hex +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/src/i2c.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/src/main.cpp.o +[Arduino Compile/build-5 ] | ========================= [SUCCESS] Took 4.06 seconds ========================= +[Arduino Compile/build-5 ] | +[Arduino Compile/build-5 ] | Environment Status Duration +[Arduino Compile/build-5 ] | ----------------------- -------- ------------ +[Arduino Compile/build-5 ] | program_via_AVRISP_mkII SUCCESS 00:00:04.060 +[Arduino Compile/build-5 ] | ========================= 1 succeeded in 00:00:04.060 ========================= +[Arduino Compile/build-5 ] βœ… Success - Main Run PlatformIO +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/libd2e/NewPing/NewPing.cpp.o +[Arduino Compile/build-5 ] ⭐ Run Post Set up Python +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/lib77c/Stepper/Stepper.cpp.o +[Arduino Compile/build-5 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/cache-save/index.js] user= workdir= +[Arduino Compile/build-2 ] | src/main.cpp:1032:2: warning: #warning "Watchdog not enabled, please enable it in the code" [-Wcpp] +[Arduino Compile/build-2 ] | 1032 | #warning "Watchdog not enabled, please enable it in the code" +[Arduino Compile/build-2 ] | | ^~~~~~~ +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/libcc9/DHTNEW/dhtnew.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/libfde/Wire/Wire.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/libfde/Wire/utility/twi.c.o +[Arduino Compile/build-5 ] βœ… Success - Post Set up Python +[Arduino Compile/build-5 ] ⭐ Run Complete job +[Arduino Compile/build-5 ] Cleaning up container for job build +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/libc95/Servo/stm32/Servo.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/HardwareSerial.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/IPAddress.cpp.o +[Arduino Compile/build-2 ] | In file included from src/main.cpp:8: +[Arduino Compile/build-2 ] | .pio/libdeps/robotdyn_blackpill_f303cc/NewPing/src/NewPing.h:253:46: warning: 'boolean' is deprecated [-Wdeprecated-declarations] +[Arduino Compile/build-2 ] | 253 | boolean ping_trigger(); +[Arduino Compile/build-2 ] | | ^ +[Arduino Compile/build-2 ] | In file included from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:34, +[Arduino Compile/build-2 ] | from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36, +[Arduino Compile/build-2 ] | from include/Telemetrix4Arduino.h:2, +[Arduino Compile/build-2 ] | from src/main.cpp:3: +[Arduino Compile/build-2 ] | /root/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_constants.h:110:14: note: declared here +[Arduino Compile/build-2 ] | 110 | typedef bool boolean __attribute__((deprecated)); +[Arduino Compile/build-2 ] | | ^~~~~~~ +[Arduino Compile/build-5 ] βœ… Success - Complete job +[Arduino Compile/build-5 ] 🏁 Job failed +[Arduino Compile/build-2 ] | In file included from .pio/libdeps/robotdyn_blackpill_f303cc/NewPing/src/NewPing.cpp:7: +[Arduino Compile/build-2 ] | .pio/libdeps/robotdyn_blackpill_f303cc/NewPing/src/NewPing.h:253:46: warning: 'boolean' is deprecated [-Wdeprecated-declarations] +[Arduino Compile/build-2 ] | 253 | boolean ping_trigger(); +[Arduino Compile/build-2 ] | | ^ +[Arduino Compile/build-2 ] | In file included from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:34, +[Arduino Compile/build-2 ] | from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36, +[Arduino Compile/build-2 ] | from .pio/libdeps/robotdyn_blackpill_f303cc/NewPing/src/NewPing.h:166: +[Arduino Compile/build-2 ] | /root/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_constants.h:110:14: note: declared here +[Arduino Compile/build-2 ] | 110 | typedef bool boolean __attribute__((deprecated)); +[Arduino Compile/build-2 ] | | ^~~~~~~ +[Arduino Compile/build-2 ] | .pio/libdeps/robotdyn_blackpill_f303cc/NewPing/src/NewPing.cpp:127:31: warning: 'boolean' is deprecated [-Wdeprecated-declarations] +[Arduino Compile/build-2 ] | 127 | boolean NewPing::ping_trigger() { +[Arduino Compile/build-2 ] | | ^ +[Arduino Compile/build-2 ] | /root/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_constants.h:110:14: note: declared here +[Arduino Compile/build-2 ] | 110 | typedef bool boolean __attribute__((deprecated)); +[Arduino Compile/build-2 ] | | ^~~~~~~ +[Arduino Compile/build-2 ] | Archiving .pio/build/robotdyn_blackpill_f303cc/libd2e/libNewPing.a +[Arduino Compile/build-2 ] | Archiving .pio/build/robotdyn_blackpill_f303cc/lib77c/libStepper.a +[Arduino Compile/build-2 ] | Indexing .pio/build/robotdyn_blackpill_f303cc/libd2e/libNewPing.a +[Arduino Compile/build-2 ] | Indexing .pio/build/robotdyn_blackpill_f303cc/lib77c/libStepper.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/Print.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/RingBuffer.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/Stream.cpp.o +[Arduino Compile/build-2 ] | Archiving .pio/build/robotdyn_blackpill_f303cc/libcc9/libDHTNEW.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/Tone.cpp.o +[Arduino Compile/build-2 ] | Indexing .pio/build/robotdyn_blackpill_f303cc/libcc9/libDHTNEW.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/WInterrupts.cpp.o +[Arduino Compile/build-2 ] | Archiving .pio/build/robotdyn_blackpill_f303cc/libfde/libWire.a +[Arduino Compile/build-2 ] | Indexing .pio/build/robotdyn_blackpill_f303cc/libfde/libWire.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/WMath.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/WSerial.cpp.o +[Arduino Compile/build-2 ] | Archiving .pio/build/robotdyn_blackpill_f303cc/libc95/libServo.a +[Arduino Compile/build-2 ] | Indexing .pio/build/robotdyn_blackpill_f303cc/libc95/libServo.a +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/WString.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/abi.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/avr/dtostrf.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/board.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/core_debug.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/hooks.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/itoa.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/main.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/pins_arduino.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/stm32/startup_stm32yyxx.S.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/wiring_analog.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/wiring_digital.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/wiring_pulse.cpp.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/wiring_shift.c.o +[Arduino Compile/build-2 ] | Compiling .pio/build/robotdyn_blackpill_f303cc/FrameworkArduino/wiring_time.c.o +[Arduino Compile/build-2 ] | Archiving .pio/build/robotdyn_blackpill_f303cc/libFrameworkArduino.a +[Arduino Compile/build-2 ] | Indexing .pio/build/robotdyn_blackpill_f303cc/libFrameworkArduino.a +[Arduino Compile/build-2 ] | Linking .pio/build/robotdyn_blackpill_f303cc/firmware.elf +[Arduino Compile/build-2 ] | Checking size .pio/build/robotdyn_blackpill_f303cc/firmware.elf +[Arduino Compile/build-2 ] | Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" +[Arduino Compile/build-2 ] | RAM: [= ] 6.1% (used 2512 bytes from 40960 bytes) +[Arduino Compile/build-2 ] | Flash: [== ] 17.4% (used 45732 bytes from 262144 bytes) +[Arduino Compile/build-2 ] | Building .pio/build/robotdyn_blackpill_f303cc/firmware.bin +[Arduino Compile/build-2 ] | ========================= [SUCCESS] Took 12.38 seconds ========================= +[Arduino Compile/build-2 ] | +[Arduino Compile/build-2 ] | Environment Status Duration +[Arduino Compile/build-2 ] | ------------------------- -------- ------------ +[Arduino Compile/build-2 ] | robotdyn_blackpill_f303cc SUCCESS 00:00:12.381 +[Arduino Compile/build-2 ] | ========================= 1 succeeded in 00:00:12.381 ========================= +[Arduino Compile/build-2 ] βœ… Success - Main Run PlatformIO +[Arduino Compile/build-2 ] ⭐ Run Post Set up Python +[Arduino Compile/build-2 ] 🐳 docker exec cmd=[/opt/acttoolcache/node/18.20.8/x64/bin/node /var/run/act/actions/actions-setup-python@v5/dist/cache-save/index.js] user= workdir= +[Arduino Compile/build-2 ] βœ… Success - Post Set up Python +[Arduino Compile/build-2 ] ⭐ Run Complete job +[Arduino Compile/build-2 ] Cleaning up container for job build +[Arduino Compile/build-2 ] βœ… Success - Complete job +[Arduino Compile/build-2 ] 🏁 Job failed diff --git a/platformio.ini b/platformio.ini index 4b0f15d..3915cac 100644 --- a/platformio.ini +++ b/platformio.ini @@ -95,4 +95,16 @@ lib_deps = ; arduino-libraries/Servo@^1.2.0 robtillaart/DHTNEW@^0.4.18 adafruit/Adafruit SleepyDog Library@^1.6.5 -build_flags = -std=c++2a -DMAX_SERVOS=0 -DENABLE_ADAFRUIT_WATCHDOG=1 \ No newline at end of file +build_flags = -std=c++2a -DMAX_SERVOS=0 -DENABLE_ADAFRUIT_WATCHDOG=1 + +[env:pico] +platform = raspberrypi +board = pico +framework = arduino +lib_deps = + teckel12/NewPing@^1.9.7 + arduino-libraries/Stepper@^1.1.3 + arduino-libraries/Servo@^1.2.0 ; No support yet for the Pico + robtillaart/DHTNEW@^0.4.18 + adafruit/Adafruit SleepyDog Library@^1.6.5 +build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=0 -DMAX_SERVOS=6 \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 4776ea4..817321d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -238,7 +238,7 @@ uint8_t analog_sampling_interval = 19; Servo servos[MAX_SERVOS]; // max set by servo library // this array allows us to retrieve the servo object // associated with a specific pin number -byte pin_to_servo_index_map[MAX_SERVOS]; +byte servo_index_to_pin_map[MAX_SERVOS]; #endif // HC-SR04 Sonar Management @@ -335,8 +335,8 @@ void set_pin_mode() { PIN_MODES mode; pin = command_buffer[0]; mode = (PIN_MODES)command_buffer[1]; - Serial2.println("Setting pin mode: " + String(pin) + " to " + - String(mode)); + // Serial2.println("Setting pin mode: " + String(pin) + " to " + + // String(mode)); switch (mode) { case INPUT_PULL_DOWN: the_digital_pins[pin].pin_mode = mode; @@ -401,10 +401,12 @@ void pwm_write() { // command_buffer[2] = value_lsb byte pin; // command_buffer[0] unsigned int value; - pin = command_buffer[0]; value = (command_buffer[1] << 8) + command_buffer[2]; + + send_debug_info(3, pin); + send_debug_info(4, value); analogWrite(pin, value); } @@ -415,7 +417,7 @@ void modify_reporting() { switch (command_buffer[0]) { case REPORTING_DISABLE_ALL: - for (int i = 0; i < MAX_PINS_SUPPORTED; i++) { + for (uint8_t i = 0; i < MAX_PINS_SUPPORTED; i++) { the_digital_pins[i].digital_reporting_enabled = false; the_digital_pins[i].analog_reporting_enabled = false; } @@ -490,7 +492,7 @@ void servo_attach() { // find the first available open servo servo_found = find_servo(); if (servo_found != -1) { - pin_to_servo_index_map[servo_found] = pin; + servo_index_to_pin_map[servo_found] = pin; servos[servo_found].attach(pin, minpulse, maxpulse); } else { // no open servos available, send a report back to client @@ -505,11 +507,10 @@ void servo_attach() { void servo_write() { #if MAX_SERVOS > 0 byte pin = command_buffer[0]; - int angle = command_buffer[1]; + int angle = command_buffer[1] << 8 | command_buffer[2]; // find the servo object for the pin for (int i = 0; i < MAX_SERVOS; i++) { - if (pin_to_servo_index_map[i] == pin) { - + if (servo_index_to_pin_map[i] == pin) { servos[i].write(angle); return; } @@ -524,12 +525,14 @@ void servo_detach() { // find the servo object for the pin for (int i = 0; i < MAX_SERVOS; i++) { - if (pin_to_servo_index_map[i] == pin) { + if (servo_index_to_pin_map[i] == pin) { - pin_to_servo_index_map[i] = -1; + servo_index_to_pin_map[i] = -1; servos[i].detach(); } } +#else +#warning "No servos supported, servos will not do anything" #endif } @@ -656,8 +659,8 @@ void get_next_command() { return; } command_entry = command_table[command]; - Serial2.print("Command: "); - Serial2.println(command); + // Serial2.print("Command: "); + // Serial2.println(command); if (packet_length > 1) { // get the data for that command for (int i = 0; i < packet_length - 1; i++) { @@ -683,7 +686,7 @@ void scan_digital_inputs() { byte report_message[4] = {DIGITAL_REPORT, 0, 0}; - for (int i = 0; i < MAX_PINS_SUPPORTED; i++) { + for (uint8_t i = 0; i < MAX_PINS_SUPPORTED; i++) { if (the_digital_pins[i].pin_mode == INPUT_MODE || the_digital_pins[i].pin_mode == INPUT_PULL_UP || the_digital_pins[i].pin_mode == INPUT_PULL_DOWN) { @@ -721,7 +724,7 @@ void scan_analog_inputs() { current_millis = millis(); if (current_millis - previous_millis > analog_sampling_interval) { previous_millis += analog_sampling_interval; - for (int i = 0; i < MAX_PINS_SUPPORTED; i++) { + for (uint8_t i = 0; i < MAX_PINS_SUPPORTED; i++) { if (the_digital_pins[i].pin_mode == ANALOG_INPUT) { if (the_digital_pins[i].analog_reporting_enabled) { // if the value changed since last read @@ -739,10 +742,10 @@ void scan_analog_inputs() { report_message[3] = lowByte(value); // Serial.write(report_message, 5); send_message(report_message); - Serial2.print("Analog pin: "); - Serial2.print(adjusted_pin_number); - Serial2.print(" value: "); - Serial2.println(value); + // Serial2.print("Analog pin: "); + // Serial2.print(adjusted_pin_number); + // Serial2.print(" value: "); + // Serial2.println(value); // delay(1); } } @@ -935,8 +938,8 @@ void init_pin_structures() { void setup() { Serial.begin(115200); - Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2); -Serial2.println("Starting up..."); + // Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2); +// Serial2.println("Starting up..."); // initialize the servo allocation map table init_pin_structures(); // for (int i = 0; i < 5; i++) { @@ -1027,7 +1030,7 @@ template void send_message(const uint8_t (&message)[N]) { // delayMicroseconds(10); // } Serial.write((uint8_t)N); // send msg len - for(auto i = 0; i < N; i++) { + for(size_t i = 0; i < N; i++) { Serial.write((uint8_t)message[i]); // send msg len } @@ -1075,7 +1078,7 @@ void ping() { // out[0] = out.size() - 1; // dont count the packet length // send_debug_info(1, special_num); // send_debug_info(2, random); - // Serial2.println("Pinging..."); + // // Serial2.println("Pinging..."); send_message(out); if (true) { From 89fc15906173c415e8eae80c7de970bac5ac20eb Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Tue, 1 Jul 2025 10:40:32 +0200 Subject: [PATCH 3/9] cleanups + stylechecks --- .github/workflows/build.yaml | 5 +++- README.md | 12 ++++---- include/boards/esp32devkit.hpp | 6 ++-- include/boards/itsybitsy_m4.hpp | 4 +++ include/boards/nanoatmega.hpp | 1 + include/boards/pico.hpp | 6 +++- include/boards/stm32blackpill.hpp | 12 ++++++-- include/main.hpp | 2 +- lib/OpticalEncoder/OpticalEncoder.h | 2 +- platformio.ini | 2 +- src/main.cpp | 45 +++++++++++------------------ 11 files changed, 54 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1f6f223..e5b951c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,10 @@ jobs: "robotdyn_blackpill_f303cc", "nanoatmega328", "adafruit_itsybitsy_m4", - "program_via_AVRISP_mkII" + "program_via_AVRISP_mkII", + "robotdyn_blackpill_f103", + "pico", + "esp32doit-devkit-v1", ] fail-fast: false diff --git a/README.md b/README.md index f199459..15b4e6f 100644 --- a/README.md +++ b/README.md @@ -279,13 +279,13 @@ Check (done with pico arduino): - sonar βœ…, TODO: no value - servoβœ… - motor driver -- analog in -- analog out -- intensity sens -- keypad -- encoders +- analog inβœ… +- analog out TODO: geen pins lijst ofzo, gewoon alles ok doenβœ… +- intensity sensβœ… +- keypadβœ… +- encoders, single - (modules?) - +- i2c todo! # TODO: diff --git a/include/boards/esp32devkit.hpp b/include/boards/esp32devkit.hpp index b89f175..12238e4 100644 --- a/include/boards/esp32devkit.hpp +++ b/include/boards/esp32devkit.hpp @@ -4,10 +4,12 @@ #include // This board does not have a normal list of analog pins -// this shifts the analog pins #define A1 2047 #define A2 2047 #define A8 2047 #define A9 2047 - +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} #endif \ No newline at end of file diff --git a/include/boards/itsybitsy_m4.hpp b/include/boards/itsybitsy_m4.hpp index 0b497fe..cef7fd6 100644 --- a/include/boards/itsybitsy_m4.hpp +++ b/include/boards/itsybitsy_m4.hpp @@ -18,4 +18,8 @@ const auto A18 = 2047; const auto A19 = 2047; const auto MAX_SERVOS = 0; +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} #endif \ No newline at end of file diff --git a/include/boards/nanoatmega.hpp b/include/boards/nanoatmega.hpp index c63c403..37d4701 100644 --- a/include/boards/nanoatmega.hpp +++ b/include/boards/nanoatmega.hpp @@ -16,4 +16,5 @@ const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; #define MAX_SERVOS 4 // PWM pins on Nano +void hw_init() {} #endif \ No newline at end of file diff --git a/include/boards/pico.hpp b/include/boards/pico.hpp index 65d1e40..efb2831 100644 --- a/include/boards/pico.hpp +++ b/include/boards/pico.hpp @@ -18,5 +18,9 @@ const auto A16 = 2047; const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; -#define MAX_SERVOS 4 // PWM pins on Nano +#define MAX_SERVOS 12 // according to the servo lib +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} #endif \ No newline at end of file diff --git a/include/boards/stm32blackpill.hpp b/include/boards/stm32blackpill.hpp index faec184..cd5a3c1 100644 --- a/include/boards/stm32blackpill.hpp +++ b/include/boards/stm32blackpill.hpp @@ -12,7 +12,11 @@ const auto A16 = 2047; const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; -const auto MAX_SERVOS = 8; // PWM pins on BlackPill +const auto MAX_SERVOS = 8; +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} #endif #if defined(ARDUINO_ARCH_STM32) && defined(ARDUINO_BLACKPILL_F303CC) @@ -21,5 +25,9 @@ const auto A16 = 2047; const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; -const auto MAX_SERVOS = 8; // PWM pins on BlackPill +const auto MAX_SERVOS = 8; +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} #endif diff --git a/include/main.hpp b/include/main.hpp index 8e8fa18..281f525 100644 --- a/include/main.hpp +++ b/include/main.hpp @@ -3,8 +3,8 @@ #include "boards/esp32devkit.hpp" #include "boards/itsybitsy_m4.hpp" #include "boards/nanoatmega.hpp" -#include "boards/stm32blackpill.hpp" #include "boards/pico.hpp" +#include "boards/stm32blackpill.hpp" #include void get_unique_id(); diff --git a/lib/OpticalEncoder/OpticalEncoder.h b/lib/OpticalEncoder/OpticalEncoder.h index 068392e..adf2eb4 100644 --- a/lib/OpticalEncoder/OpticalEncoder.h +++ b/lib/OpticalEncoder/OpticalEncoder.h @@ -44,7 +44,7 @@ void OpticalEncoder::setup(uint8_t pinNr, void (*ISR_callback)(void), int value, inline void OpticalEncoder::handleInterrupt(void) { unsigned long currmillis = millis(); - if (currmillis - prevmillis > 3) { + if (currmillis - prevmillis > 2) { if (_movingForward) { _encoder0Pos++; } else { diff --git a/platformio.ini b/platformio.ini index 3915cac..c49f13c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -107,4 +107,4 @@ lib_deps = arduino-libraries/Servo@^1.2.0 ; No support yet for the Pico robtillaart/DHTNEW@^0.4.18 adafruit/Adafruit SleepyDog Library@^1.6.5 -build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=0 -DMAX_SERVOS=6 \ No newline at end of file +build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=1 diff --git a/src/main.cpp b/src/main.cpp index 817321d..583792e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,6 @@ // #include "Telemetrix4Arduino.h" // #include +#include "main.hpp" #include "Telemetrix4Arduino.h" #include "commands.hpp" #include "config.hpp" @@ -7,6 +8,7 @@ #include #include #include + #if MAX_SERVOS > 0 #include #endif @@ -33,7 +35,6 @@ // We define these here to provide a forward reference. // If you add a new command, you must add the command handler // here as well. -#include "main.hpp" // #include template void send_message(const uint8_t (&message)[N]); @@ -201,18 +202,19 @@ constexpr auto MAX_ANALOG_PINS_SUPPORTED = get_total_pins_not(analog_read_pins, analog_read_pins_size, 2047); // maximum number of pins supported -constexpr auto MAX_PINS_SUPPORTED = NUM_DIGITAL_PINS + MAX_ANALOG_PINS_SUPPORTED; // probably too high but good enough +constexpr auto MAX_PINS_SUPPORTED = + NUM_DIGITAL_PINS + + MAX_ANALOG_PINS_SUPPORTED; // probably too high but good enough // #define // a descriptor for digital pins struct pin_descriptor { byte pin_number; PIN_MODES pin_mode; bool digital_reporting_enabled; // If true, then send reports if an input pin - bool analog_reporting_enabled; // If true, then send reports if an input pin - int last_value; // Last value read for input mode - int differential; // difference between current and last value needed + bool analog_reporting_enabled; // If true, then send reports if an input pin + int last_value; // Last value read for input mode + int differential; // difference between current and last value needed // to generate a report - }; // an array of digital_pin_descriptors @@ -336,7 +338,7 @@ void set_pin_mode() { pin = command_buffer[0]; mode = (PIN_MODES)command_buffer[1]; // Serial2.println("Setting pin mode: " + String(pin) + " to " + - // String(mode)); + // String(mode)); switch (mode) { case INPUT_PULL_DOWN: the_digital_pins[pin].pin_mode = mode; @@ -552,8 +554,6 @@ void sonar_new() { sonars[sonars_index].trigger_pin = command_buffer[0]; sonars_index++; // next index, so it is the number of sonars sonar_scan_interval = 100 / sonars_index; // always scan all sonars in 100ms - send_debug_info(9, sonars_index); - } /*********************************** @@ -930,24 +930,14 @@ void init_pin_structures() { the_digital_pins[i].last_value = -1; the_digital_pins[i].differential = 0; // no differential by default } - } #define RXD2 16 #define TXD2 17 - void setup() { Serial.begin(115200); - // Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2); -// Serial2.println("Starting up..."); - // initialize the servo allocation map table init_pin_structures(); - // for (int i = 0; i < 5; i++) { - // digitalWrite(LED_BUILTIN, LOW); - // delay(100); - // digitalWrite(LED_BUILTIN, HIGH); - // delay(100); - // } + hw_init(); for (auto i = 0; i < 0xFF; i++) { Serial.write((uint8_t)0); } @@ -974,8 +964,7 @@ void loop() { } } } -static_assert(command_table[32] == &ping, - "command_table[32] must be ping"); +static_assert(command_table[32] == &ping, "command_table[32] must be ping"); static_assert(sizeof(command_buffer) == MAX_COMMAND_LENGTH, "command_buffer size must be equal to MAX_COMMAND_LENGTH"); static_assert(command_table[37] == &feature_detection, @@ -1003,6 +992,8 @@ void feature_detection() { } else if (cmd == &set_pin_mode) { report_message[3] = NUM_DIGITAL_PINS; report_message[4] = MAX_ANALOG_PINS_SUPPORTED; + // report_message[5] = ADC_RESOLUTION; // ADC resolution + // report_message[6] = PWM_RESOLUTION; // PWM resolution // report_message[5] = ANALOG_PIN_OFFSET; for (auto i = 0; i < MAX_ANALOG_PINS_SUPPORTED; i++) { report_message[6 + i] = (uint8_t)analog_read_pins[i]; @@ -1030,9 +1021,8 @@ template void send_message(const uint8_t (&message)[N]) { // delayMicroseconds(10); // } Serial.write((uint8_t)N); // send msg len - for(size_t i = 0; i < N; i++) { - Serial.write((uint8_t)message[i]); // send msg len - + for (size_t i = 0; i < N; i++) { + Serial.write((uint8_t)message[i]); // send msg len } // Serial.write(message, N); // send message } @@ -1058,7 +1048,7 @@ bool watchdog_enabled = false; uint32_t last_ping = 0; void ping() { static uint8_t random = -1; -// digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); + // digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); auto special_num = command_buffer[0]; if (!watchdog_enabled) { #if ENABLE_ADAFRUIT_WATCHDOG @@ -1078,7 +1068,7 @@ void ping() { // out[0] = out.size() - 1; // dont count the packet length // send_debug_info(1, special_num); // send_debug_info(2, random); - // // Serial2.println("Pinging..."); + // // Serial2.println("Pinging..."); send_message(out); if (true) { @@ -1089,5 +1079,4 @@ void ping() { last_ping = millis(); } - } \ No newline at end of file From 8fed62cf055cc8f3d5cdfc412b302a38a4b15393 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 2 Jul 2025 10:50:17 +0200 Subject: [PATCH 4/9] start i2c --- include/boards/esp32devkit.hpp | 12 +++++++----- include/boards/itsybitsy_m4.hpp | 5 +---- include/boards/nanoatmega.hpp | 2 +- include/boards/pico.hpp | 26 +++++++++++++++++++++----- include/boards/stm32blackpill.hpp | 10 ++-------- include/config.hpp | 6 +++++- include/main.hpp | 5 ----- platformio.ini | 11 +++++++++++ src/boards/esp32devkit.cpp | 13 +++++++++++++ src/boards/itsybitsy_m4.cpp | 9 +++++++++ src/boards/nanoatmega.cpp | 9 +++++++++ src/boards/pico.cpp | 16 ++++++++++++++++ src/boards/stm32blackpill.cpp | 16 ++++++++++++++++ src/i2c.cpp | 1 + src/main.cpp | 15 +++++---------- 15 files changed, 117 insertions(+), 39 deletions(-) create mode 100644 src/boards/esp32devkit.cpp create mode 100644 src/boards/itsybitsy_m4.cpp create mode 100644 src/boards/nanoatmega.cpp create mode 100644 src/boards/pico.cpp create mode 100644 src/boards/stm32blackpill.cpp diff --git a/include/boards/esp32devkit.hpp b/include/boards/esp32devkit.hpp index 12238e4..607a088 100644 --- a/include/boards/esp32devkit.hpp +++ b/include/boards/esp32devkit.hpp @@ -1,15 +1,17 @@ #pragma once #if defined(ARDUINO_ARCH_ESP32) - +#include #include // This board does not have a normal list of analog pins #define A1 2047 #define A2 2047 #define A8 2047 #define A9 2047 -void hw_init() { - analogWriteResolution(8); - analogReadResolution(10); -} +void hw_init(); + +#define SECOND_I2C_PORT 1 +#define SECOND_I2C_PORT_SDA 16 +#define SECOND_I2C_PORT_SCL 17 +extern TwoWire Wire2; // Use GPIO 16 and 17 for I2C on ESP32 #endif \ No newline at end of file diff --git a/include/boards/itsybitsy_m4.hpp b/include/boards/itsybitsy_m4.hpp index cef7fd6..607d967 100644 --- a/include/boards/itsybitsy_m4.hpp +++ b/include/boards/itsybitsy_m4.hpp @@ -18,8 +18,5 @@ const auto A18 = 2047; const auto A19 = 2047; const auto MAX_SERVOS = 0; -void hw_init() { - analogWriteResolution(8); - analogReadResolution(10); -} +void hw_init(); #endif \ No newline at end of file diff --git a/include/boards/nanoatmega.hpp b/include/boards/nanoatmega.hpp index 37d4701..94a771a 100644 --- a/include/boards/nanoatmega.hpp +++ b/include/boards/nanoatmega.hpp @@ -16,5 +16,5 @@ const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; #define MAX_SERVOS 4 // PWM pins on Nano -void hw_init() {} +void hw_init(); #endif \ No newline at end of file diff --git a/include/boards/pico.hpp b/include/boards/pico.hpp index efb2831..4f34e3d 100644 --- a/include/boards/pico.hpp +++ b/include/boards/pico.hpp @@ -1,7 +1,13 @@ #pragma once #include -#if defined(ARDUINO_RASPBERRY_PI_PICO) && defined(ARDUINO_ARCH_RP2040) +// Maybe some more are required, for pico2 and pico1w +#if defined(RASPBERRY_PI_PICO) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || \ + defined(ARDUINO_ARCH_RP2040) + +#include +#include + const auto A4 = 2047; const auto A5 = 2047; const auto A6 = 2047; @@ -18,9 +24,19 @@ const auto A16 = 2047; const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; +#define SECOND_I2C_PORT 1 +// Change the pins to match SDA and SCL for your board +#define SECOND_I2C_PORT_SDA 10 +#define SECOND_I2C_PORT_SCL 11 +#if !defined(ARDUINO_RASPBERRY_PI_PICO_2W) +extern TwoWire Wire2; + #define MAX_SERVOS 12 // according to the servo lib -void hw_init() { - analogWriteResolution(8); - analogReadResolution(10); -} +#else +#define MAX_SERVOS 0 +extern TwoWire Wire2; // Use GPIO 10 and 11 for I2C on Pico 2W +#endif + + +void hw_init(); #endif \ No newline at end of file diff --git a/include/boards/stm32blackpill.hpp b/include/boards/stm32blackpill.hpp index cd5a3c1..9cfaf5b 100644 --- a/include/boards/stm32blackpill.hpp +++ b/include/boards/stm32blackpill.hpp @@ -13,10 +13,7 @@ const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; const auto MAX_SERVOS = 8; -void hw_init() { - analogWriteResolution(8); - analogReadResolution(10); -} +void hw_init(); #endif #if defined(ARDUINO_ARCH_STM32) && defined(ARDUINO_BLACKPILL_F303CC) @@ -26,8 +23,5 @@ const auto A17 = 2047; const auto A18 = 2047; const auto A19 = 2047; const auto MAX_SERVOS = 8; -void hw_init() { - analogWriteResolution(8); - analogReadResolution(10); -} +void hw_init(); #endif diff --git a/include/config.hpp b/include/config.hpp index dbfd997..13b2c7b 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -1,5 +1,9 @@ #pragma once - +#include "boards/esp32devkit.hpp" +#include "boards/itsybitsy_m4.hpp" +#include "boards/nanoatmega.hpp" +#include "boards/pico.hpp" +#include "boards/stm32blackpill.hpp" #ifndef MAX_SONARS #define MAX_SONARS 6 #endif diff --git a/include/main.hpp b/include/main.hpp index 281f525..27f29b3 100644 --- a/include/main.hpp +++ b/include/main.hpp @@ -1,10 +1,5 @@ #pragma once -#include "boards/esp32devkit.hpp" -#include "boards/itsybitsy_m4.hpp" -#include "boards/nanoatmega.hpp" -#include "boards/pico.hpp" -#include "boards/stm32blackpill.hpp" #include void get_unique_id(); diff --git a/platformio.ini b/platformio.ini index c49f13c..18b585d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,3 +108,14 @@ lib_deps = robtillaart/DHTNEW@^0.4.18 adafruit/Adafruit SleepyDog Library@^1.6.5 build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=1 +[env:pico2w] +platform = https://github.com/maxgerhardt/platform-raspberrypi.git +board = rpipico2w +framework = arduino +lib_deps = + teckel12/NewPing@^1.9.7 + arduino-libraries/Stepper@^1.1.3 + arduino-libraries/Servo@^1.2.0 ; No support yet for the Pico + robtillaart/DHTNEW@^0.4.18 + adafruit/Adafruit SleepyDog Library@^1.6.5 +build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=1 diff --git a/src/boards/esp32devkit.cpp b/src/boards/esp32devkit.cpp new file mode 100644 index 0000000..4f29c50 --- /dev/null +++ b/src/boards/esp32devkit.cpp @@ -0,0 +1,13 @@ +#include + + +#if defined(ARDUINO_ARCH_ESP32) + void hw_init() { + + analogWriteResolution(8); + analogReadResolution(10); + Wire1.setPins(SECOND_I2C_PORT_SDA, SECOND_I2C_PORT_SCL); +} + +TwoWire Wire2 = Wire1; // Use GPIO 16 and 17 for I2C on ESP32 +#endif \ No newline at end of file diff --git a/src/boards/itsybitsy_m4.cpp b/src/boards/itsybitsy_m4.cpp new file mode 100644 index 0000000..d17f9b8 --- /dev/null +++ b/src/boards/itsybitsy_m4.cpp @@ -0,0 +1,9 @@ +#include + +#if defined(ARDUINO_ARCH_SAMD) && defined(ARDUINO_ITSYBITSY_M4) +void hw_init() { + analogWriteResolution(8); // Set default PWM resolution to 8 bits + analogReadResolution(10); // Set default ADC resolution to 10 bits +} + +#endif \ No newline at end of file diff --git a/src/boards/nanoatmega.cpp b/src/boards/nanoatmega.cpp new file mode 100644 index 0000000..74ae61b --- /dev/null +++ b/src/boards/nanoatmega.cpp @@ -0,0 +1,9 @@ +#include + +#if defined(ARDUINO_ARCH_AVR) && defined(ARDUINO_AVR_NANO) +void hw_init() { + // No specific hardware initialization needed for Nano + // This is a placeholder for future use if needed +} + +#endif \ No newline at end of file diff --git a/src/boards/pico.cpp b/src/boards/pico.cpp new file mode 100644 index 0000000..1085811 --- /dev/null +++ b/src/boards/pico.cpp @@ -0,0 +1,16 @@ +#include + +#if defined(ARDUINO_RASPBERRY_PI_PICO_2W) || defined(ARDUINO_RASPBERRY_PI_PICO_2) +TwoWire Wire2(i2c1, SECOND_I2C_PORT_SDA, SECOND_I2C_PORT_SCL); +#endif + +#if defined(ARDUINO_RASPBERRY_PI_PICO) +TwoWire Wire2(SECOND_I2C_PORT_SDA, SECOND_I2C_PORT_SCL); +#endif + +#if defined(ARDUINO_ARCH_RP2040) +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} +#endif diff --git a/src/boards/stm32blackpill.cpp b/src/boards/stm32blackpill.cpp new file mode 100644 index 0000000..19442ff --- /dev/null +++ b/src/boards/stm32blackpill.cpp @@ -0,0 +1,16 @@ + +#include +#if defined(ARDUINO_ARCH_STM32) && defined(ARDUINO_BLACKPILL_F103C8) + +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} +#endif + +#if defined(ARDUINO_ARCH_STM32) && defined(ARDUINO_BLACKPILL_F303CC) +void hw_init() { + analogWriteResolution(8); + analogReadResolution(10); +} +#endif diff --git a/src/i2c.cpp b/src/i2c.cpp index c4bba40..8333343 100644 --- a/src/i2c.cpp +++ b/src/i2c.cpp @@ -3,6 +3,7 @@ #include "commands.hpp" #include #include +#include "config.hpp" /*********************************** i2c functions diff --git a/src/main.cpp b/src/main.cpp index 583792e..ade3a37 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,15 +39,8 @@ // #include template void send_message(const uint8_t (&message)[N]); // uncomment out the next line to create a 2nd i2c port -//#define SECOND_I2C_PORT -#ifdef SECOND_I2C_PORT -// Change the pins to match SDA and SCL for your board -#define SECOND_I2C_PORT_SDA PB11 -#define SECOND_I2C_PORT_SCL PB10 -TwoWire Wire2(SECOND_I2C_PORT_SDA, SECOND_I2C_PORT_SCL); -#endif // This value must be the same as specified when instantiating the // telemetrix client. The client defaults to a value of 1. @@ -973,7 +966,7 @@ static_assert(command_table[37] == &feature_detection, void feature_detection() { // in message: [FEATURE_CHECK = 37, message_type_to_check] // out message: [3, FEATURE_CHECK, 0/1] - uint8_t report_message[6 + analog_read_pins_size] = { + uint8_t report_message[7 + analog_read_pins_size] = { FEATURE_CHECK, 0, 0, 0, 0, 0, 0}; // byte report_message[3] = {2, FEATURE_CHECK, 0}; auto message_type = command_buffer[0]; @@ -991,12 +984,14 @@ void feature_detection() { report_message[3] = MAX_SONARS; // sonar } else if (cmd == &set_pin_mode) { report_message[3] = NUM_DIGITAL_PINS; - report_message[4] = MAX_ANALOG_PINS_SUPPORTED; + report_message[4] = 10; // analog input resolution + report_message[5] = 8; // PWM resolution + report_message[6] = MAX_ANALOG_PINS_SUPPORTED; // report_message[5] = ADC_RESOLUTION; // ADC resolution // report_message[6] = PWM_RESOLUTION; // PWM resolution // report_message[5] = ANALOG_PIN_OFFSET; for (auto i = 0; i < MAX_ANALOG_PINS_SUPPORTED; i++) { - report_message[6 + i] = (uint8_t)analog_read_pins[i]; + report_message[7 + i] = (uint8_t)analog_read_pins[i]; } } else if (cmd == &servo_attach) { report_message[3] = MAX_SERVOS; From 9ab982a01787483fed7836693f9f2e2d13898289 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Wed, 2 Jul 2025 14:58:56 +0200 Subject: [PATCH 5/9] Start modules --- include/boards/pico.hpp | 2 +- include/commands.hpp | 1 + include/config.hpp | 4 ++ include/i2c.hpp | 7 ++- include/main.hpp | 7 +++ include/modules.hpp | 38 +++++++++++++ include/modules/ssd1306.hpp | 41 ++++++++++++++ platformio.ini | 2 + src/i2c.cpp | 69 ++++++++++++------------ src/main.cpp | 32 ++++++++--- src/modules.cpp | 104 ++++++++++++++++++++++++++++++++++++ 11 files changed, 263 insertions(+), 44 deletions(-) create mode 100644 include/modules.hpp create mode 100644 include/modules/ssd1306.hpp create mode 100644 src/modules.cpp diff --git a/include/boards/pico.hpp b/include/boards/pico.hpp index 4f34e3d..39655a4 100644 --- a/include/boards/pico.hpp +++ b/include/boards/pico.hpp @@ -36,7 +36,7 @@ extern TwoWire Wire2; #define MAX_SERVOS 0 extern TwoWire Wire2; // Use GPIO 10 and 11 for I2C on Pico 2W #endif - +#define I2C_COUNT 2 void hw_init(); #endif \ No newline at end of file diff --git a/include/commands.hpp b/include/commands.hpp index 2ebd6e4..feeacb2 100644 --- a/include/commands.hpp +++ b/include/commands.hpp @@ -56,6 +56,7 @@ enum MESSAGE_OUT_TYPE : uint8_t { DEBUG_PRINT = 99, SENSOR_REPORT = 20, PONG_REPORT = 32, + MODULE_MAIN_REPORT = 33, MODULE_REPORT = 34, MAX_OUT_MESSAGE_TYPE }; diff --git a/include/config.hpp b/include/config.hpp index 13b2c7b..66f1ed5 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -10,4 +10,8 @@ #ifndef ENABLE_ADAFRUIT_WATCHDOG #define ENABLE_ADAFRUIT_WATCHDOG 1 +#endif + +#ifndef I2C_COUNT +#define I2C_COUNT 1 #endif \ No newline at end of file diff --git a/include/i2c.hpp b/include/i2c.hpp index af61e25..46c79ce 100644 --- a/include/i2c.hpp +++ b/include/i2c.hpp @@ -1,5 +1,6 @@ #pragma once - +#include +#include void i2c_begin(); void i2c_read(); void i2c_write(); @@ -44,3 +45,7 @@ void i2c_write(); // Indicator that no i2c register is being specified in the command #define I2C_NO_REGISTER 254 + + + +extern TwoWire* i2c_buses[I2C_COUNT]; \ No newline at end of file diff --git a/include/main.hpp b/include/main.hpp index 27f29b3..f7e67d5 100644 --- a/include/main.hpp +++ b/include/main.hpp @@ -44,6 +44,11 @@ void ping(); void feature_detection(); +void send_debug_info(byte id, int value); + +void module_new(); +void module_data(); + enum PIN_MODES : uint8_t { NOT_SET = 255, INPUT_MODE = 0, @@ -55,3 +60,5 @@ enum PIN_MODES : uint8_t { SONAR_MODE = 7, DHT_MODE = 8 }; + +void send_message(const uint8_t *message, size_t length); \ No newline at end of file diff --git a/include/modules.hpp b/include/modules.hpp new file mode 100644 index 0000000..de32f67 --- /dev/null +++ b/include/modules.hpp @@ -0,0 +1,38 @@ +#pragma once +#include +#define MAX_MODULES_COUNT 4 // Max number of modules that can be added +/***********************************************/ +/***************MODULES*************************/ +void module_new_i(uint8_t command_buffer[], size_t packet_size); + +void module_data_i(uint8_t command_buffer[], size_t packet_size); + + +enum MODULE_TYPES : uint8_t { // Max 255 modules, but will always fit in a + // single byte! + PCA9685 = 0, // 16x 12bit PWM + HIWONDER_SERVO = 1, + SHUTDOWN_RELAY = 2, + TMX_SSD1306 = 3, + MAX_MODULES +}; + +class Module { +public: + virtual void readModule() = 0; + virtual void writeModule(uint8_t data[], size_t size) = 0; + virtual void resetModule() = 0; + bool stop = false; + void publishData(const uint8_t data[], size_t size); + + int num = 0; + MODULE_TYPES type = MODULE_TYPES::MAX_MODULES; + // called at every loop, only used when needed (Oled update) + virtual void updModule() {}; +}; + +extern Module *modules[MAX_MODULES_COUNT]; // Array of pointers to modules +extern size_t module_count; // Number of modules in the array + + +#include "modules/ssd1306.hpp" // Include the SSD1306 module header \ No newline at end of file diff --git a/include/modules/ssd1306.hpp b/include/modules/ssd1306.hpp new file mode 100644 index 0000000..30bcb60 --- /dev/null +++ b/include/modules/ssd1306.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +class TmxSSD1306 : public Module { +public: + TmxSSD1306(uint8_t data[], size_t packet_size) { + num = data[0]; + type = MODULE_TYPES::TMX_SSD1306; + // Initialize the SSD1306 display with the provided data + // For example, you might set the I2C address or other parameters + // depending on the data received. + // This is just a placeholder, actual initialization code will depend on + // the SSD1306 library you are using. + } + void readModule() override { + // Implement reading from the SSD1306 display + // This could involve reading display data or status + } + void writeModule(uint8_t data[], size_t size) override { + // Implement writing to the SSD1306 display + // This could involve sending commands or data to the display + send_debug_info(30, size); + send_debug_info(31, data[0]); + if(data[0] == 1) { + uint8_t display_data[32] = { + 1, 13, 10, 1 + }; + // display_data[0] = 1; // Length of the data to be sent + this->publishData(data, 4); + } + } + void resetModule() override { + // Implement resetting the SSD1306 display + // This could involve sending a reset command or reinitializing the display + } + void updModule() override { + // Implement any periodic updates needed for the SSD1306 display + // This could involve refreshing the display or updating its content + } +}; \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 18b585d..55f7ed5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -107,6 +107,8 @@ lib_deps = arduino-libraries/Servo@^1.2.0 ; No support yet for the Pico robtillaart/DHTNEW@^0.4.18 adafruit/Adafruit SleepyDog Library@^1.6.5 + adafruit/Adafruit SSD1306 @ ^2.5.15 + build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=1 [env:pico2w] platform = https://github.com/maxgerhardt/platform-raspberrypi.git diff --git a/src/i2c.cpp b/src/i2c.cpp index 8333343..77abcd6 100644 --- a/src/i2c.cpp +++ b/src/i2c.cpp @@ -9,29 +9,35 @@ i2c functions **********************************/ +TwoWire *i2c_buses[I2C_COUNT] = {&Wire, + #if I2C_COUNT > 1 + &Wire2 + #endif + #if I2C_COUNT > 2 + &Wire3 + #endif + // Add more TwoWire instances if needed +}; + void i2c_begin() { + byte i2c_port = command_buffer[0]; - if (!i2c_port) { - Wire.begin(); -#if defined(__AVR_ATmega328P__) - Wire.setWireTimeout(10, false); - Wire.clearWireTimeoutFlag(); -#endif + if(i2c_port >= I2C_COUNT) { + // Invalid I2C port requested, return without initializing + // Serial.println("Invalid I2C port requested"); + return; } - -#ifdef SECOND_I2C_PORT - else { - Wire2.begin(); + auto ¤t_i2c_port = *i2c_buses[i2c_port]; + // Initialize the I2C port + current_i2c_port.begin(); + #if defined(__AVR_ATmega328P__) - Wire2.setWireTimeout(10, false); - Wire2.clearWireTimeoutFlag(); -#endif - } + current_i2c_port.setWireTimeout(10, false); + current_i2c_port.clearWireTimeoutFlag(); #endif } void i2c_read() { - TwoWire *current_i2c_port; // data in the incoming message: // address, [0] @@ -44,18 +50,13 @@ void i2c_read() { byte address = command_buffer[0]; byte the_register = command_buffer[1]; uint8_t message_id = command_buffer[I2C_READ_MESSAGE_ID]; - - // set the current i2c port if this is for the primary i2c - if (command_buffer[4] == 0) { - current_i2c_port = &Wire; - } - -#ifdef SECOND_I2C_PORT - // this is for port 2 - if (command_buffer[4] == 1) { - current_i2c_port = &Wire2; + uint8_t port = command_buffer[I2C_PORT]; + if(port >= I2C_COUNT) { + // Invalid I2C port requested, return without processing + // Serial.println("Invalid I2C port requested"); + return; } -#endif + auto ¤t_i2c_port = i2c_buses[port]; uint8_t i2c_report_message[64]; current_i2c_port->beginTransmission(address); @@ -105,7 +106,6 @@ void i2c_read() { } void i2c_write() { - TwoWire *current_i2c_port; // command_buffer[0] is the number of bytes to send // command_buffer[1] is the device address @@ -113,16 +113,13 @@ void i2c_write() { // additional bytes to write= command_buffer[3..]; // set the current i2c port if this is for the primary i2c - if (command_buffer[2] == 0) { - current_i2c_port = &Wire; - } - -#ifdef SECOND_I2C_PORT - // this is for port 2 - if (command_buffer[2] == 1) { - current_i2c_port = &Wire2; + uint8_t i2c_port = command_buffer[I2C_PORT]; + if (i2c_port >= I2C_COUNT) { + // Invalid I2C port requested, return without processing + // Serial.println("Invalid I2C port requested"); + return; } -#endif + auto ¤t_i2c_port = i2c_buses[i2c_port]; #if defined(__AVR_ATmega328P__) if (current_i2c_port->getWireTimeoutFlag()) { return; diff --git a/src/main.cpp b/src/main.cpp index ade3a37..bb5b5c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,7 +8,7 @@ #include #include #include - +#include "modules.hpp" #if MAX_SERVOS > 0 #include #endif @@ -73,8 +73,8 @@ auto spi_cs_control = nullptr; auto set_scan_delay = nullptr; auto sensor_new = nullptr; // auto ping = nullptr; -auto module_new = nullptr; -auto module_data = nullptr; +// auto module_new = module_new; +// auto module_data = module_data; auto get_id = nullptr; auto set_id = nullptr; // If you add new commands, make sure to extend the siz of this @@ -113,8 +113,8 @@ constexpr command_descriptor command_table[] = { &encoder_new, // 30, checked sensor_new, ping, // 32, checked, not impelemented - module_new, - module_data, + &module_new, + &module_data, get_id, set_id, &feature_detection}; @@ -615,9 +615,9 @@ void enable_all_reports() { // delay(20); } + byte packet_length; void get_next_command() { byte command; - byte packet_length; command_descriptor command_entry; // clear the command buffer @@ -1002,6 +1002,8 @@ void feature_detection() { report_message[4] = FIRMWARE_MINOR; } else if (cmd == &get_unique_id) { report_message[3] = 0; // TODO: implement + } else if(cmd == &i2c_begin) { + report_message[3] = I2C_COUNT; } } else { report_message[2] = 0; // command not supported @@ -1022,6 +1024,16 @@ template void send_message(const uint8_t (&message)[N]) { // Serial.write(message, N); // send message } +void send_message(const uint8_t *message, size_t length) { + // while (Serial.availableForWrite() < (int)length + 3) { + // Serial.println("Waiting for serial write..."); + // delayMicroseconds(10); + // } + Serial.write((uint8_t)(length)); // send msg len + for (size_t i = 0; i < length; i++) { + Serial.write((uint8_t)message[i]); // send msg len + }} + void get_unique_id() { // in message: [GET_UNIQUE_ID = 6] // out message: [REPORT_UNIQUE_ID = 6, id[0], id[1], id[2], @@ -1074,4 +1086,12 @@ void ping() { last_ping = millis(); } +} + +void module_new() { + module_new_i(command_buffer, packet_length); +} + +void module_data() { + module_data_i(command_buffer, packet_length); } \ No newline at end of file diff --git a/src/modules.cpp b/src/modules.cpp new file mode 100644 index 0000000..2aa0767 --- /dev/null +++ b/src/modules.cpp @@ -0,0 +1,104 @@ +#include "modules.hpp" +#include "main.hpp" +#include "commands.hpp" + +typedef Module * (*ModuleFunc)(uint8_t[], size_t); + +Module * create_ssd1306_module(uint8_t data[], size_t packet_size) { + return new TmxSSD1306(data, packet_size); +} + +size_t module_count = 0; // Initialize module count +Module *modules[MAX_MODULES_COUNT] = {nullptr}; // Array of pointers to modules + +void module_new_i(uint8_t command_buffer[], size_t packet_size) { + + const auto msg_type = command_buffer[0]; + send_debug_info(10, msg_type); + send_debug_info(11, packet_size); + send_debug_info(12, command_buffer[1]); + const ModuleFunc module_funcs[] = + { + nullptr, // {MODULE_TYPES::PCA9685, [](std::vector& data) { return new PCA9685_Module(data); }}, + nullptr,// {MODULE_TYPES::HIWONDER_SERVO, []( std::vector& data) { return new Hiwonder_Servo(data); }}, + nullptr,// {MODULE_TYPES::SHUTDOWN_RELAY, [](const std::vector& data) { return nullptr; /* not implemented */ }}, + create_ssd1306_module, // {MODULE_TYPES::TMX_SSD1306, create_ssd1306_module}, + }; +if(module_count >= MAX_MODULES_COUNT) { + return; // no more modules can be added + } + if(msg_type==1) { + const MODULE_TYPES type = (MODULE_TYPES)command_buffer[2]; + const uint8_t module_num = command_buffer[1]; + // std::vector data; + + // data.insert(data.end(), &command_buffer[4], &command_buffer[packet_size]); + + if (type >= MODULE_TYPES::MAX_MODULES) { + return; + } + Module *module = nullptr; + // if (type == MODULE_TYPES::PCA9685) { + // module = new PCA9685_Module(data); + // } else if (type == MODULE_TYPES::HIWONDER_SERVO) { + // module = new Hiwonder_Servo(data); + // } else if (type == MODULE_TYPES::SHUTDOWN_RELAY) { + // return; // not implemented + // // module = new Shutdown_Relay(data); + // } else if (type == MODULE_TYPES::TMX_SSD1306) { + // module = new TmxSSD1306(data); + // } else { + // return; + // } + auto func = module_funcs[type]; + if (func == nullptr) { + return; // module type not supported + } + module = func(command_buffer+3, packet_size-3); + module->type = type; + module->num = module_num; + + modules[module_num] = module; + module_count++; + } else if(msg_type==0) { // check module type feature detection + bool found = false; + const uint8_t module_type_target = command_buffer[1]; + send_debug_info(0, module_type_target); + if (module_type_target < MODULE_TYPES::MAX_MODULES) { + found = (module_funcs[module_type_target] != nullptr); + send_debug_info(1, found ? 1 : 0); + } + uint8_t message[4] = { + MODULE_MAIN_REPORT, // message type + 0, // feature check + module_type_target, // module type + (uint8_t)(found ? 1u : 0u) // found or not + }; + send_message(message, 4); + } +} + +void module_data_i(uint8_t command_buffer[], size_t packet_size) { + const uint8_t module_num = command_buffer[0]; + if (module_num > module_count || module_num >= MAX_MODULES_COUNT) { + return; + } +// std::vector data; +// data.insert(data.end(), &command_buffer[2], &command_buffer[packet_size]); + modules[module_num]->writeModule(command_buffer+1, packet_size-1); +} + + +void Module::publishData(const uint8_t data[], size_t size) { + uint8_t out[30] = { + // 0, // write len + MODULE_REPORT, // write type + (uint8_t)this->num, // write num + this->type, // write sensor type + }; + for(size_t i = 0; i < size && i < sizeof(out) - 4; i++) { + out[i + 4] = data[i]; // copy data to the output buffer + } + + send_message(out, size + 4); // send the message with the data +} \ No newline at end of file From d04f35c410edee13d2a9c9fdd6b505fd5ef89f89 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 4 Jul 2025 14:10:03 +0200 Subject: [PATCH 6/9] add sensors system --- .github/workflows/build.yaml | 1 + include/boards/pico.hpp | 2 +- include/boards/stm32blackpill.hpp | 2 +- include/i2c.hpp | 6 ++- include/main.hpp | 2 +- include/modules.hpp | 20 ++++++++- include/modules/ssd1306.hpp | 32 +++++--------- include/sensors.hpp | 47 +++++++++++++++++++++ include/sensors/veml6040.hpp | 64 ++++++++++++++++++++++++++++ platformio.ini | 21 ++++++++-- src/i2c.cpp | 47 +++++++++++++++++++++ src/main.cpp | 70 +++++++++++++++++++++---------- src/modules.cpp | 19 ++++++++- src/sensors.cpp | 70 +++++++++++++++++++++++++++++++ 14 files changed, 351 insertions(+), 52 deletions(-) create mode 100644 include/sensors.hpp create mode 100644 include/sensors/veml6040.hpp create mode 100644 src/sensors.cpp diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e5b951c..e09c12a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,7 @@ jobs: "robotdyn_blackpill_f103", "pico", "esp32doit-devkit-v1", + "pico2w" ] fail-fast: false diff --git a/include/boards/pico.hpp b/include/boards/pico.hpp index 39655a4..66fccba 100644 --- a/include/boards/pico.hpp +++ b/include/boards/pico.hpp @@ -37,6 +37,6 @@ extern TwoWire Wire2; extern TwoWire Wire2; // Use GPIO 10 and 11 for I2C on Pico 2W #endif #define I2C_COUNT 2 - +#define MAX_SONARS 6 // the current library does not work somehow on pico void hw_init(); #endif \ No newline at end of file diff --git a/include/boards/stm32blackpill.hpp b/include/boards/stm32blackpill.hpp index 9cfaf5b..4152e95 100644 --- a/include/boards/stm32blackpill.hpp +++ b/include/boards/stm32blackpill.hpp @@ -3,7 +3,7 @@ #if defined(ARDUINO_ARCH_STM32) && defined(ARDUINO_BLACKPILL_F103C8) const auto A10 = 2047; -const auto A11 = 2047; +const auto A11 = 2047; const auto A12 = 2047; const auto A13 = 2047; const auto A14 = 2047; diff --git a/include/i2c.hpp b/include/i2c.hpp index 46c79ce..7e575c0 100644 --- a/include/i2c.hpp +++ b/include/i2c.hpp @@ -48,4 +48,8 @@ void i2c_write(); -extern TwoWire* i2c_buses[I2C_COUNT]; \ No newline at end of file +extern TwoWire* i2c_buses[I2C_COUNT]; + + +bool write_i2c(int i2c_port, int device_address, const uint8_t* data, size_t length); +bool read_i2c(int i2c_port, int device_address, const uint8_t* registers, size_t register_length, uint8_t* data, size_t data_length); \ No newline at end of file diff --git a/include/main.hpp b/include/main.hpp index f7e67d5..0832982 100644 --- a/include/main.hpp +++ b/include/main.hpp @@ -48,7 +48,7 @@ void send_debug_info(byte id, int value); void module_new(); void module_data(); - +void sensor_new(); enum PIN_MODES : uint8_t { NOT_SET = 255, INPUT_MODE = 0, diff --git a/include/modules.hpp b/include/modules.hpp index de32f67..6bb8075 100644 --- a/include/modules.hpp +++ b/include/modules.hpp @@ -1,6 +1,11 @@ #pragma once #include +#ifndef MAX_MODULES_COUNT #define MAX_MODULES_COUNT 4 // Max number of modules that can be added +#endif // MAX_MODULES_COUNT + + +#if MAX_MODULES_COUNT > 0 /***********************************************/ /***************MODULES*************************/ void module_new_i(uint8_t command_buffer[], size_t packet_size); @@ -30,9 +35,20 @@ class Module { // called at every loop, only used when needed (Oled update) virtual void updModule() {}; }; - +void scan_modules(); +void upd_modules(); extern Module *modules[MAX_MODULES_COUNT]; // Array of pointers to modules extern size_t module_count; // Number of modules in the array -#include "modules/ssd1306.hpp" // Include the SSD1306 module header \ No newline at end of file +#include "modules/ssd1306.hpp" // Include the SSD1306 module header + +#else + +// No modules supported, so we define empty functions +inline void module_new_i(uint8_t command_buffer[], size_t packet_size) {} +inline void module_data_i(uint8_t command_buffer[], size_t packet_size) {} +inline void scan_modules() {} +inline void upd_modules() {} + +#endif \ No newline at end of file diff --git a/include/modules/ssd1306.hpp b/include/modules/ssd1306.hpp index 30bcb60..f42271d 100644 --- a/include/modules/ssd1306.hpp +++ b/include/modules/ssd1306.hpp @@ -7,35 +7,25 @@ class TmxSSD1306 : public Module { TmxSSD1306(uint8_t data[], size_t packet_size) { num = data[0]; type = MODULE_TYPES::TMX_SSD1306; - // Initialize the SSD1306 display with the provided data - // For example, you might set the I2C address or other parameters - // depending on the data received. - // This is just a placeholder, actual initialization code will depend on - // the SSD1306 library you are using. + // TODO: this is just for testing the module system. } void readModule() override { - // Implement reading from the SSD1306 display - // This could involve reading display data or status + // probably nothing to read } void writeModule(uint8_t data[], size_t size) override { - // Implement writing to the SSD1306 display - // This could involve sending commands or data to the display - send_debug_info(30, size); - send_debug_info(31, data[0]); - if(data[0] == 1) { + // // TODO: implement writing to the SSD1306 display + // send_debug_info(30, size); + // send_debug_info(31, data[0]); + if(data[0] == 1) { // test reply on the "booting..." text commands. uint8_t display_data[32] = { - 1, 13, 10, 1 + 1, 10, 10, 1 }; - // display_data[0] = 1; // Length of the data to be sent - this->publishData(data, 4); + + this->publishData(display_data, 4); } } - void resetModule() override { - // Implement resetting the SSD1306 display - // This could involve sending a reset command or reinitializing the display - } + void resetModule() override {} void updModule() override { - // Implement any periodic updates needed for the SSD1306 display - // This could involve refreshing the display or updating its content + // MAYBE: write a few bytes to the display, or not, depends on lib. } }; \ No newline at end of file diff --git a/include/sensors.hpp b/include/sensors.hpp new file mode 100644 index 0000000..e8603c9 --- /dev/null +++ b/include/sensors.hpp @@ -0,0 +1,47 @@ +#pragma once +#include +#ifndef MAX_SENSORS_COUNT +#define MAX_SENSORS_COUNT 4 // Max number of modules that can be added +#endif // MAX_MODULES_COUNT + + +#if MAX_SENSORS_COUNT > 0 +/*****************************************************************************/ +/****SENSORS*/ +/*****************************************************************************/ + +enum SENSOR_TYPES : uint8_t { // Max 255 sensors, but will always fit in a + // single byte! + GPS = 0, + LOAD_CELL = 1, + MPU_9250 = 2, + TOF_VL53 = 3, + VEML6040 = 4, // Color sensor + ADXL345 = 5, // 3 axis accel + INA226a = 6, + HMC5883l = 7, + AS5600_t = 8, // Magnetic angle sensor + MAX_SENSORS +}; + +class Sensor { +public: + virtual void readSensor() = 0; + virtual void resetSensor() = 0; + bool stop = false; + void writeSensorData(const uint8_t data[], size_t size); + int num; + SENSOR_TYPES type = SENSOR_TYPES::MAX_SENSORS; +}; + +const int SENSORS_MAX_SETTINGS_A = 6; +void sensor_new_i(uint8_t command_buffer[], size_t packet_size); +void readSensors(); + + +#else + +// No sensors supported, so we define empty functions +void sensor_new_i(uint8_t command_buffer[], size_t packet_size); +void readSensors(); +#endif \ No newline at end of file diff --git a/include/sensors/veml6040.hpp b/include/sensors/veml6040.hpp new file mode 100644 index 0000000..f8205ff --- /dev/null +++ b/include/sensors/veml6040.hpp @@ -0,0 +1,64 @@ +#pragma once + +#include + +#if MAX_SENSORS_COUNT > 0 +#include +#include +class VEML6040_Sensor : public Sensor { +public: + VEML6040_Sensor(uint8_t settings[], size_t settings_size) { + // Initialize the sensor with the provided settings + if (settings_size > 0) { + i2c_port = settings[0]; // Assuming first byte is I2C port + } + init_sequence(); + } + void readSensor() { + if (this->stop) { + return; + } + uint8_t data[8]; + uint8_t sensor_data[2]; + bool ok = true; + size_t data_offset = 0; + for (uint8_t reg = 0x08; reg <= 0x0B; + reg++) { // read the 4 registers and add the data to the full data vector + uint8_t regs[1] = {reg}; + ok &= read_i2c(this->i2c_port, this->i2c_addr, regs, 1, sensor_data, 2); + // Flip the order to make it match the rest. + data[0+data_offset] = sensor_data[1]; + data[1+data_offset] = sensor_data[0]; + data_offset += 2; + } + + this->writeSensorData(data, 8); + if (!ok) { + this->stop = true; + } +} + void resetSensor() {}; + +private: + void init_sequence() { + uint8_t data[2] = {0, 0x21}; + bool ok = write_i2c(this->i2c_port, this->i2c_addr, + data, 2); + delay(10); + data[1] = 0x20; // 0x20 = 0b0010'0000, 100 time, no stop bit + ok &= write_i2c(this->i2c_port, this->i2c_addr, + data, 2); + if (!ok) { + this->stop = true; + } + } + int i2c_port = 0; + int i2c_addr = 0x10; +}; + + + + + + +#endif \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 55f7ed5..6c48670 100644 --- a/platformio.ini +++ b/platformio.ini @@ -88,6 +88,7 @@ lib_deps = [env:esp32doit-devkit-v1] platform = espressif32 board = esp32doit-devkit-v1 +build_type = debug framework = arduino lib_deps = teckel12/NewPing@^1.9.7 @@ -95,10 +96,23 @@ lib_deps = ; arduino-libraries/Servo@^1.2.0 robtillaart/DHTNEW@^0.4.18 adafruit/Adafruit SleepyDog Library@^1.6.5 -build_flags = -std=c++2a -DMAX_SERVOS=0 -DENABLE_ADAFRUIT_WATCHDOG=1 +build_flags = -std=c++2a -DMAX_SERVOS=0 -DENABLE_ADAFRUIT_WATCHDOG=0 -DENABLE_WATCHDOG=0 -[env:pico] -platform = raspberrypi +; [env:pico] +; platform = raspberrypi # official platform, but unsupported as RPi is skeer +; board = pico +; framework = arduino +; lib_deps = +; teckel12/NewPing@^1.9.7 +; arduino-libraries/Stepper@^1.1.3 +; arduino-libraries/Servo@^1.2.0 ; No support yet for the Pico +; robtillaart/DHTNEW@^0.4.18 +; adafruit/Adafruit SleepyDog Library@^1.6.5 +; adafruit/Adafruit SSD1306 @ ^2.5.15 +; build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=1 + +[env:pico] # Alternative platform for Raspberry Pi Pico, without the MBED layer, fixes sonar issue +platform = https://github.com/maxgerhardt/platform-raspberrypi.git board = pico framework = arduino lib_deps = @@ -110,6 +124,7 @@ lib_deps = adafruit/Adafruit SSD1306 @ ^2.5.15 build_flags = -std=c++2a -DENABLE_ADAFRUIT_WATCHDOG=1 + [env:pico2w] platform = https://github.com/maxgerhardt/platform-raspberrypi.git board = rpipico2w diff --git a/src/i2c.cpp b/src/i2c.cpp index 77abcd6..aefbb10 100644 --- a/src/i2c.cpp +++ b/src/i2c.cpp @@ -134,3 +134,50 @@ void i2c_write() { current_i2c_port->endTransmission(); // delayMicroseconds(70); } + + +bool write_i2c(int i2c_port, int device_address, const uint8_t* data, size_t length) { + if (i2c_port < 0 || i2c_port >= I2C_COUNT) { + return false; // Invalid I2C port + } + TwoWire* wire = i2c_buses[i2c_port]; + if (wire == nullptr) { + return false; // I2C bus not initialized + } + wire->beginTransmission(device_address); + for (size_t i = 0; i < length; i++) { + wire->write(data[i]); + } + return wire->endTransmission() == 0; // Return true if successful +} + + +bool read_i2c(int i2c_port, int device_address, const uint8_t* registers, size_t register_length, uint8_t* data, size_t data_length) { + if (i2c_port < 0 || i2c_port >= I2C_COUNT) { + return false; // Invalid I2C port + } + TwoWire* wire = i2c_buses[i2c_port]; + if (wire == nullptr) { + return false; // I2C bus not initialized + } + + wire->beginTransmission(device_address); + for (size_t i = 0; i < register_length; i++) { + wire->write(registers[i]); + } + + if (wire->endTransmission() != 0) { + return false; // Transmission failed + } + + size_t bytesRead = wire->requestFrom(device_address, data_length); + if (bytesRead != data_length) { + return false; // Not enough data read + } + + for (size_t i = 0; i < bytesRead; i++) { + data[i] = wire->read(); + } + + return true; // Read successful +} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index bb5b5c0..c06f04f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,6 +14,7 @@ #endif #include #include +#include "sensors.hpp" // #include /* Copyright (c) 2020 Alan Yorinks All rights reserved. @@ -71,7 +72,7 @@ auto read_blocking_spi = nullptr; auto set_format_spi = nullptr; auto spi_cs_control = nullptr; auto set_scan_delay = nullptr; -auto sensor_new = nullptr; +// auto sensor_new = ; // auto ping = nullptr; // auto module_new = module_new; // auto module_data = module_data; @@ -111,7 +112,7 @@ constexpr command_descriptor command_table[] = { spi_cs_control, set_scan_delay, &encoder_new, // 30, checked - sensor_new, + &sensor_new, ping, // 32, checked, not impelemented &module_new, &module_data, @@ -185,19 +186,28 @@ constexpr int get_total_pins_not(const int *pins, int size, int not_value) { : get_total_pins_not(pins, size - 1, not_value)) : 0; } -// constexpr int get_total_pins_c(const int *pins, int size, int not_value, int -// c) { -// return c 0 ? (pins[size - 1] != not_value + ? max_i(get_highest_analog_pin(pins, size - 1, not_value), pins[size - 1]) + : get_highest_analog_pin(pins, size - 1, not_value)) + : 0; +} constexpr auto MAX_ANALOG_PINS_SUPPORTED = get_total_pins_not(analog_read_pins, analog_read_pins_size, 2047); // maximum number of pins supported -constexpr auto MAX_PINS_SUPPORTED = +// some boards (stm32f103) put analog pins in the 0xC0 range +// wastes some memory space, but is easier to use. +constexpr auto MAX_PINS_SUPPORTED = max_i( NUM_DIGITAL_PINS + - MAX_ANALOG_PINS_SUPPORTED; // probably too high but good enough + MAX_ANALOG_PINS_SUPPORTED, get_highest_analog_pin(analog_read_pins, analog_read_pins_size, 2047)); // probably too high but good enough // #define // a descriptor for digital pins struct pin_descriptor { @@ -541,7 +551,8 @@ void sonar_new() { if (sonars_index >= MAX_SONARS) { return; } - + send_debug_info(130, command_buffer[0]); + send_debug_info(131, command_buffer[1]); sonars[sonars_index].usonic = new NewPing((uint8_t)command_buffer[0], (uint8_t)command_buffer[1], 400); sonars[sonars_index].trigger_pin = command_buffer[0]; @@ -726,20 +737,12 @@ void scan_analog_inputs() { value = analogRead(adjusted_pin_number); differential = abs(value - the_digital_pins[i].last_value); if (differential >= the_digital_pins[i].differential) { - // send_debug_info(i, differential); // trigger value achieved, send out the report the_digital_pins[i].last_value = value; - // input_message[1] = the_analog_pins[i].pin_number; report_message[1] = (byte)adjusted_pin_number; report_message[2] = highByte(value); // get high order byte report_message[3] = lowByte(value); - // Serial.write(report_message, 5); send_message(report_message); - // Serial2.print("Analog pin: "); - // Serial2.print(adjusted_pin_number); - // Serial2.print(" value: "); - // Serial2.println(value); - // delay(1); } } } @@ -755,7 +758,12 @@ void scan_sonars() { if (sonar_current_millis - sonar_previous_millis > sonar_scan_interval) { // send_debug_info(10, sonar_current_millis); sonar_previous_millis += sonar_scan_interval; - distance = sonars[last_sonar_visited].usonic->ping() / US_ROUNDTRIP_CM; + auto ping = sonars[last_sonar_visited].usonic->ping(); + send_debug_info(123, ping); + distance = ping / US_ROUNDTRIP_CM; + if(ping == 0) { + distance = 0xFFFE; + } if (distance != sonars[last_sonar_visited].last_value || true) { sonars[last_sonar_visited].last_value = distance; @@ -763,7 +771,7 @@ void scan_sonars() { byte report_message[] = { SONAR_DISTANCE, sonars[last_sonar_visited].trigger_pin, - (byte)(distance / 100), (byte)(distance % 100)}; + (byte)(distance >> 8), (byte)(distance % 0xFF)}; // Serial.write(report_message, 5); // send_debug_info(0, distance); send_message(report_message); @@ -934,17 +942,30 @@ void setup() { for (auto i = 0; i < 0xFF; i++) { Serial.write((uint8_t)0); } + pinMode(LED_BUILTIN, OUTPUT); + digitalWrite(LED_BUILTIN, LOW); // turn off the LED + for(auto i = 0; i < 4; i++) { + digitalWrite(LED_BUILTIN, HIGH); + delay(100); + digitalWrite(LED_BUILTIN, LOW); + delay(100); + } // get_firmware_version(); } void loop() { // keep processing incoming commands get_next_command(); + upd_modules(); static decltype(millis()) last_scan = 0; static decltype(millis()) scan_delay = 10; if (!stop_reports) { // stop reporting if (millis() - last_scan >= (scan_delay)) { - // digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); + static int x = 0; + x++; + // send_debug_info(100, x++); + // send_debug_info(101, Serial.available()); + digitalWrite(LED_BUILTIN, x%2); // Serial.println("Scanning inputs..."); // send_debug_info(10, 10); last_scan += scan_delay; @@ -954,6 +975,7 @@ void loop() { scan_sonars(); scan_dhts(); scan_encoders(); + scan_modules(); } } } @@ -964,6 +986,7 @@ static_assert(command_table[37] == &feature_detection, "command_table[37] must be feature_detection"); void feature_detection() { + send_debug_info(201, 1); // in message: [FEATURE_CHECK = 37, message_type_to_check] // out message: [3, FEATURE_CHECK, 0/1] uint8_t report_message[7 + analog_read_pins_size] = { @@ -1010,6 +1033,7 @@ void feature_detection() { } } send_message(report_message); + send_debug_info(200, message_type); } template void send_message(const uint8_t (&message)[N]) { @@ -1094,4 +1118,8 @@ void module_new() { void module_data() { module_data_i(command_buffer, packet_length); +} + +void sensor_new() { + sensor_new_i(command_buffer, packet_length); } \ No newline at end of file diff --git a/src/modules.cpp b/src/modules.cpp index 2aa0767..8c94b5c 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -97,8 +97,25 @@ void Module::publishData(const uint8_t data[], size_t size) { this->type, // write sensor type }; for(size_t i = 0; i < size && i < sizeof(out) - 4; i++) { - out[i + 4] = data[i]; // copy data to the output buffer + out[i + 3] = data[i]; // copy data to the output buffer } send_message(out, size + 4); // send the message with the data + // TODO: check dit +} + +void scan_modules() { + for (size_t i = 0; i < module_count; i++) { + if (modules[i] != nullptr && !modules[i]->stop) { + modules[i]->readModule(); + } + } +} + +void upd_modules() { + for (size_t i = 0; i < module_count; i++) { + if (modules[i] != nullptr && !modules[i]->stop) { + modules[i]->updModule(); + } + } } \ No newline at end of file diff --git a/src/sensors.cpp b/src/sensors.cpp new file mode 100644 index 0000000..44cb2b7 --- /dev/null +++ b/src/sensors.cpp @@ -0,0 +1,70 @@ +#include "sensors.hpp" +#if MAX_SENSORS_COUNT > 0 +#include "sensors/veml6040.hpp" // Include the VEML6040 +#include "main.hpp" +#include "commands.hpp" + +void Sensor::writeSensorData(const uint8_t data[], size_t size) { + uint8_t out[30] = { + SENSOR_REPORT, // write type + (uint8_t)this->num, // write num + this->type, // write sensor type + }; + for(size_t i = 0; i < size && i < sizeof(out) - 3; i++) { + out[i + 3] = data[i]; // copy data to the output buffer + } + send_message(out, size+3); +} +Sensor *sensors[MAX_SENSORS_COUNT] = {}; // Array of pointers to sensors +size_t sensors_count = 0; // Number of sensors in the array + +void sensor_new_i(uint8_t command_buffer[], size_t packet_size) { + const SENSOR_TYPES type = (SENSOR_TYPES)command_buffer[1]; + const uint8_t sensor_num = command_buffer[0]; + uint8_t* sensor_data = command_buffer + 2; // data starts after type and num + size_t sensor_data_size = packet_size - 2; // size of the data + if (type >= SENSOR_TYPES::MAX_SENSORS) { + return; + } + Sensor *sensor = nullptr; + if (type == SENSOR_TYPES::VEML6040) { + sensor = new VEML6040_Sensor(sensor_data, sensor_data_size); + } else if (type == SENSOR_TYPES::TOF_VL53) { + // sensor = new VL53L0X_Sensor(sensor_data,sensor_data_size); + } else if (type == SENSOR_TYPES::MPU_9250) { + // sensor = new MPU9250_Sensor(sensor_data,sensor_data_size); + } else if (type == SENSOR_TYPES::LOAD_CELL) { + // sensor = new HX711_Sensor(sensor_data,sensor_data_size); + } else if (type == SENSOR_TYPES::INA226a) { + // sensor = new INA226_Sensor(sensor_data,sensor_data_size); + } else if (type == SENSOR_TYPES::HMC5883l) { + // sensor = new HMC5883L_Sensor(sensor_data,sensor_data_size); + } else if (type == SENSOR_TYPES::AS5600_t) { + // sensor = new AS5600_Sensor(sensor_data,sensor_data_size); + } else { + return; + } + + sensor->type = type; + sensor->num = sensor_num; + + sensors[sensor_num] = sensor; + sensors_count++; +} + +void readSensors() { + for (size_t i = 0; i < sensors_count; i++) { + if (sensors[i] == nullptr || sensors[i]->stop) { + continue; // skip if sensor is not initialized or stopped + } + sensors[i]->readSensor(); + } + +} + +#else +// No sensors supported, so we define empty functions +void sensor_new_i(uint8_t command_buffer[], size_t packet_size) {} +void readSensors() {} + +#endif // MAX_SENSORS_COUNT > 0 \ No newline at end of file From 44e3f5b2fcfd031e2689e89a608364b8c99d7fee Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 4 Jul 2025 14:25:33 +0200 Subject: [PATCH 7/9] stylefixes --- include/boards/esp32devkit.hpp | 2 +- include/boards/pico.hpp | 2 +- include/boards/stm32blackpill.hpp | 2 +- include/i2c.hpp | 13 +++--- include/modules.hpp | 11 ++---- include/modules/ssd1306.hpp | 36 ++++++++--------- include/sensors.hpp | 4 +- include/sensors/veml6040.hpp | 66 ++++++++++++++----------------- src/boards/esp32devkit.cpp | 5 +-- src/boards/pico.cpp | 3 +- src/i2c.cpp | 53 +++++++++++++------------ src/main.cpp | 60 +++++++++++++--------------- src/modules.cpp | 62 +++++++++++++++-------------- src/sensors.cpp | 13 +++--- 14 files changed, 159 insertions(+), 173 deletions(-) diff --git a/include/boards/esp32devkit.hpp b/include/boards/esp32devkit.hpp index 607a088..deefe35 100644 --- a/include/boards/esp32devkit.hpp +++ b/include/boards/esp32devkit.hpp @@ -1,8 +1,8 @@ #pragma once #if defined(ARDUINO_ARCH_ESP32) -#include #include +#include // This board does not have a normal list of analog pins #define A1 2047 #define A2 2047 diff --git a/include/boards/pico.hpp b/include/boards/pico.hpp index 66fccba..c61cde7 100644 --- a/include/boards/pico.hpp +++ b/include/boards/pico.hpp @@ -2,7 +2,7 @@ #include // Maybe some more are required, for pico2 and pico1w -#if defined(RASPBERRY_PI_PICO) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || \ +#if defined(RASPBERRY_PI_PICO) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || \ defined(ARDUINO_ARCH_RP2040) #include diff --git a/include/boards/stm32blackpill.hpp b/include/boards/stm32blackpill.hpp index 4152e95..9cfaf5b 100644 --- a/include/boards/stm32blackpill.hpp +++ b/include/boards/stm32blackpill.hpp @@ -3,7 +3,7 @@ #if defined(ARDUINO_ARCH_STM32) && defined(ARDUINO_BLACKPILL_F103C8) const auto A10 = 2047; -const auto A11 = 2047; +const auto A11 = 2047; const auto A12 = 2047; const auto A13 = 2047; const auto A14 = 2047; diff --git a/include/i2c.hpp b/include/i2c.hpp index 7e575c0..3431ab4 100644 --- a/include/i2c.hpp +++ b/include/i2c.hpp @@ -1,6 +1,6 @@ #pragma once -#include #include +#include void i2c_begin(); void i2c_read(); void i2c_write(); @@ -46,10 +46,9 @@ void i2c_write(); // Indicator that no i2c register is being specified in the command #define I2C_NO_REGISTER 254 +extern TwoWire *i2c_buses[I2C_COUNT]; - -extern TwoWire* i2c_buses[I2C_COUNT]; - - -bool write_i2c(int i2c_port, int device_address, const uint8_t* data, size_t length); -bool read_i2c(int i2c_port, int device_address, const uint8_t* registers, size_t register_length, uint8_t* data, size_t data_length); \ No newline at end of file +bool write_i2c(int i2c_port, int device_address, const uint8_t *data, + size_t length); +bool read_i2c(int i2c_port, int device_address, const uint8_t *registers, + size_t register_length, uint8_t *data, size_t data_length); \ No newline at end of file diff --git a/include/modules.hpp b/include/modules.hpp index 6bb8075..6f03485 100644 --- a/include/modules.hpp +++ b/include/modules.hpp @@ -2,17 +2,15 @@ #include #ifndef MAX_MODULES_COUNT #define MAX_MODULES_COUNT 4 // Max number of modules that can be added -#endif // MAX_MODULES_COUNT - +#endif // MAX_MODULES_COUNT #if MAX_MODULES_COUNT > 0 /***********************************************/ /***************MODULES*************************/ -void module_new_i(uint8_t command_buffer[], size_t packet_size); +void module_new_i(uint8_t command_buffer[], size_t packet_size); void module_data_i(uint8_t command_buffer[], size_t packet_size); - enum MODULE_TYPES : uint8_t { // Max 255 modules, but will always fit in a // single byte! PCA9685 = 0, // 16x 12bit PWM @@ -33,13 +31,12 @@ class Module { int num = 0; MODULE_TYPES type = MODULE_TYPES::MAX_MODULES; // called at every loop, only used when needed (Oled update) - virtual void updModule() {}; + virtual void updModule(){}; }; void scan_modules(); void upd_modules(); extern Module *modules[MAX_MODULES_COUNT]; // Array of pointers to modules -extern size_t module_count; // Number of modules in the array - +extern size_t module_count; // Number of modules in the array #include "modules/ssd1306.hpp" // Include the SSD1306 module header diff --git a/include/modules/ssd1306.hpp b/include/modules/ssd1306.hpp index f42271d..434e445 100644 --- a/include/modules/ssd1306.hpp +++ b/include/modules/ssd1306.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include +#include class TmxSSD1306 : public Module { public: TmxSSD1306(uint8_t data[], size_t packet_size) { @@ -9,23 +9,21 @@ class TmxSSD1306 : public Module { type = MODULE_TYPES::TMX_SSD1306; // TODO: this is just for testing the module system. } - void readModule() override { - // probably nothing to read - } - void writeModule(uint8_t data[], size_t size) override { - // // TODO: implement writing to the SSD1306 display - // send_debug_info(30, size); - // send_debug_info(31, data[0]); - if(data[0] == 1) { // test reply on the "booting..." text commands. - uint8_t display_data[32] = { - 1, 10, 10, 1 - }; - - this->publishData(display_data, 4); - } - } - void resetModule() override {} - void updModule() override { - // MAYBE: write a few bytes to the display, or not, depends on lib. + void readModule() override { + // probably nothing to read + } + void writeModule(uint8_t data[], size_t size) override { + // // TODO: implement writing to the SSD1306 display + // send_debug_info(30, size); + // send_debug_info(31, data[0]); + if (data[0] == 1) { // test reply on the "booting..." text commands. + uint8_t display_data[32] = {1, 10, 10, 1}; + + this->publishData(display_data, 4); } + } + void resetModule() override {} + void updModule() override { + // MAYBE: write a few bytes to the display, or not, depends on lib. + } }; \ No newline at end of file diff --git a/include/sensors.hpp b/include/sensors.hpp index e8603c9..9f4522f 100644 --- a/include/sensors.hpp +++ b/include/sensors.hpp @@ -2,8 +2,7 @@ #include #ifndef MAX_SENSORS_COUNT #define MAX_SENSORS_COUNT 4 // Max number of modules that can be added -#endif // MAX_MODULES_COUNT - +#endif // MAX_MODULES_COUNT #if MAX_SENSORS_COUNT > 0 /*****************************************************************************/ @@ -38,7 +37,6 @@ const int SENSORS_MAX_SETTINGS_A = 6; void sensor_new_i(uint8_t command_buffer[], size_t packet_size); void readSensors(); - #else // No sensors supported, so we define empty functions diff --git a/include/sensors/veml6040.hpp b/include/sensors/veml6040.hpp index f8205ff..08465ed 100644 --- a/include/sensors/veml6040.hpp +++ b/include/sensors/veml6040.hpp @@ -14,51 +14,45 @@ class VEML6040_Sensor : public Sensor { } init_sequence(); } - void readSensor() { - if (this->stop) { - return; - } - uint8_t data[8]; - uint8_t sensor_data[2]; - bool ok = true; - size_t data_offset = 0; - for (uint8_t reg = 0x08; reg <= 0x0B; - reg++) { // read the 4 registers and add the data to the full data vector - uint8_t regs[1] = {reg}; - ok &= read_i2c(this->i2c_port, this->i2c_addr, regs, 1, sensor_data, 2); - // Flip the order to make it match the rest. - data[0+data_offset] = sensor_data[1]; - data[1+data_offset] = sensor_data[0]; - data_offset += 2; - } + void readSensor() { + if (this->stop) { + return; + } + uint8_t data[8]; + uint8_t sensor_data[2]; + bool ok = true; + size_t data_offset = 0; + for (uint8_t reg = 0x08; reg <= 0x0B; + reg++) { // read the 4 registers and add the data to the full data + // vector + uint8_t regs[1] = {reg}; + ok &= read_i2c(this->i2c_port, this->i2c_addr, regs, 1, sensor_data, 2); + // Flip the order to make it match the rest. + data[0 + data_offset] = sensor_data[1]; + data[1 + data_offset] = sensor_data[0]; + data_offset += 2; + } - this->writeSensorData(data, 8); - if (!ok) { - this->stop = true; + this->writeSensorData(data, 8); + if (!ok) { + this->stop = true; + } } -} - void resetSensor() {}; + void resetSensor(){}; private: void init_sequence() { uint8_t data[2] = {0, 0x21}; - bool ok = write_i2c(this->i2c_port, this->i2c_addr, - data, 2); - delay(10); - data[1] = 0x20; // 0x20 = 0b0010'0000, 100 time, no stop bit - ok &= write_i2c(this->i2c_port, this->i2c_addr, - data, 2); - if (!ok) { - this->stop = true; - } + bool ok = write_i2c(this->i2c_port, this->i2c_addr, data, 2); + delay(10); + data[1] = 0x20; // 0x20 = 0b0010'0000, 100 time, no stop bit + ok &= write_i2c(this->i2c_port, this->i2c_addr, data, 2); + if (!ok) { + this->stop = true; + } } int i2c_port = 0; int i2c_addr = 0x10; }; - - - - - #endif \ No newline at end of file diff --git a/src/boards/esp32devkit.cpp b/src/boards/esp32devkit.cpp index 4f29c50..d87db32 100644 --- a/src/boards/esp32devkit.cpp +++ b/src/boards/esp32devkit.cpp @@ -1,12 +1,11 @@ #include - #if defined(ARDUINO_ARCH_ESP32) - void hw_init() { +void hw_init() { analogWriteResolution(8); analogReadResolution(10); - Wire1.setPins(SECOND_I2C_PORT_SDA, SECOND_I2C_PORT_SCL); + Wire1.setPins(SECOND_I2C_PORT_SDA, SECOND_I2C_PORT_SCL); } TwoWire Wire2 = Wire1; // Use GPIO 16 and 17 for I2C on ESP32 diff --git a/src/boards/pico.cpp b/src/boards/pico.cpp index 1085811..09d2299 100644 --- a/src/boards/pico.cpp +++ b/src/boards/pico.cpp @@ -1,6 +1,7 @@ #include -#if defined(ARDUINO_RASPBERRY_PI_PICO_2W) || defined(ARDUINO_RASPBERRY_PI_PICO_2) +#if defined(ARDUINO_RASPBERRY_PI_PICO_2W) || \ + defined(ARDUINO_RASPBERRY_PI_PICO_2) TwoWire Wire2(i2c1, SECOND_I2C_PORT_SDA, SECOND_I2C_PORT_SCL); #endif diff --git a/src/i2c.cpp b/src/i2c.cpp index aefbb10..b41f9ad 100644 --- a/src/i2c.cpp +++ b/src/i2c.cpp @@ -1,28 +1,29 @@ #include "i2c.hpp" #include "Telemetrix4Arduino.h" #include "commands.hpp" +#include "config.hpp" #include #include -#include "config.hpp" /*********************************** i2c functions **********************************/ -TwoWire *i2c_buses[I2C_COUNT] = {&Wire, - #if I2C_COUNT > 1 - &Wire2 - #endif - #if I2C_COUNT > 2 - &Wire3 - #endif - // Add more TwoWire instances if needed +TwoWire *i2c_buses[I2C_COUNT] = { + &Wire, +#if I2C_COUNT > 1 + &Wire2 +#endif +#if I2C_COUNT > 2 + &Wire3 +#endif + // Add more TwoWire instances if needed }; void i2c_begin() { - + byte i2c_port = command_buffer[0]; - if(i2c_port >= I2C_COUNT) { + if (i2c_port >= I2C_COUNT) { // Invalid I2C port requested, return without initializing // Serial.println("Invalid I2C port requested"); return; @@ -30,10 +31,10 @@ void i2c_begin() { auto ¤t_i2c_port = *i2c_buses[i2c_port]; // Initialize the I2C port current_i2c_port.begin(); - + #if defined(__AVR_ATmega328P__) - current_i2c_port.setWireTimeout(10, false); - current_i2c_port.clearWireTimeoutFlag(); + current_i2c_port.setWireTimeout(10, false); + current_i2c_port.clearWireTimeoutFlag(); #endif } @@ -51,7 +52,7 @@ void i2c_read() { byte the_register = command_buffer[1]; uint8_t message_id = command_buffer[I2C_READ_MESSAGE_ID]; uint8_t port = command_buffer[I2C_PORT]; - if(port >= I2C_COUNT) { + if (port >= I2C_COUNT) { // Invalid I2C port requested, return without processing // Serial.println("Invalid I2C port requested"); return; @@ -135,12 +136,12 @@ void i2c_write() { // delayMicroseconds(70); } - -bool write_i2c(int i2c_port, int device_address, const uint8_t* data, size_t length) { +bool write_i2c(int i2c_port, int device_address, const uint8_t *data, + size_t length) { if (i2c_port < 0 || i2c_port >= I2C_COUNT) { return false; // Invalid I2C port } - TwoWire* wire = i2c_buses[i2c_port]; + TwoWire *wire = i2c_buses[i2c_port]; if (wire == nullptr) { return false; // I2C bus not initialized } @@ -151,33 +152,33 @@ bool write_i2c(int i2c_port, int device_address, const uint8_t* data, size_t len return wire->endTransmission() == 0; // Return true if successful } - -bool read_i2c(int i2c_port, int device_address, const uint8_t* registers, size_t register_length, uint8_t* data, size_t data_length) { +bool read_i2c(int i2c_port, int device_address, const uint8_t *registers, + size_t register_length, uint8_t *data, size_t data_length) { if (i2c_port < 0 || i2c_port >= I2C_COUNT) { return false; // Invalid I2C port } - TwoWire* wire = i2c_buses[i2c_port]; + TwoWire *wire = i2c_buses[i2c_port]; if (wire == nullptr) { return false; // I2C bus not initialized } - + wire->beginTransmission(device_address); for (size_t i = 0; i < register_length; i++) { wire->write(registers[i]); } - + if (wire->endTransmission() != 0) { return false; // Transmission failed } - + size_t bytesRead = wire->requestFrom(device_address, data_length); if (bytesRead != data_length) { return false; // Not enough data read } - + for (size_t i = 0; i < bytesRead; i++) { data[i] = wire->read(); } - + return true; // Read successful } \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index c06f04f..4b8c9bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,16 +5,16 @@ #include "commands.hpp" #include "config.hpp" #include "i2c.hpp" +#include "modules.hpp" #include #include #include -#include "modules.hpp" #if MAX_SERVOS > 0 #include #endif +#include "sensors.hpp" #include #include -#include "sensors.hpp" // #include /* Copyright (c) 2020 Alan Yorinks All rights reserved. @@ -41,8 +41,6 @@ template void send_message(const uint8_t (&message)[N]); // uncomment out the next line to create a 2nd i2c port - - // This value must be the same as specified when instantiating the // telemetrix client. The client defaults to a value of 1. // This value is used for the client to auto-discover and to @@ -187,16 +185,18 @@ constexpr int get_total_pins_not(const int *pins, int size, int not_value) { : 0; } -constexpr int max_i(int a, int b) { // some board have an old stdlib without constexpr max - return a 0 ? (pins[size - 1] != not_value - ? max_i(get_highest_analog_pin(pins, size - 1, not_value), pins[size - 1]) - : get_highest_analog_pin(pins, size - 1, not_value)) - : 0; +constexpr int get_highest_analog_pin(const int *pins, int size, int not_value) { + return size > 0 + ? (pins[size - 1] != not_value + ? max_i(get_highest_analog_pin(pins, size - 1, not_value), + pins[size - 1]) + : get_highest_analog_pin(pins, size - 1, not_value)) + : 0; } constexpr auto MAX_ANALOG_PINS_SUPPORTED = @@ -205,9 +205,10 @@ constexpr auto MAX_ANALOG_PINS_SUPPORTED = // maximum number of pins supported // some boards (stm32f103) put analog pins in the 0xC0 range // wastes some memory space, but is easier to use. -constexpr auto MAX_PINS_SUPPORTED = max_i( - NUM_DIGITAL_PINS + - MAX_ANALOG_PINS_SUPPORTED, get_highest_analog_pin(analog_read_pins, analog_read_pins_size, 2047)); // probably too high but good enough +constexpr auto MAX_PINS_SUPPORTED = + max_i(NUM_DIGITAL_PINS + MAX_ANALOG_PINS_SUPPORTED, + get_highest_analog_pin(analog_read_pins, analog_read_pins_size, + 2047)); // probably too high but good enough // #define // a descriptor for digital pins struct pin_descriptor { @@ -626,7 +627,7 @@ void enable_all_reports() { // delay(20); } - byte packet_length; +byte packet_length; void get_next_command() { byte command; command_descriptor command_entry; @@ -761,7 +762,7 @@ void scan_sonars() { auto ping = sonars[last_sonar_visited].usonic->ping(); send_debug_info(123, ping); distance = ping / US_ROUNDTRIP_CM; - if(ping == 0) { + if (ping == 0) { distance = 0xFFFE; } if (distance != sonars[last_sonar_visited].last_value || true) { @@ -944,7 +945,7 @@ void setup() { } pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); // turn off the LED - for(auto i = 0; i < 4; i++) { + for (auto i = 0; i < 4; i++) { digitalWrite(LED_BUILTIN, HIGH); delay(100); digitalWrite(LED_BUILTIN, LOW); @@ -965,7 +966,7 @@ void loop() { x++; // send_debug_info(100, x++); // send_debug_info(101, Serial.available()); - digitalWrite(LED_BUILTIN, x%2); + digitalWrite(LED_BUILTIN, x % 2); // Serial.println("Scanning inputs..."); // send_debug_info(10, 10); last_scan += scan_delay; @@ -1008,7 +1009,7 @@ void feature_detection() { } else if (cmd == &set_pin_mode) { report_message[3] = NUM_DIGITAL_PINS; report_message[4] = 10; // analog input resolution - report_message[5] = 8; // PWM resolution + report_message[5] = 8; // PWM resolution report_message[6] = MAX_ANALOG_PINS_SUPPORTED; // report_message[5] = ADC_RESOLUTION; // ADC resolution // report_message[6] = PWM_RESOLUTION; // PWM resolution @@ -1025,7 +1026,7 @@ void feature_detection() { report_message[4] = FIRMWARE_MINOR; } else if (cmd == &get_unique_id) { report_message[3] = 0; // TODO: implement - } else if(cmd == &i2c_begin) { + } else if (cmd == &i2c_begin) { report_message[3] = I2C_COUNT; } } else { @@ -1054,9 +1055,10 @@ void send_message(const uint8_t *message, size_t length) { // delayMicroseconds(10); // } Serial.write((uint8_t)(length)); // send msg len - for (size_t i = 0; i < length; i++) { + for (size_t i = 0; i < length; i++) { Serial.write((uint8_t)message[i]); // send msg len - }} + } +} void get_unique_id() { // in message: [GET_UNIQUE_ID = 6] @@ -1112,14 +1114,8 @@ void ping() { } } -void module_new() { - module_new_i(command_buffer, packet_length); -} +void module_new() { module_new_i(command_buffer, packet_length); } -void module_data() { - module_data_i(command_buffer, packet_length); -} +void module_data() { module_data_i(command_buffer, packet_length); } -void sensor_new() { - sensor_new_i(command_buffer, packet_length); -} \ No newline at end of file +void sensor_new() { sensor_new_i(command_buffer, packet_length); } \ No newline at end of file diff --git a/src/modules.cpp b/src/modules.cpp index 8c94b5c..f17a95c 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -1,14 +1,14 @@ #include "modules.hpp" -#include "main.hpp" #include "commands.hpp" +#include "main.hpp" -typedef Module * (*ModuleFunc)(uint8_t[], size_t); +typedef Module *(*ModuleFunc)(uint8_t[], size_t); -Module * create_ssd1306_module(uint8_t data[], size_t packet_size) { +Module *create_ssd1306_module(uint8_t data[], size_t packet_size) { return new TmxSSD1306(data, packet_size); } -size_t module_count = 0; // Initialize module count +size_t module_count = 0; // Initialize module count Module *modules[MAX_MODULES_COUNT] = {nullptr}; // Array of pointers to modules void module_new_i(uint8_t command_buffer[], size_t packet_size) { @@ -17,22 +17,26 @@ void module_new_i(uint8_t command_buffer[], size_t packet_size) { send_debug_info(10, msg_type); send_debug_info(11, packet_size); send_debug_info(12, command_buffer[1]); - const ModuleFunc module_funcs[] = - { - nullptr, // {MODULE_TYPES::PCA9685, [](std::vector& data) { return new PCA9685_Module(data); }}, - nullptr,// {MODULE_TYPES::HIWONDER_SERVO, []( std::vector& data) { return new Hiwonder_Servo(data); }}, - nullptr,// {MODULE_TYPES::SHUTDOWN_RELAY, [](const std::vector& data) { return nullptr; /* not implemented */ }}, - create_ssd1306_module, // {MODULE_TYPES::TMX_SSD1306, create_ssd1306_module}, - }; -if(module_count >= MAX_MODULES_COUNT) { + const ModuleFunc module_funcs[] = { + nullptr, // {MODULE_TYPES::PCA9685, [](std::vector& data) { + // return new PCA9685_Module(data); }}, + nullptr, // {MODULE_TYPES::HIWONDER_SERVO, []( std::vector& + // data) { return new Hiwonder_Servo(data); }}, + nullptr, // {MODULE_TYPES::SHUTDOWN_RELAY, [](const std::vector& + // data) { return nullptr; /* not implemented */ }}, + create_ssd1306_module, // {MODULE_TYPES::TMX_SSD1306, + // create_ssd1306_module}, + }; + if (module_count >= MAX_MODULES_COUNT) { return; // no more modules can be added } - if(msg_type==1) { + if (msg_type == 1) { const MODULE_TYPES type = (MODULE_TYPES)command_buffer[2]; const uint8_t module_num = command_buffer[1]; // std::vector data; - - // data.insert(data.end(), &command_buffer[4], &command_buffer[packet_size]); + + // data.insert(data.end(), &command_buffer[4], + // &command_buffer[packet_size]); if (type >= MODULE_TYPES::MAX_MODULES) { return; @@ -54,13 +58,13 @@ if(module_count >= MAX_MODULES_COUNT) { if (func == nullptr) { return; // module type not supported } - module = func(command_buffer+3, packet_size-3); + module = func(command_buffer + 3, packet_size - 3); module->type = type; module->num = module_num; modules[module_num] = module; module_count++; - } else if(msg_type==0) { // check module type feature detection + } else if (msg_type == 0) { // check module type feature detection bool found = false; const uint8_t module_type_target = command_buffer[1]; send_debug_info(0, module_type_target); @@ -69,11 +73,11 @@ if(module_count >= MAX_MODULES_COUNT) { send_debug_info(1, found ? 1 : 0); } uint8_t message[4] = { - MODULE_MAIN_REPORT, // message type - 0, // feature check - module_type_target, // module type - (uint8_t)(found ? 1u : 0u) // found or not - }; + MODULE_MAIN_REPORT, // message type + 0, // feature check + module_type_target, // module type + (uint8_t)(found ? 1u : 0u) // found or not + }; send_message(message, 4); } } @@ -83,23 +87,23 @@ void module_data_i(uint8_t command_buffer[], size_t packet_size) { if (module_num > module_count || module_num >= MAX_MODULES_COUNT) { return; } -// std::vector data; -// data.insert(data.end(), &command_buffer[2], &command_buffer[packet_size]); - modules[module_num]->writeModule(command_buffer+1, packet_size-1); + // std::vector data; + // data.insert(data.end(), &command_buffer[2], + // &command_buffer[packet_size]); + modules[module_num]->writeModule(command_buffer + 1, packet_size - 1); } - void Module::publishData(const uint8_t data[], size_t size) { uint8_t out[30] = { - // 0, // write len + // 0, // write len MODULE_REPORT, // write type (uint8_t)this->num, // write num this->type, // write sensor type }; - for(size_t i = 0; i < size && i < sizeof(out) - 4; i++) { + for (size_t i = 0; i < size && i < sizeof(out) - 4; i++) { out[i + 3] = data[i]; // copy data to the output buffer } - + send_message(out, size + 4); // send the message with the data // TODO: check dit } diff --git a/src/sensors.cpp b/src/sensors.cpp index 44cb2b7..4b7282f 100644 --- a/src/sensors.cpp +++ b/src/sensors.cpp @@ -1,8 +1,8 @@ #include "sensors.hpp" #if MAX_SENSORS_COUNT > 0 -#include "sensors/veml6040.hpp" // Include the VEML6040 -#include "main.hpp" #include "commands.hpp" +#include "main.hpp" +#include "sensors/veml6040.hpp" // Include the VEML6040 void Sensor::writeSensorData(const uint8_t data[], size_t size) { uint8_t out[30] = { @@ -10,18 +10,18 @@ void Sensor::writeSensorData(const uint8_t data[], size_t size) { (uint8_t)this->num, // write num this->type, // write sensor type }; - for(size_t i = 0; i < size && i < sizeof(out) - 3; i++) { + for (size_t i = 0; i < size && i < sizeof(out) - 3; i++) { out[i + 3] = data[i]; // copy data to the output buffer } - send_message(out, size+3); + send_message(out, size + 3); } Sensor *sensors[MAX_SENSORS_COUNT] = {}; // Array of pointers to sensors -size_t sensors_count = 0; // Number of sensors in the array +size_t sensors_count = 0; // Number of sensors in the array void sensor_new_i(uint8_t command_buffer[], size_t packet_size) { const SENSOR_TYPES type = (SENSOR_TYPES)command_buffer[1]; const uint8_t sensor_num = command_buffer[0]; - uint8_t* sensor_data = command_buffer + 2; // data starts after type and num + uint8_t *sensor_data = command_buffer + 2; // data starts after type and num size_t sensor_data_size = packet_size - 2; // size of the data if (type >= SENSOR_TYPES::MAX_SENSORS) { return; @@ -59,7 +59,6 @@ void readSensors() { } sensors[i]->readSensor(); } - } #else From e486636cd1075bcc764ae602e8127e8225faf97f Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 18 Jul 2025 11:45:59 +0200 Subject: [PATCH 8/9] Fix sensors for feature detecting --- README.md | 20 --------- include/commands.hpp | 1 + include/sensors.hpp | 5 +++ include/sensors/veml6040.hpp | 11 ++++- src/main.cpp | 3 +- src/modules.cpp | 21 ++------- src/sensors.cpp | 85 ++++++++++++++++++++++++------------ 7 files changed, 76 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 15b4e6f..6becf63 100644 --- a/README.md +++ b/README.md @@ -270,23 +270,3 @@ time in ms. ```py [ 2, 0, enabled] ``` - - - - -# TODO: -Check (done with pico arduino): -- sonar βœ…, TODO: no value -- servoβœ… -- motor driver -- analog inβœ… -- analog out TODO: geen pins lijst ofzo, gewoon alles ok doenβœ… -- intensity sensβœ… -- keypadβœ… -- encoders, single -- (modules?) -- i2c todo! - - -# TODO: -- check with pico code \ No newline at end of file diff --git a/include/commands.hpp b/include/commands.hpp index feeacb2..8b285ab 100644 --- a/include/commands.hpp +++ b/include/commands.hpp @@ -55,6 +55,7 @@ enum MESSAGE_OUT_TYPE : uint8_t { ENCODER_REPORT = 14, DEBUG_PRINT = 99, SENSOR_REPORT = 20, + SENSOR_MAIN_REPORT = 21, PONG_REPORT = 32, MODULE_MAIN_REPORT = 33, MODULE_REPORT = 34, diff --git a/include/sensors.hpp b/include/sensors.hpp index 9f4522f..3ffc56a 100644 --- a/include/sensors.hpp +++ b/include/sensors.hpp @@ -29,6 +29,11 @@ class Sensor { virtual void resetSensor() = 0; bool stop = false; void writeSensorData(const uint8_t data[], size_t size); + static Sensor *create(uint8_t *data, size_t size) { + // This function is used to create a sensor object based on the type + // and data provided. It should be overridden in derived classes. + return nullptr; + } int num; SENSOR_TYPES type = SENSOR_TYPES::MAX_SENSORS; }; diff --git a/include/sensors/veml6040.hpp b/include/sensors/veml6040.hpp index 08465ed..f318743 100644 --- a/include/sensors/veml6040.hpp +++ b/include/sensors/veml6040.hpp @@ -12,6 +12,7 @@ class VEML6040_Sensor : public Sensor { if (settings_size > 0) { i2c_port = settings[0]; // Assuming first byte is I2C port } + this->i2c_addr = 0x10; // Default I2C address for VEML6040 init_sequence(); } void readSensor() { @@ -39,14 +40,22 @@ class VEML6040_Sensor : public Sensor { } } void resetSensor(){}; + static Sensor *create(uint8_t *data, size_t size) { + if (size < 1) { + return nullptr; // Not enough data to create sensor + } + return new VEML6040_Sensor(data, size); + } private: void init_sequence() { uint8_t data[2] = {0, 0x21}; bool ok = write_i2c(this->i2c_port, this->i2c_addr, data, 2); - delay(10); + // send_debug_info(181, ok); + delayMicroseconds(100); data[1] = 0x20; // 0x20 = 0b0010'0000, 100 time, no stop bit ok &= write_i2c(this->i2c_port, this->i2c_addr, data, 2); + // send_debug_info(182, ok); if (!ok) { this->stop = true; } diff --git a/src/main.cpp b/src/main.cpp index 4b8c9bf..22b360c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -760,7 +760,6 @@ void scan_sonars() { // send_debug_info(10, sonar_current_millis); sonar_previous_millis += sonar_scan_interval; auto ping = sonars[last_sonar_visited].usonic->ping(); - send_debug_info(123, ping); distance = ping / US_ROUNDTRIP_CM; if (ping == 0) { distance = 0xFFFE; @@ -958,6 +957,7 @@ void loop() { // keep processing incoming commands get_next_command(); upd_modules(); + readSensors(); static decltype(millis()) last_scan = 0; static decltype(millis()) scan_delay = 10; if (!stop_reports) { // stop reporting @@ -1100,7 +1100,6 @@ void ping() { special_num, random, 0, 0, 0, 0}; // out[0] = out.size() - 1; // dont count the packet length // send_debug_info(1, special_num); - // send_debug_info(2, random); // // Serial2.println("Pinging..."); send_message(out); diff --git a/src/modules.cpp b/src/modules.cpp index f17a95c..d0967a9 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -14,9 +14,6 @@ Module *modules[MAX_MODULES_COUNT] = {nullptr}; // Array of pointers to modules void module_new_i(uint8_t command_buffer[], size_t packet_size) { const auto msg_type = command_buffer[0]; - send_debug_info(10, msg_type); - send_debug_info(11, packet_size); - send_debug_info(12, command_buffer[1]); const ModuleFunc module_funcs[] = { nullptr, // {MODULE_TYPES::PCA9685, [](std::vector& data) { // return new PCA9685_Module(data); }}, @@ -42,21 +39,11 @@ void module_new_i(uint8_t command_buffer[], size_t packet_size) { return; } Module *module = nullptr; - // if (type == MODULE_TYPES::PCA9685) { - // module = new PCA9685_Module(data); - // } else if (type == MODULE_TYPES::HIWONDER_SERVO) { - // module = new Hiwonder_Servo(data); - // } else if (type == MODULE_TYPES::SHUTDOWN_RELAY) { - // return; // not implemented - // // module = new Shutdown_Relay(data); - // } else if (type == MODULE_TYPES::TMX_SSD1306) { - // module = new TmxSSD1306(data); - // } else { - // return; - // } auto func = module_funcs[type]; if (func == nullptr) { - return; // module type not supported + module_count++; // Just increment counter, to keep the same index on mcu + // and computer. + return; // module type not supported } module = func(command_buffer + 3, packet_size - 3); module->type = type; @@ -67,10 +54,8 @@ void module_new_i(uint8_t command_buffer[], size_t packet_size) { } else if (msg_type == 0) { // check module type feature detection bool found = false; const uint8_t module_type_target = command_buffer[1]; - send_debug_info(0, module_type_target); if (module_type_target < MODULE_TYPES::MAX_MODULES) { found = (module_funcs[module_type_target] != nullptr); - send_debug_info(1, found ? 1 : 0); } uint8_t message[4] = { MODULE_MAIN_REPORT, // message type diff --git a/src/sensors.cpp b/src/sensors.cpp index 4b7282f..e5f6bb4 100644 --- a/src/sensors.cpp +++ b/src/sensors.cpp @@ -18,38 +18,65 @@ void Sensor::writeSensorData(const uint8_t data[], size_t size) { Sensor *sensors[MAX_SENSORS_COUNT] = {}; // Array of pointers to sensors size_t sensors_count = 0; // Number of sensors in the array +typedef Sensor *(*SensorFunc)(uint8_t[], size_t); + +SensorFunc sensor_funcs[] = { + nullptr, // 0 - GPS + nullptr, // 1 - LOAD_CELL + nullptr, // 2 - MPU_9250 + nullptr, // 3 - TOF_VL53 + VEML6040_Sensor::create, // 4 - VEML6040 + nullptr, // 5 - ADXL345 + nullptr, // 6 - INA226a + nullptr, // 7 - HMC5883l + nullptr, // 8 - AS5600_t +}; + void sensor_new_i(uint8_t command_buffer[], size_t packet_size) { - const SENSOR_TYPES type = (SENSOR_TYPES)command_buffer[1]; - const uint8_t sensor_num = command_buffer[0]; - uint8_t *sensor_data = command_buffer + 2; // data starts after type and num - size_t sensor_data_size = packet_size - 2; // size of the data - if (type >= SENSOR_TYPES::MAX_SENSORS) { - return; - } - Sensor *sensor = nullptr; - if (type == SENSOR_TYPES::VEML6040) { - sensor = new VEML6040_Sensor(sensor_data, sensor_data_size); - } else if (type == SENSOR_TYPES::TOF_VL53) { - // sensor = new VL53L0X_Sensor(sensor_data,sensor_data_size); - } else if (type == SENSOR_TYPES::MPU_9250) { - // sensor = new MPU9250_Sensor(sensor_data,sensor_data_size); - } else if (type == SENSOR_TYPES::LOAD_CELL) { - // sensor = new HX711_Sensor(sensor_data,sensor_data_size); - } else if (type == SENSOR_TYPES::INA226a) { - // sensor = new INA226_Sensor(sensor_data,sensor_data_size); - } else if (type == SENSOR_TYPES::HMC5883l) { - // sensor = new HMC5883L_Sensor(sensor_data,sensor_data_size); - } else if (type == SENSOR_TYPES::AS5600_t) { - // sensor = new AS5600_Sensor(sensor_data,sensor_data_size); - } else { - return; - } + const uint8_t sensor_cmd = command_buffer[0]; - sensor->type = type; - sensor->num = sensor_num; + if (sensor_cmd == 1) { + const SENSOR_TYPES type = (SENSOR_TYPES)command_buffer[2]; + const uint8_t sensor_num = command_buffer[1]; - sensors[sensor_num] = sensor; - sensors_count++; + uint8_t *sensor_data = command_buffer + 3; // data starts after type and num + size_t sensor_data_size = packet_size - 3; // size of the data + if (type >= SENSOR_TYPES::MAX_SENSORS) { + return; + } + Sensor *sensor = nullptr; + if (sensor_funcs[type] != nullptr) { + sensor = sensor_funcs[type](sensor_data, sensor_data_size); + if (sensor == nullptr) { + // If sensor creation failed, we just increment the count and return + sensors_count++; + return; + } + } else { + sensors_count++; // Just increment counter, to keep the same index on mcu + // and computer. + return; + } + sensor->type = type; + sensor->num = sensor_num; + + sensors[sensor_num] = sensor; + sensors_count++; + } else if (sensor_cmd == 0) { + // This is a feature detection command, check if the sensor type is + // supported + const SENSOR_TYPES type = (SENSOR_TYPES)command_buffer[1]; + uint8_t found = + (type < SENSOR_TYPES::MAX_SENSORS && sensor_funcs[type] != nullptr); + + uint8_t message[4] = { + SENSOR_MAIN_REPORT, // message type + 0, // feature check + (uint8_t)type, // sensor type + found // found or not + }; + send_message(message, 4); + } } void readSensors() { From 46c7707b8da383fbd05bc3d3c673331931d6b6b0 Mon Sep 17 00:00:00 2001 From: Arend-Jan van Hilten Date: Fri, 18 Jul 2025 11:47:56 +0200 Subject: [PATCH 9/9] build on all pull requests --- .github/workflows/build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e09c12a..a604d88 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,8 +3,6 @@ name: Arduino Compile on: push: pull_request: - branches: - - main jobs: build: