Guest User

Untitled

a guest
Mar 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include "Ambient.h" // Ambientのヘッダーをインクルード
  2.  
  3. Ambient ambient; // Ambientオブジェクトを定義
  4.  
  5. unsigned int channelId = 100; // AmbientのチャネルID
  6. const char* writeKey = "writeKey"; // ライトキー
  7.  
  8. void setup() {
  9. ...
  10. ambient.begin(channelId, writeKey, &client); // チャネルIDとライトキーを指定してAmbientの初期化
  11. }
  12.  
  13. void loop() {
  14. ... // センサーの値を読む
  15.  
  16. // センサー値をAmbientに送信する
  17. ambient.set(1, data1);
  18. ambient.set(2, data2);
  19.  
  20. ambient.send();
  21. }
Add Comment
Please, Sign In to add comment