Skip to content

Instantly share code, notes, and snippets.

@wmontg5988
wmontg5988 / Load_center_2_volt_read.ino
Last active January 1, 2021 19:00
Voltage Reading and Load Center control from any Arduino MCU to the Stone10.1 HMI
//Credit Electronic Clinic for inspiring this code. Basic code written by Electronic Clinic. Expanded and appended by me.
//This is a combination of 2 codes for use with the Stone 10.1 HMI
#include <SoftwareSerial.h>
SoftwareSerial max232(2,3);
#define Sensor1_H 0x00
#define Sensor1_L 0x08
#define Sensor2_H 0x00
#define Sensor2_L 0x09
@wmontg5988
wmontg5988 / PLduinoMQTTA1.ino
Last active June 8, 2019 03:14
PLduino MQTT A1
#include <Button.h>
#include <Drawable.h>
#include <GridLayout.h>
#include <Label.h>
#include <Layout.h>
#include <LinearLayout.h>
#include <Placeholder.h>
#include <PLDuinoGUI.h>
#include <Settings.h>
#include <Sizable.h>
@wmontg5988
wmontg5988 / PLduino MQTT A
Last active April 6, 2018 13:29
PLCduino MQQT with voltage reading and relay actuators.
#include <CayenneMQTTESP8266Shield.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <PLDuino.h>
#include <PLDTouch.h>
#include <PLDuinoGUI.h>
#include <using_namespace_PLDuinoGUI.h>
#include <DS3232RTC.h>
#include <TimeLib.h>
@wmontg5988
wmontg5988 / PLduino_A3_smooth.ini
Last active March 18, 2018 01:36
PLDuino MQTT with Smooth voltage readings test 1
#include <CayenneMQTTESP8266Shield.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <PLDuino.h>
#include <PLDTouch.h>
#include <PLDuinoGUI.h>
#include <using_namespace_PLDuinoGUI.h>
#include <DS3232RTC.h>
#include <TimeLib.h>
@wmontg5988
wmontg5988 / PLduino_A3_smooth Readings
Created February 20, 2018 22:25
For reading voltages and status for power inverter and solar panels on digital loggers PLduino
#include <CayenneESP8266Shield.h>
#include <TMRpcm_PLDuino.h>
#include <SPI.h>
#include <SD.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <PLDuino.h>
#include <PLDTouch.h>
#include <PLDuinoGUI.h>
#include <using_namespace_PLDuinoGUI.h>
@wmontg5988
wmontg5988 / PLduino_A3_smooth
Created January 21, 2018 22:16
Change to get smooth reading from high voltage sensor
//#define CAYENNE_DEBUG // Uncomment to show debug messages
//#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneESP8266Shield.h>
#include <TMRpcm_PLDuino.h>
#include <SPI.h>
#include <SD.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <PLDuino.h>
#include <PLDTouch.h>
@wmontg5988
wmontg5988 / wemoslight.git
Created January 21, 2018 20:43
wemos code to control lights with slider
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneMQTTESP8266.h>
// WiFi network info.
char ssid[] = “********”;
char wifiPassword[] = “*******”;
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = “";
char password[] = "”;
@wmontg5988
wmontg5988 / PLduino3
Last active July 12, 2017 23:24
Sketch for Digital Logger WiFi plc Arduino Mega base. Credit @kreggly at cayenne.mydevices.com for starting me out and showing me the way
/*
Cayenne ESP8266 Shield WiFi Example
Adapted from Blynk's ESP8266_Shield_HardSer Example
This sketch connects to the Cayenne server using an ESP8266 WiFi module as a shield connected
via a hardware serial to an Arduino.
You should install the ESP8266HardwareSerial.zip library via the Arduino IDE (Sketch->Include Library->Add .ZIP Library)
from the Cayenne extras/libraries folder (e.g. My Documents\Arduino\libraries\Cayenne\extras\libraries) to compile this example.
@wmontg5988
wmontg5988 / Remote Reboot Rpi @Adam Cayenne
Last active January 22, 2018 18:51
This python script was found on Stackoverflow.com forums. It is designed to reboot an Rpi remotely using another device by pulling up on a GPIO by use of a relay across GPIO input and 3.3v
import os
import time
import sys
# Import the modules to send commands to the system and access GPIO pins
from subprocess import call
import RPi.GPIO as gpio
from time import sleep
from os import system
gpio.setmode(gpio.BCM) # Set pin numbering to BCM numbering
@wmontg5988
wmontg5988 / PLCduino.ino
Last active June 30, 2017 23:00
PLCduino
/*
Cayenne ESP8266 Shield WiFi Example
Adapted from Blynk's ESP8266_Shield_HardSer Example
This sketch connects to the Cayenne server using an ESP8266 WiFi module as a shield connected
via a hardware serial to an Arduino.
You should install the ESP8266HardwareSerial.zip library via the Arduino IDE (Sketch->Include Library->Add .ZIP Library)
from the Cayenne extras/libraries folder (e.g. My Documents\Arduino\libraries\Cayenne\extras\libraries) to compile this example.