Skip to content

Instantly share code, notes, and snippets.

@TakehikoShimojima
Created May 26, 2018 13:36
Show Gist options
  • Save TakehikoShimojima/cfb2da1e2575a23ca1629d6f4ce3a16d to your computer and use it in GitHub Desktop.
Save TakehikoShimojima/cfb2da1e2575a23ca1629d6f4ce3a16d to your computer and use it in GitHub Desktop.
#include <M5Stack.h>
#define HR_pin 36 // 心拍センサーの信号線をGPIO36につなぐ
void setup(){
M5.begin();
dacWrite(25, 0); // Speaker OFF
Serial.println("Pulse sensor test");
pinMode(HR_pin, INPUT);
}
void loop() {
Serial.println(analogRead(HR_pin)); // 心拍センサーを読み、シリアルに出力
delay(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment