Mercury V1 manual
تعرف على كيفية الإطلاق بسهولة وسرعة، قم بتوصيل جهاز altimeter الخاص بك بالتحميل إلى موقع Altimeter Cloud واستمتع بجميع الميزات المتقدمة أيضاً. إذا كنت عالقاً أو للتو تبدأ، هذا هو المكان المناسب لك.

مثال برمجي: مؤشر LED حالة NeoPixel

PDF

يحتوي Mercury على إما 1 LED حالة من نوع "Neopixel"، أو 4 في مربع من المراجعة 3 فما بعده.
الطريقة الأسهل لاستخدام هذه هي تشغيلها (انظر صفحة التحكم في الطاقة) ثم استخدام مكتبة قياسية. 
في هذا المثال، يمكنك تغييره إلى 4 أو 1 بكسل، وقد عيناه افتراضياً على 4 بكسل. 

استخدام Arduino IDE؟ يتضمن برنامجنا عبر الإنترنت Mercury_Pins.h بشكل افتراضي بحيث تعمل أسماء الدبابيس بدون مشاكل. إذا كنت تستخدم Arduino IDE أو برنامج آخر، فانسخ محتوى علامة Mercury_Pins.h والصقه في أعلى برنامجك.
/*
 * Mercury V1 (ESP32-C6) Status LED example
 * Cycles the Neopixel(s) through various colours
 */
#include "Mercury_Pins.h"
#include "Adafruit_NeoPixel.h"

Adafruit_NeoPixel pixels(4, LED, NEO_GRB + NEO_KHZ800);

void setup() {
    Serial.begin(115200);

    // Enable the NeoPixel power rail
    pinMode(LEDPOWER, OUTPUT);
    digitalWrite(LEDPOWER, HIGH);
    delay(10);

    pixels.begin();
    pixels.setBrightness(140);  // Keep brightness low (0-255)
    pixels.show();

    Serial.println("NeoPixel colour cycle started");
}

// Smoothly cycle all pixels through the colour wheel
void rainbow(int wait) {
    static uint16_t hue = 0;
    for (int i = 0; i < pixels.numPixels(); i++) {
        uint16_t pixelHue = hue + (i * 65536L / pixels.numPixels());
        pixels.setPixelColor(i, pixels.gamma32(pixels.ColorHSV(pixelHue)));
    }
    pixels.show();
    hue += 256;
    delay(wait);
}

void loop() {
    rainbow(20);
}



#pragma once
/*
 * Mercury (ESP32-C6) Pin Definitions
 * Board-specific GPIO assignments
 */

// ── Status LED (NeoPixel) ──
#define LEDPOWER      3    // NeoPixel power (drive HIGH to enable)
#define LED           2    // NeoPixel data signal

// ── I2C Bus ──
#define SDA           21   // I2C data
#define SCL           22   // I2C clock

// ── Sensor Power ──
#define VACC          20   // Sensor power rail (drive HIGH to enable)

// ── General Purpose Ports ──
#define GP06          6    // GP06 port
#define GP07          7    // GP07 port

// ── High Current Output ──
#define OUT1          5    // High current output (e.g. pyro / relay)

// ── Battery Bar LEDs ──
#define BL1           4    // Battery LED 1 (lowest)
#define BL2           14   // Battery LED 2
#define BL3           15   // Battery LED 3
#define BL4           18   // Battery LED 4
#define BL5           19   // Battery LED 5 (highest)

// ── Indicators ──
#define DISK          8    // Disk activity LED

// ── Analogue / Detection ──
#define BATIN         0    // Battery voltage (1:1 divider)
#define USBDETECT     1    // USB power detect (HIGH = USB present)
#define BUTTON        9    // BUTTON on the board, boot button but can be used