Skip to content

Commit

Permalink
fix: all examples in GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Mar 5, 2024
1 parent 0d872b9 commit c2a5aba
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ jobs:
strategy:
matrix:
example:
- examples/motors
- battery
- buzzer
- leds
- motorDriveToPosition
- motorPower
- motors
- mpu
- oled
- readEncoderPosition
- stupidServos
- ultrasoundBasic
- ultrasoundLeds
steps:
- uses: actions/checkout@v1
- name: Set up Python
Expand All @@ -20,4 +31,4 @@ jobs:
- name: Build examples
run: platformio ci --lib="." --project-conf="./platformio.ini"
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
PLATFORMIO_CI_SRC: examples/${{ matrix.example }}
10 changes: 8 additions & 2 deletions examples/mpu/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ void setup() {
auto& mpu = rb::Manager::get().mpu();

mpu.init();

// sets the 0 positions to current RBCX orientation
mpu.calibrateNow();
delay(1000);

mpu.sendStart();

while (true) {
printf("MPU - angle: X: %2.2f Y: %2.2f Z: %2.2f\n", mpu.getAngleX(), mpu.getAngleY(), mpu.getAngleZ());
auto angle = mpu.getAngle();
printf("MPU - angle: X: %2.2f Y: %2.2f Z: %2.2f\n", angle.x, angle.y, angle.z);
delay(100);
}

}

void loop() {}
void loop() {}
4 changes: 2 additions & 2 deletions examples/oled/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void setup() {

oled.setCursor(5, oled.getHeight()/2);
String text = "OLED w:" + String(oled.getWidth()) + " | h:" + String(oled.getHeight());
oled.writeString(text, rb::Oled::Font_7x10, rb::Oled::White);
oled.writeString(text.c_str(), rb::Oled::Font_7x10, rb::Oled::White);
oled.updateScreen();
waitToNextTest();

Expand Down Expand Up @@ -95,4 +95,4 @@ void setup() {
}
}

void loop() {}
void loop() {}
3 changes: 1 addition & 2 deletions src/RBCXMpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "rbcx.pb.h"


namespace rb {

struct MpuVector {
Expand Down Expand Up @@ -82,7 +81,7 @@ class Mpu {
/**
* @brief Restores calibration data previously obtained from calibrateNow callback
*/
void restoreCalibrationData(const uint8_t *data, size_t length);
void restoreCalibrationData(const uint8_t* data, size_t length);

/**
* @brief Restores calibration data previously obtained from calibrateNow callback
Expand Down

0 comments on commit c2a5aba

Please sign in to comment.