From 97df71b9a64a6c8aaf6972eb81d7e8c54583a371 Mon Sep 17 00:00:00 2001 From: Amerlander Date: Thu, 14 Sep 2023 10:17:10 +0200 Subject: [PATCH 1/3] update MicroBitIO files --- model/MicroBitIO.cpp | 2 +- model/MicroBitIO.h | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/model/MicroBitIO.cpp b/model/MicroBitIO.cpp index 6b52dc0a..373659cd 100644 --- a/model/MicroBitIO.cpp +++ b/model/MicroBitIO.cpp @@ -109,7 +109,7 @@ MicroBitIO::MicroBitIO(NRF52ADC &a, TouchSensor &s) : buttonB(P11), face(logo) { - pins = 33; + pins = 41; NRF52Pin::adc = &a; NRF52Pin::touchSensor = &s; diff --git a/model/MicroBitIO.h b/model/MicroBitIO.h index 2b348910..de5d343c 100644 --- a/model/MicroBitIO.h +++ b/model/MicroBitIO.h @@ -410,29 +410,16 @@ namespace codal NRF52Pin P13; // P0_17 NRF52Pin P14; // P0_01 NRF52Pin P15; // P0_13 - NRF52Pin P18; // P0_31 ///NRF52Pin P16; // P1_02 //[Calliope] connect Grove Analog PIN (P0_29) : DELETE COMMENT NRF52Pin A1RX; ///NRF52Pin P17; // //[Calliope] P1_02 NRF52Pin A1TX; + NRF52Pin P18; // P0_31 ///NRF52Pin P19; // P0_26 NRF52Pin A0SCL; ///NRF52Pin P20; // P1_00 //[Calliope] Place holder for micro:bit pin P3 (P0_31) : DELETE COMMENT NRF52Pin A0SDA; - - //Calliope mini3 - NRF52Pin RGB; // RGBLED P0_07 - NRF52Pin M_A_IN1; // Motor A IN1 P1_01 - NRF52Pin M_A_IN2; // Motor A IN2 P0_27 - NRF52Pin M_B_IN1; // Motor B IN1 P1_07 - NRF52Pin M_B_IN2; // Motor B IN2 P1_09 - NRF52Pin M_MODE; // Motor Mode P1_06 - //NRF52Pin PAD3; // PAD 3 P1_03 - //NRF52Pin GA0; // Grove Analog P0_29 - - - - + // Other exposed pins NRF52Pin logo; // P1_04 @@ -452,6 +439,16 @@ namespace codal NRF52Pin usbRx; NRF52Pin irq1; // P0_25 + //Calliope mini3 + NRF52Pin RGB; // RGBLED P0_07 + NRF52Pin M_A_IN1; // Motor A IN1 P1_01 + NRF52Pin M_A_IN2; // Motor A IN2 P0_27 + NRF52Pin M_B_IN1; // Motor B IN1 P1_07 + NRF52Pin M_B_IN2; // Motor B IN2 P1_09 + NRF52Pin M_MODE; // Motor Mode P1_06 + //NRF52Pin PAD3; // PAD 3 P1_03 + //NRF52Pin GA0; // Grove Analog P0_29 + // Aliases NRF52Pin& col1; NRF52Pin& col2; From b2591d16e8dd2da6940d85271525086ecd94a787 Mon Sep 17 00:00:00 2001 From: Amerlander Date: Thu, 14 Sep 2023 11:55:02 +0200 Subject: [PATCH 2/3] turn off rgb leds --- model/MicroBit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/MicroBit.cpp b/model/MicroBit.cpp index a17415ae..c169565d 100644 --- a/model/MicroBit.cpp +++ b/model/MicroBit.cpp @@ -179,7 +179,8 @@ int MicroBit::init() } // turn RGB LEDs off - neopixel_send_buffer(uBit.io.RGB, (uint8_t[]){0, 0, 0, 0, 0, 0, 0, 0, 0}, 9); + // neopixel_send_buffer(uBit.io.RGB, (uint8_t[]){0, 0, 0, 0, 0, 0, 0, 0, 0}, 9); + uBit.io.RGB.setDigitalValue(0); #if CONFIG_ENABLED(DEVICE_BLE) // Ensure BLE bootloader settings are up to date. From 70221e65f574c9e1d98258f87dfd879a058a3fa0 Mon Sep 17 00:00:00 2001 From: Amerlander Date: Thu, 14 Sep 2023 12:03:59 +0200 Subject: [PATCH 3/3] turn off rgbleds 2 --- model/MicroBit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/MicroBit.cpp b/model/MicroBit.cpp index c169565d..60490982 100644 --- a/model/MicroBit.cpp +++ b/model/MicroBit.cpp @@ -179,8 +179,9 @@ int MicroBit::init() } // turn RGB LEDs off - // neopixel_send_buffer(uBit.io.RGB, (uint8_t[]){0, 0, 0, 0, 0, 0, 0, 0, 0}, 9); - uBit.io.RGB.setDigitalValue(0); + uint8_t rgbBuffer[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; + neopixel_send_buffer(io.RGB, rgbBuffer, sizeof(rgbBuffer)); + // io.RGB.setDigitalValue(0); #if CONFIG_ENABLED(DEVICE_BLE) // Ensure BLE bootloader settings are up to date.