4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

spresenseAdvent Calendar 2022

Day 25

【ゆく年2022】ついに Spresensをワイヤレス給電したよ

Last updated at Posted at 2022-12-25

1. はじめに

Spresensをワイヤレス給電したい
じゃやっとく?

2. 準備

Qi の受信機を準備する

リナちゃんは持ってたから分解して使った
https://s.click.aliexpress.com/e/_DB3eDkb

適当なガラス瓶を用意する

ダイソーで良いかと思うよ

Spresens に適当なcodeを書き込む

WiFi が搭載されていないから
ローカルで動くのがいいと思う
WiFiでOTGとかやったら便利なのにねぇ

main.ino

//========================================
// ledary
//========================================
#define LEDS_MAXCNT (4)
static uint8_t ledary[LEDS_MAXCNT] = {
  LED0, LED1, LED2, LED3
};

//========================================
// ledOnOff
//========================================
void ledOnOff(int ledid) {
  static int stat = 0;
  if (stat) ledOn (ledary[ledid]);
  else      ledOff(ledary[ledid]);
  stat = !stat;
}

//========================================
// ledOnOffNoDelay
//========================================
void ledOnOffNoDelay(int ledid, uint32_t delaytm) {
  static uint32_t tm = millis();
  if ((millis() - tm) > delaytm) {
    tm = millis();
    ledOnOff(ledid);
  }
}

//========================================
// ledOnOffNoWhite
//========================================
void ledOnOffWhile(int ledid, uint32_t delaytm) {
  while (1) {
    ledOnOffNoDelay(ledid, 1000);
  }
}

//========================================
// setup
//========================================
void setup() {
  Serial.begin( 115200 ); while (!Serial);
  for (int i = 0; i < LEDS_MAXCNT; i++) {
    ledOff(ledary[i]);
  }
}

//========================================
// loop
//========================================
void loop() {
  static int i = 0;
  ledOnOffNoDelay(i, 50);
  i = (i + 1) % LEDS_MAXCNT;
}


3. 組み込み

USBからだとサイズが大きくなっちゃうので無理やり電源PINから入力する
コネクタの向きに注意

0.jpg

4. 実際の駆動状況

5. さいごに

お疲れさまでございました
来年もよろしくお願い申し上げます

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?