Skip to content

Instantly share code, notes, and snippets.

View swanmatch's full-sized avatar
💡
lighting in darkness

swanmatch swanmatch

💡
lighting in darkness
View GitHub Profile
#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
/* 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
@swanmatch
swanmatch / bmp085.ino
Last active November 23, 2020 03:26
BMP085 Sensor
#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) {}
@swanmatch
swanmatch / distance.ino
Last active August 22, 2021 05:13
get Distance
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;