mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
havent started yet
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
create_2_Open_Interface_Spec.pdf
|
||||
create_2_Open_Interface_Spec.txt
|
||||
|
||||
|
||||
|
||||
|
||||
.node_modules
|
||||
.pio
|
||||
.vscode
|
||||
@@ -1,3 +1,13 @@
|
||||
# Multi Roomba Rover
|
||||
|
||||
a remake of my RoombaRover project with a decentralized and embedded approach
|
||||
|
||||
on each roomba:
|
||||
- an esp32
|
||||
- a level shifter
|
||||
- a power supply
|
||||
- an openIPC camera
|
||||
- USB wifi card
|
||||
- microphone
|
||||
- speaker
|
||||
- MAYBE a master relay which can be turned off programatically
|
||||
@@ -0,0 +1,24 @@
|
||||
# notes and ideas
|
||||
|
||||
## frontend
|
||||
|
||||
each frontend module will have a JSON state update over socket.io
|
||||
each module will export a function to update it's state
|
||||
|
||||
use these functions to update all modules on connect, from a UI init state event.
|
||||
this event will be sent all of the module data at once, in JSON
|
||||
|
||||
split each JSON element to the UI element functions
|
||||
|
||||
|
||||
## esp-server comms
|
||||
|
||||
the ESP will report to the server when it connects:
|
||||
|
||||
rover's name
|
||||
enable / disable for each motor
|
||||
camera IP address
|
||||
battery info (for different battery behaviors):
|
||||
full number
|
||||
warn number
|
||||
urgent number
|
||||
@@ -0,0 +1,9 @@
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
framework = arduino
|
||||
monitor_speed = 115200
|
||||
|
||||
; Enable verbose FreeRTOS symbols in Arduino builds (optional but handy for demos)
|
||||
build_flags =
|
||||
-DCORE_DEBUG_LEVEL=3
|
||||
@@ -0,0 +1,59 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
// Use two GPIOs with onboard-friendly defaults; adjust to match your dev kit.
|
||||
constexpr gpio_num_t LED1_PIN = GPIO_NUM_2; // Often labeled "LED_BUILTIN".
|
||||
constexpr gpio_num_t LED2_PIN = GPIO_NUM_4;
|
||||
|
||||
constexpr TickType_t LED1_DELAY = pdMS_TO_TICKS(250); // 4 Hz blink.
|
||||
constexpr TickType_t LED2_DELAY = pdMS_TO_TICKS(700); // ~1.4 Hz blink.
|
||||
|
||||
// FreeRTOS tasks must have C linkage-compatible signatures.
|
||||
void ledTask(void *parameter) {
|
||||
const gpio_num_t pin = static_cast<gpio_num_t>(reinterpret_cast<intptr_t>(parameter));
|
||||
const TickType_t delay = (pin == LED1_PIN) ? LED1_DELAY : LED2_DELAY;
|
||||
|
||||
pinMode(pin, OUTPUT);
|
||||
|
||||
// Align the first toggle with system tick so the cadence stays consistent.
|
||||
TickType_t nextWake = xTaskGetTickCount();
|
||||
|
||||
bool state = false;
|
||||
while (true) {
|
||||
digitalWrite(pin, state ? HIGH : LOW);
|
||||
state = !state;
|
||||
|
||||
// vTaskDelayUntil keeps a steady period even if the loop body jitters.
|
||||
vTaskDelayUntil(&nextWake, delay);
|
||||
}
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial && millis() < 3000) {
|
||||
// Give USB CDC boards a moment to enumerate; safe to ignore for pure UART boards.
|
||||
delay(10);
|
||||
}
|
||||
Serial.println("FreeRTOS dual LED blink demo starting up...");
|
||||
|
||||
// The Arduino core already starts the scheduler after setup() returns.
|
||||
xTaskCreate(
|
||||
ledTask, // Task function.
|
||||
"LED1", // Label (shows up in diagnostics).
|
||||
2048, // Stack size in words.
|
||||
reinterpret_cast<void *>(static_cast<intptr_t>(LED1_PIN)),
|
||||
1, // Priority.
|
||||
nullptr);
|
||||
|
||||
xTaskCreate(
|
||||
ledTask,
|
||||
"LED2",
|
||||
2048,
|
||||
reinterpret_cast<void *>(static_cast<intptr_t>(LED2_PIN)),
|
||||
1,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Leave loop() empty; the FreeRTOS tasks do the work.
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
Reference in New Issue
Block a user