Skip to content

Instantly share code, notes, and snippets.

View dropmeaword's full-sized avatar

Luis Rodil-Fernandez dropmeaword

  • Amsterdam, Netherlands
View GitHub Profile
#include <ESP8266WiFi.h>
char ssid[] = "your ssid";
char pass[] = "your pass";
//*****************************************************
#define DIR_PIN D0
#define STEP_PIN D3
#define ENABLE_PIN D4
#define DISABLE HIGH
// //////////////////////////////////////////////////////////////////////////
// this sketch reads out three sensors and sends their values over OSC
// it also accepts an incoming message to activate the relay
// //////////////////////////////////////////////////////////////////////////
#include <Arduino.h>
#include <easywifi.h>
#include <WiFiUdp.h>
#include <OSCMessage.h>
#include <Arduino.h> // we only need this if we are in PlatformIO
void setup() {
// initialize serial communication
// over the USB wire back to our computer
Serial.begin( 9600 );
while(!Serial) ;
// define which pins in our sketch
// will be used as inputs and which as outputs
// //////////////////////////////////////////////////////////////////////////
// this sketch reads out three sensors and sends out the reading of all three
// as OSC messages
// //////////////////////////////////////////////////////////////////////////
#include <Arduino.h>
#include <easywifi.h>
#include <WiFiUdp.h>
#include <OSCMessage.h>
// wifi credentials
// //////////////////////////////////////////////////////////////////////////
// this sketch reads out three sensors and sends out the reading of the first
// as an OSC message, as an exercise complete this sketch by sending out the
// readings of all three sensors, not just one.
// //////////////////////////////////////////////////////////////////////////
#include <Arduino.h>
#include <easywifi.h>
#include <WiFiUdp.h>
#include <OSCMessage.h>
@dropmeaword
dropmeaword / SketchSystems.spec
Last active November 25, 2021 09:52
Sonic the hedgehog
Sonic the hedgehog
Standing
R or L pressed -> Running
15 seconds passed -> Tap foot
Down button pressed -> Ducking
Jump button presseed -> Jumping in place
Press pause button -> Pause
Running
Buttons released -> Standing
Jump button pressed -> Jumping long
#ifndef __WIFI_H__
#define __WIFI_H__
#include <DNSServer.h>
#include <ESP8266mDNS.h>
enum WifiMode {
CLIENT = 10, // station node
HYBRID_AP = 15, // station + ap
ACCESS_POINT = 20, // ap only
#if defined(ARDUINO_ARCH_ESP32)
#include <WiFi.h>
#else
#include <ESP8266WiFi.h>
#endif
#include <Arduino.h>
#include <WiFiUdp.h>
#include <ArtnetWifi.h>
#include <FastLED.h>
Sonic
Standing
A button pressed -> Running
15 seconds passed -> Tap foot
Running
Buttons released -> Standing
Tap foot
A button pressed -> Running
@dropmeaword
dropmeaword / iot-mqtt-shiftr.md
Created January 20, 2021 10:47
description of problems I am having with shiftr.io

This sketch reads three analog values and sends them twice a second to a mqtt broker. Two implementations are provided running on Arduino MKR WiFi 1010, one uses the official ArduinoMqttClient library and the other one uses Joel's 256dpi MQTT library.

This is using the ArduinoMqttClient library. It works great with shiftr desktop, but when using it against a shiftr instance it chokes.

#include <ArduinoMqttClient.h>
#include <WiFiNINA.h>