Refactor mcu code. Closes #11
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
// ─── Motor pin mapping (28BYJ-48 / ULN2003) ──────────────────────
|
||||
// Motor 1 – Shoulder
|
||||
#define M1_IN1 0
|
||||
#define M1_IN2 1
|
||||
#define M1_IN3 3
|
||||
#define M1_IN4 4
|
||||
|
||||
// Motor 2 – Elbow
|
||||
#define M2_IN1 5
|
||||
#define M2_IN2 6
|
||||
#define M2_IN3 7
|
||||
#define M2_IN4 10
|
||||
|
||||
// ─── Stepper constants ────────────────────────────────────────────
|
||||
#define STEPS_PER_REV 2048
|
||||
#define DEFAULT_SPEED 600.0f
|
||||
#define DEFAULT_ACCEL 100.0f
|
||||
#define IDLE_TIMEOUT_MS (30 * 60 * 1000)
|
||||
#define NOTIFY_INTERVAL_MS 200
|
||||
|
||||
// ─── BLE Constants ────────────────────────────────────────────────
|
||||
#define DEVICE_NAME "WijiBoard"
|
||||
#define SERVICE_UUID "18f3b235-9831-4c75-8ec0-210469b820a0"
|
||||
#define CMD_UUID "cd083b06-4447-4cf3-a7c3-322ecf802ce4"
|
||||
#define STATUS_UUID "82e38c5b-d3ab-41d1-861c-b84dc6bb1e03"
|
||||
|
||||
// ─── LED Definitions ──────────────────────────────────────────────
|
||||
#ifndef STATUS_LED_PIN
|
||||
#ifdef LED_BUILTIN
|
||||
#define STATUS_LED_PIN LED_BUILTIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef STATUS_LED_ON
|
||||
#define STATUS_LED_ON HIGH
|
||||
#define STATUS_LED_OFF LOW
|
||||
#endif
|
||||
Reference in New Issue
Block a user