Upgrade to Pro — share decks privately, control downloads, hide ads and more …

アルコールモニタリングIoT / Alcohol monitoring IoT

shanonim
February 28, 2019

アルコールモニタリングIoT / Alcohol monitoring IoT

2019.02.28
enebular developer Meetup Vol.8
https://enebular.connpass.com/event/117432/

shanonim

February 28, 2019
Tweet

More Decks by shanonim

Other Decks in Technology

Transcript

  1. #include <stdio.h> #include <WioLTEforArduino.h> #include <limits.h> #define INTERVAL (5000) #define

    SENSOR_PIN (WIOLTE_A6) #define URL “https://<YOUR-DOMAIN>.herokuapp.com/upload" WioLTE Wio; int alcohol = 0; void setup() { // Connect LTE delay(200); SerialUSB.println("--- START ---------------------------------------------------"); SerialUSB.println("### I/O Initialize."); Wio.Init(); SerialUSB.println("### Power supply ON."); Wio.PowerSupplyLTE(true); delay(500); SerialUSB.println("### Turn on or reset."); if (!Wio.TurnOnOrReset()) { SerialUSB.println("### ERROR! ###"); return; } delay(3000); SerialUSB.println("### Setup completed."); }
  2. void loop() { char data[100]; int status; alcohol = analogRead(SENSOR_PIN);

    SerialUSB.print("sensor test value = "); SerialUSB.println(alcohol); delay(1000); sprintf(data, "{\"alcohol\": %d}", alcohol); if (!Wio.HttpPost(URL, data, &status)) { SerialUSB.println("### ERROR! ###"); goto err; } err: delay(3000); }
  3. Ϣʔεέʔε w टݩͰৗʹΞϧίʔϧݕ஌ w JGҿΈ͗ͯͨ͢Β w ৼಈ w ిؾ w

    DVSSFOUTUBUVTΛπΠʔτ w ೋ೔ਲ͍͕ະવʹ๷͛ΔͷͰϋοϐʔ