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 "HX711.h" | |
// HX711.DOUT - pin #A1 | |
// HX711.PD_SCK - pin #A0 | |
HX711 scale(4, 5, 128); // parameter "gain" is ommited; the default value 128 is used by the library | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("HX711 Demo"); |
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 <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include "/usr/local/src/ap_setting.h" | |
extern "C" { | |
#include "user_interface.h" | |
} | |
char* topic = "wifitest"; | |
int test_para = 5000; |
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
typedef struct { | |
uint32_t _salt; | |
uint16_t volt; | |
int16_t data1; | |
int16_t data2; | |
uint8_t devid; | |
} data; | |
data sensor_data; |
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
// from http://lowreal.net/2016/01/10/1 | |
#include <Arduino.h> | |
extern "C" { | |
#include <user_interface.h> | |
}; | |
// system_rtc_mem_write() 先のブロックアドレス。 | |
// 4 bytes で align されており、先頭256bytes はシステム予約領域 | |
// 64 から書けるはずだが、65 以降でないとうまくいかなかった。。 | |
static const uint32_t USER_DATA_ADDR = 66; |
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
void callback(char* topic, byte* payload, unsigned int length) { | |
String receivedtopic = topic; | |
String receivedpayload ; | |
for (int i = 0; i < length; i++) { | |
receivedpayload += (char)payload[i]; | |
} | |
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 <SPI.h> | |
#include "nRF24L01.h" | |
#include "RF24.h" | |
int senderId; | |
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10 | |
//Contacts from the radio to connect NRF24L01 pinamnam -> Arduino |
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
int testpin1 = 5; | |
void setup() { | |
pinMode(testpin1, OUTPUT); | |
} | |
void loop() { | |
Serial.begin(115200); | |
digitalWrite(testpin1, LOW); | |
delay(2000); |
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
int sampleI; | |
int Number_of_Samples; | |
int sumI; | |
void setup() | |
{ | |
Serial.begin(115200); | |
sampleI = 0; | |
sumI = 0; | |
Number_of_Samples = 1000; |
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 <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include "/usr/local/src/ap_setting.h" | |
// Update these with values suitable for your network. | |
/* | |
char* topic = "/30/Status/MQTT"; | |
char* subtopic = "inTopic"; |
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
#!/bin/sh | |
## you'll have to do a couple extra steps to get this running | |
## there are probably other ways to handle svncanboot, but this is from the linux forum | |
set -e | |
if | |
touch /etc/_testr_file | |
then |