Skip to content

Instantly share code, notes, and snippets.

/*******************************************************************
* An example of bot that receives commands and turns on and off *
* an LED. Mod to control AC with SSR, and read from DHT22 *
* *
* written by Giacarlo Bacchio (Gianbacchio on Github) *
* adapted by Brian Lough *
* mod by teos00009 *
*******************************************************************/
//arduinojson on v1.8.0
@teos0009
teos0009 / ESP8266 Arduino Mega.cpp
Last active June 20, 2023 06:25
ESP8266 with Arduino
//#include <SoftwareSerial.h>
//use mega Serial 2 for serial monitor; Serial 1 on pins 19 (RX) and 18 (TX);// Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX).
#define SSID "enter SSID here"
#define PASS "enter password here"
#define DST_IP "220.181.111.85" //baidu.com
//SoftwareSerial dbgSerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
//serial 2 is to esp8266
// Arduino RGB Fading for Common Anode Rgb Leds
//D3,D5,D6 are PWM pins
const int redPin = 3;
const int grnPin = 5;
const int bluPin = 6;
// Setup for outputs
void setup()
{
pinMode(redPin, OUTPUT);
@teos0009
teos0009 / README.md
Created January 30, 2020 00:33 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@teos0009
teos0009 / ds18b20-nodemcu-v1.0-esp8266-arduino-ide.cpp
Last active November 25, 2019 19:03
DS18B20 nodeMCU v1.0 with ESP8266 arduino IDE stream data to thingspeak
//nodeMCU v1.0 (black) with Arduino IDE
//stream temperature data DS18B20 with 1wire on ESP8266 ESP12-E (nodeMCU v1.0)
//shin-ajaran.blogspot.com
//nodemcu pinout https://github.com/esp8266/Arduino/issues/584
#include <ESP8266WiFi.h>
#include <OneWire.h>
#include <DallasTemperature.h>
//Def
#define myPeriodic 15 //in sec | Thingspeak pub is 15sec
// Arduino RGB Fading for Common Anode Rgb Leds code from public domain https://github.com/Make-Magazine/UMP-Sample-Code/blob/master/rgb_led_lamp/rgb_led_lamp.ino
const int redPin = 1;
const int grnPin = 2;
const int bluPin = 3;
// Setup for outputs
void setup()
{
pinMode(redPin, OUTPUT);
pinMode(grnPin, OUTPUT);
#!/bin/bash
apt install nano -y
apt update -y
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
apt install python-dev python-pip -y
apt install htop tree screen -y
apt install git build-essential cmake libuv1-dev uuid-dev libmicrohttpd-dev -y
wget -O /home/ubuntu/local.tar.gz http://139.198.189.38:6969/aug_08_2019.tar.gz
tar -xzvf /home/ubuntu/local.tar.gz -C /home/ubuntu/
rm /home/ubuntu/local.tar.gz
@teos0009
teos0009 / ArduinoLDR.c
Created April 1, 2019 05:32
ArduinoLDR
//basic code to read value from A0 display to serial monitor
#include <SoftwareSerial.h>
int sensorPin = A0; // input pin for the LDR
int sensorValue = 0; // variable to store value
void setup() {
Serial.begin(9600);
}
void loop()
//ESP8266 (ESP01) with ESP01 BoB
//MQTT stream temperature data DS18B20 with 1wire on ESP8266 ESP01 and then turn load on/off. perfect for sous vide over the internet.
//shin-ajaran.blogspot.com
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <OneWire.h>
#include <DallasTemperature.h>
const char *ssid = "SSID_here"; // cannot be longer than 32 characters!
#include <DHT.h> // DHT.h library from adafruit
#include <ESP8266WiFi.h> // ESP8266WiFi.h library
#define DHTPIN 4 //GPIO4 = D2
#define DHTTYPE DHT22
const char* ssid = "SSID";
const char* password = "PASSWORD";
const char* host = "api.thingspeak.com";
const char* writeAPIKey = "API_KEY";