This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space | |
#include <CayenneMQTTEthernet.h> | |
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard. | |
char username[] = "Paste your username"; | |
char password[] = "Paste your password"; | |
char clientID[] = "Paste your clientID"; | |
// 電圧 | |
#define VOLT 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2019 SwanMatch | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 2 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <Adafruit_BMP085.h> | |
Adafruit_BMP085 bmp; | |
void setup() { | |
Serial.begin(9600); | |
if (!bmp.begin()) { | |
Serial.println("Could not find a valid BMP085 sensor, check wiring!"); | |
while (1) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
volatile int distance; | |
// パルスのエコーで距離を求める | |
float checkdistance_8_7() { | |
digitalWrite(8, LOW); | |
delayMicroseconds(2); | |
digitalWrite(8, HIGH); | |
delayMicroseconds(10); | |
digitalWrite(8, LOW); | |
float distance = pulseIn(7, HIGH) / 58.00; |