Skip to content

Instantly share code, notes, and snippets.

View liz-miller's full-sized avatar

liz miller liz-miller

View GitHub Profile
@liz-miller
liz-miller / all_off_method.ino
Created December 3, 2018 16:53
Light Menorah Example
/*
* Raw method to show you how to shut off all
* the LED's on our Simulated Menorah
*/
//shut off all lights
void allOff(){
for(int pin=start; pin <= 10; pin++){
digitalWrite(pin, LOW);
}
@liz-miller
liz-miller / light_menorah_method.ino
Created December 3, 2018 16:48
Light Menorah Example
//method to control the menorah
void lightMenorah(){
int reading = digitalRead(button);
if (reading != lastButtonState) {
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
@liz-miller
liz-miller / L298N_example.ino
Created November 16, 2018 23:19
L298N Motor Controller Example
/*
* Overview of L298N controller for Robotics
* Controls how our robot moves.
* Developed for the Beginner Bots lesson series on www.learnrobotics.org/blog
* Written by Liz Miller
* 11/16/18
*/
//Left Motor
int enableA = 10;
@liz-miller
liz-miller / LR_Tiny_Robot.ino
Created November 15, 2018 21:48
Tiny Robot Example Code
/*
Tiny Robot Car Motor Example
Forward then Stop
This code is untested and is used for demonstration purposes.
Modifications might be needed. Use at your own risk.
Last updated 11/15/18
*/
@liz-miller
liz-miller / pan-tilt-part-1.ino
Last active September 19, 2018 16:07
Pan/Tilt
#include <Servo.h>
/*
* Pan Tilt Servos
* Written by Liz Miller
* for Learn Robotics (www.learnrobotics.org)
* Version 1.1
* 9-19-18
* ---
* The Software is provided "AS IS" and "WITH ALL FAULTS,"
* without warranty of any kind, including without limitation
@liz-miller
liz-miller / publish-to-ifttt-conditionally.ino
Created July 29, 2018 18:18
Arduino to IFTTT using Wemos D1 Mini - Conditional POST
#include <Arduino.h>
#include <ESP8266WiFi.h>
// WiFi parameters
const char* ssid = "your-ssid"; //replace with your ssid
const char* password = "your-pw";//replace with your pw
// IFTTT Maker parameters:
char MakerIFTTT_Key[] = "your-ifttt-key"; // Obtained when setting up/connecting the Maker channel in IFTTT
char MakerIFTTT_Event[] = "wemos-trigger"; // Arbitrary name for the event; used in the IFTTT recipe.
@liz-miller
liz-miller / post-to-ifttt.ino
Last active January 25, 2020 02:45
Arduino to IFTTT using Wemos D1 Mini - POST methods
#include <Arduino.h>
#include <ESP8266WiFi.h>
// WiFi parameters
const char* ssid = "your-ssid"; //replace with your ssid
const char* password = "your-pw";//replace with your pw
// IFTTT Maker parameters:
char MakerIFTTT_Key[] = "your-ifttt-key"; // Obtained when setting up/connecting the Maker channel in IFTTT
char MakerIFTTT_Event[] = "wemos-trigger"; // Arbitrary name for the event; used in the IFTTT recipe.
@liz-miller
liz-miller / initialize-wifi.ino
Created July 29, 2018 17:57
Arduino to IFTTT using Wemos D1 Mini - Part 2
#include <Arduino.h>
#include <ESP8266WiFi.h>
// WiFi parameters
const char* ssid = "your-ssid"; //replace with your ssid
const char* password = "your-pw";//replace with your pw
// IFTTT Maker parameters:
char MakerIFTTT_Key[] = "your-ifttt-key"; // Obtained when setting up/connecting the Maker channel in IFTTT
char MakerIFTTT_Event[] = "wemos-trigger"; // Arbitrary name for the event; used in the IFTTT recipe.
@liz-miller
liz-miller / initial-setup.ino
Created July 29, 2018 17:52
Arduino to IFTTT using Wemos D1 Mini
#include <Arduino.h>
#include <ESP8266WiFi.h>
// WiFi parameters
const char* ssid = "your-ssid"; //replace with your ssid
const char* password = "your-pw";//replace with your pw
// IFTTT Maker parameters:
char MakerIFTTT_Key[] = "your-ifttt-key"; // Obtained when setting up/connecting the Maker channel in IFTTT
char MakerIFTTT_Event[] = "wemos-trigger"; // Arbitrary name for the event; used in the IFTTT recipe.
@liz-miller
liz-miller / wemos-mqtt-leds.ino
Created July 24, 2018 17:45
Sample Code for Wemos D1 Mini + MQTT (LED hint)
//create a method to control the LED's
void ctrlLEDs(String topic, byte receivedChar){
if (topic == "ledStatus/red"){ //every LED has it's own topic for individual control
if(receivedChar == '1'){
digitalWrite(redLED, HIGH);
}
else if (receivedChar == '0'){
digitalWrite(redLED, LOW);
}