LoginSignup
1
2

More than 5 years have passed since last update.

M5GOのIRセンサーをArduinoで使う

Last updated at Posted at 2018-11-25

目的

M5GOに入っている、IRセンサーをArduinoで使ってみる。

準備

Arduinoのライブラリマネージャーから、「IRremote」をインストールします。

実装例

#include <IRremote.h>
#include <M5Stack.h>
int RECV_PIN = 36;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup(){
  M5.begin();
  irrecv.enableIRIn(); 
}
void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
  delay(100);
}

Arduino-IRremote

1
2
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
1
2