README.md
This commit is contained in:
+46
-46
@@ -1,46 +1,46 @@
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
|
||||
#include "pins.h"
|
||||
|
||||
#if defined(DEVICE_ROLE_BOAT)
|
||||
constexpr const char *deviceRole = "boat";
|
||||
#elif defined(DEVICE_ROLE_REMOTE)
|
||||
constexpr const char *deviceRole = "remote";
|
||||
#else
|
||||
#error "Select DEVICE_ROLE_BOAT or DEVICE_ROLE_REMOTE in platformio.ini"
|
||||
#endif
|
||||
|
||||
#if defined(NETWORK_MODE_MQTT)
|
||||
constexpr const char *networkMode = "mqtt";
|
||||
#elif defined(NETWORK_MODE_AP)
|
||||
constexpr const char *networkMode = "ap";
|
||||
#else
|
||||
#error "Select NETWORK_MODE_MQTT or NETWORK_MODE_AP in platformio.ini"
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(100);
|
||||
|
||||
pinMode(Pins::batteryVoltage, INPUT);
|
||||
|
||||
#if defined(DEVICE_ROLE_BOAT)
|
||||
pinMode(Pins::motorLeftForward, OUTPUT);
|
||||
pinMode(Pins::motorLeftReverse, OUTPUT);
|
||||
pinMode(Pins::motorRightForward, OUTPUT);
|
||||
pinMode(Pins::motorRightReverse, OUTPUT);
|
||||
pinMode(Pins::rudderServo, OUTPUT);
|
||||
#else
|
||||
pinMode(Pins::hallRudderSignal, INPUT);
|
||||
#endif
|
||||
|
||||
Serial.printf("Stid maritime: role=%s, mode=%s, chip=%06X\n",
|
||||
deviceRole, networkMode, ESP.getChipId());
|
||||
Serial.println("Firmware skeleton ready; motors remain stopped.");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Keep the initial firmware passive until the command and failsafe layers exist.
|
||||
delay(1000);
|
||||
}
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
|
||||
#include "pins.h"
|
||||
|
||||
#if defined(DEVICE_ROLE_BOAT)
|
||||
constexpr const char *deviceRole = "boat";
|
||||
#elif defined(DEVICE_ROLE_REMOTE)
|
||||
constexpr const char *deviceRole = "remote";
|
||||
#else
|
||||
#error "Select DEVICE_ROLE_BOAT or DEVICE_ROLE_REMOTE in platformio.ini"
|
||||
#endif
|
||||
|
||||
#if defined(NETWORK_MODE_MQTT)
|
||||
constexpr const char *networkMode = "mqtt";
|
||||
#elif defined(NETWORK_MODE_AP)
|
||||
constexpr const char *networkMode = "ap";
|
||||
#else
|
||||
#error "Select NETWORK_MODE_MQTT or NETWORK_MODE_AP in platformio.ini"
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(100);
|
||||
|
||||
pinMode(Pins::batteryVoltage, INPUT);
|
||||
|
||||
#if defined(DEVICE_ROLE_BOAT)
|
||||
pinMode(Pins::motorLeftForward, OUTPUT);
|
||||
pinMode(Pins::motorLeftReverse, OUTPUT);
|
||||
pinMode(Pins::motorRightForward, OUTPUT);
|
||||
pinMode(Pins::motorRightReverse, OUTPUT);
|
||||
pinMode(Pins::rudderServo, OUTPUT);
|
||||
#else
|
||||
pinMode(Pins::hallRudderSignal, INPUT);
|
||||
#endif
|
||||
|
||||
Serial.printf("Stid maritime: role=%s, mode=%s, chip=%06X\n",
|
||||
deviceRole, networkMode, ESP.getChipId());
|
||||
Serial.println("Firmware skeleton ready; motors remain stopped.");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Keep the initial firmware passive until the command and failsafe layers exist.
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user