Skip to content

Instantly share code, notes, and snippets.

@haratta27
haratta27 / ContactTracingAppFinder.ino
Last active September 3, 2020 14:58 — forked from ksasao/ContactTracingAppFinder.ino
周辺にあるコロナ接触確認デバイスの数をカウントします。M5stickC−PLUS 用です。Closeは自分のデバイスやかなり近くのデバイス数です。Nearは受信した数、Sumは合計数です。加速度センサにて画面向きが切り替わります。
#include <M5StickCPlus.h>
#include <BLEDevice.h>
// Contact Tracing Bluetooth Specification (Apple/Google)
// https://blog.google/documents/58/Contact_Tracing_-_Bluetooth_Specification_v1.1_RYGZbKW.pdf
const char* uuid = "0000fd6f-0000-1000-8000-00805f9b34fb";
unsigned int near_count = 0;
unsigned int close_count = 0;
BLEScan* pBLEScan;