GPIO15 als Pullup für Relaiseingang
Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (push) Has been cancelled
PR Build Check / build (Heltec_v3_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (Heltec_v3_repeater) (push) Has been cancelled
PR Build Check / build (Heltec_v3_room_server) (push) Has been cancelled
PR Build Check / build (LilyGo_Tlora_C6_repeater_) (push) Has been cancelled
PR Build Check / build (PicoW_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (RAK_4631_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_room_server) (push) Has been cancelled
PR Build Check / build (wio-e5-mini_repeater) (push) Has been cancelled
Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (push) Has been cancelled
PR Build Check / build (Heltec_v3_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (Heltec_v3_repeater) (push) Has been cancelled
PR Build Check / build (Heltec_v3_room_server) (push) Has been cancelled
PR Build Check / build (LilyGo_Tlora_C6_repeater_) (push) Has been cancelled
PR Build Check / build (PicoW_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (RAK_4631_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_room_server) (push) Has been cancelled
PR Build Check / build (wio-e5-mini_repeater) (push) Has been cancelled
This commit is contained in:
@@ -451,7 +451,16 @@ void SensorMesh::handleCommand(uint32_t sender_timestamp, char* command, char* r
|
||||
} else {
|
||||
strcpy(reply, "Err - invalid pin");
|
||||
}
|
||||
} else{
|
||||
} else if (memcmp(command, "bin", 3) == 0) {
|
||||
uint32_t gpio_state = board.getGpio(); // 32-Bit-GPIO-Zustand auslesen
|
||||
// Initialisiere reply mit Nullen, um sicherzustellen, dass es sauber ist
|
||||
memset(reply, 0, 33); // 32 Zeichen + Null-Terminator
|
||||
// Binärstring erstellen (Bit 31 bis Bit 0)
|
||||
for (int i = 0; i < 32; i++) {
|
||||
reply[31 - i] = (gpio_state & (1 << i)) ? '1' : '0';
|
||||
}
|
||||
reply[32] = '\0'; // Null-Terminator explizit setzen
|
||||
} else {
|
||||
_cli.handleCommand(sender_timestamp, command, reply); // common CLI commands
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef FIRMWARE_VERSION
|
||||
#define FIRMWARE_VERSION "v1.14.1"
|
||||
#define FIRMWARE_VERSION "v1.15.1"
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_ROLE "sensor"
|
||||
|
||||
@@ -61,7 +61,7 @@ void setup() {
|
||||
#ifdef DISPLAY_CLASS
|
||||
if (display.begin()) {
|
||||
display.startFrame();
|
||||
display.print("Please wait...");
|
||||
display.print("AOI Firmware! Bitte warten...");
|
||||
display.endFrame();
|
||||
}
|
||||
#endif
|
||||
@@ -102,8 +102,8 @@ void setup() {
|
||||
|
||||
command[0] = 0;
|
||||
|
||||
// Konfiguriere GPIO 2 als Eingang mit Pull-Up
|
||||
pinMode(2, INPUT_PULLUP);
|
||||
// Konfiguriere GPIO 15 als Eingang mit Pull-Up
|
||||
pinMode(15, INPUT_PULLUP);
|
||||
|
||||
sensors.begin();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user