This file contains hidden or 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 "SSD1306.h" | |
// Sketch->Include Library->Manage libraries | |
// ESP8266 and ESP32 Oled Driver for SSD1306 display by Daniel Eichhorn, Fabrice Weinberg | |
// https://github.com/squix78/esp8266-oled-ssd1306 | |
SSD1306 display(0x3c,5,4); | |
void setup() { | |
Serial.begin(115200); |
This file contains hidden or 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 <Servo.h> | |
Servo myservo; // create servo object to control a servo | |
// twelve servo objects can be created on most boards | |
int pos = 0; // variable to store the servo position | |
void setup() { | |
myservo.attach(13); // attaches the servo on pin 9 to the servo object |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import RPi.GPIO as GPIO | |
import time | |
import os | |
import sys | |
import threading | |
import paho.mqtt.publish as publish |
This file contains hidden or 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
/* wetness sensor v1 | |
* active buzzer is connected to D1 | |
* sensor is connected to A0 | |
* temp sensor is connected to D3 | |
* lolin nodemcu uses D4 for its LED | |
*/ | |
#include <ESP8266WiFi.h> | |
#define THRESHHOLD 20 |
This file contains hidden or 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 <Adafruit_NeoPixel.h> | |
// The pin that is connected to the NeoPixels | |
#define PIN 5 | |
// The amount of LEDs in the NeoPixels | |
#define NUMPIXELS 16 | |
// previousLedColor will be used to check if the LED's color has changed | |
LedReading previousLedColor; |
This file contains hidden or 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
// Connect the gy-521 accelerometer to a digispark attyiny85 and light an LED when tipping it to the side (along X) | |
// Wire this up with gy-521:attiny85 as vcc:5v, gnd:gnd, sda:p0, scl:p3; sda and scl each have a 4.7k pull-up resistor | |
#include <TinyWireM.h> | |
const int MPU_addr=0x68; // I2C address of the MPU-6050 | |
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ; | |
void mpu_init() { | |
TinyWireM.beginTransmission(MPU_addr); |
This file contains hidden or 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 <TinyWireM.h> | |
#include <FastLED.h> | |
const int MPU_addr=0x68; // I2C address of the MPU-6050 | |
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ; | |
boolean was_turned = false; | |
#define NUM_LEDS 15 |
This file contains hidden or 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
#!/usr/bin/env python | |
# sudo apt-get install bluez python-gobject | |
# hcitool scan | |
# echo 1234 | bluez-simple-agent hci0 00:12:05:09:90:51 | |
# bluez-test-device trusted 00:12:05:09:90:51 yes | |
import socket | |
import time |
This file contains hidden or 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
//!OpenSCAD | |
// 2018-10-08 modified the "microbit diffuser" below to make the pixels more distinct -Brad | |
// The Microbit is a cool new thing from the BBC. | |
// It runs micropython. | |
// I wrote a flame simulator on it and this panel fits on top | |
// So you can adjust the parameters with the buttons and// see a diffuse fire display through the plastic shell | |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'getoptlong' | |
require 'tty/tree' | |
opts = GetoptLong.new( | |
[ '--help', '-h', GetoptLong::NO_ARGUMENT ], | |
[ '--brief', '-b', GetoptLong::NO_ARGUMENT ], | |
) | |
verbose = true |