Mercury V1マニュアル
簡単にすぐに飛行を開始する方法を学び、altimeter を Altimeter Cloud ウェブサイトに接続してアップロードし、高度な機能も利用してください。困っている場合や初心者向けの情報が必要な場合は、ここが最適です。

コード例:センサーとLEDの電源制御

PDF

Mercury アルチメーターのセンサーと Neopixel LED はデフォルトでオフになっています。この機能は、必要に応じて深いスリープまたはライトスリープでアイテムをオフにして、電力を節約し、最大効率で動作させるために存在します。ただし、アイテムを使用する前に電源をオンにする必要があります。

Arduino IDE を使用していますか?当社のオンラインプログラマーはデフォルトで Mercury_Pins.h をインクルードしているため、ピン名は問題なく動作します。Arduino IDE または別のプログラマーを使用している場合は、Mercury_Pins.h タブのコンテンツをコピーしてプログラムの最上部に貼り付けてください。
/*
 * Mercury V1 (ESP32-C6) Power control example
 * Turns on the Status LED power as well as the IMU power (Gyroscope and Accelerometer)
 */
#include "Mercury_Pins.h"

void setup() {
    pinMode(VACC, OUTPUT);        // Set the Sensor power pin as a output
    pinMode(LEDPOWER, OUTPUT);    // Set the LED power pin as a output
    digitalWrite(VACC, HIGH);     // Set the Sensor power pin HIGH to turn on
    digitalWrite(LEDPOWER, HIGH); // Set the LED power pin HIGH to turn on
}
void loop() {
    // Your program goes here
    delay(1000);
}

#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