Skip to content

Instantly share code, notes, and snippets.

View ShawnHymel's full-sized avatar

Shawn Hymel ShawnHymel

View GitHub Profile
@ShawnHymel
ShawnHymel / boards\yas-0_f070cb.json
Last active September 4, 2019 23:43
%HOMEPATH%\.platformio\
{
"build": {
"cpu": "cortex-m0",
"extra_flags": "-DSTM32F070xB",
"f_cpu": "48000000L",
"framework_extra_flags": {
"arduino": "-DVECT_TAB_OFFSET=0x2000 -DCUSTOM_STARTUP_FILE"
},
"mcu": "stm32f070cbt6",
"variant": "YAS-0_F070CB"
@ShawnHymel
ShawnHymel / buttonserver.py
Last active March 14, 2019 21:13
Toggle LED Web Server
import BaseHTTPServer
import SocketServer
import RPi.GPIO as GPIO
# LED pin number (GPIO)
LED = 2
# Port number for our server
PORT = 80
@ShawnHymel
ShawnHymel / weather.py
Created March 13, 2019 19:00
Firmata Weather Station
import http.client
import time
from pyfirmata import Arduino, util
# Parameters
COM_PORT = 'COM37'
API_KEY = 'BMZ44FSBTE8JANSU'
HOSTNAME = 'api.thingspeak.com'
AREF = 5.0
@ShawnHymel
ShawnHymel / arduino-robot.ino
Created March 12, 2019 17:39
Workshop - Robotics - Adding Autonomy
// Pins
int echoPin = 5;
int trigPin = 6;
int switchPin = 7;
const int BIN1 = 8;
const int BIN2 = 9;
const int PWMB = 10;
const int PWMA = 11;
const int AIN2 = 12;
const int AIN1 = 13;
@ShawnHymel
ShawnHymel / motor-driver-example.ino
Last active January 20, 2020 07:14
Workshop - Motor Driver
// Pins
int switchPin = 7;
const int BIN1 = 8;
const int BIN2 = 9;
const int PWMB = 10;
const int PWMA = 11;
const int AIN2 = 12;
const int AIN1 = 13;
// Parameters
@ShawnHymel
ShawnHymel / esp32_websocket_host.ino
Created March 3, 2019 22:23
ESP32 WebSocket Host
#include <WiFi.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
#include <WebSocketsServer.h>
// Constants
const char *ssid = "ESP32-AP";
const char *password = "LetMeInPlz";
const char *msg_toggle_led = "toggleLED";
const char *msg_get_led = "getLEDState";
@ShawnHymel
ShawnHymel / Qwiic_Mux_Spectral_Demo.ino
Last active July 18, 2018 22:27
Light Spectrogram
/**
* Qwiic Mux Spectral Demo
* Author: Shawn Hymel (SparkFun Electronics)
* Date: July 18, 2018
*
* Reads from 2 light spectral sensors and shows amount of light
* detected in each channel.
*
* Connect Qwiic Mux and Qwiic OLED to Arduino. Connect Visible
* (AS7262) and NIR (AS7263) Spectral Sensor Qwiic Breakout
@ShawnHymel
ShawnHymel / Differential_I2C_Demo.ino
Created May 24, 2018 22:03
Differential I2C Demo
/*
* Differential I2C Demo
* Author: Shawn Hymel (SparkFun Electronics)
* Date: May 24, 2018
*
* Connect Qwiic OLED and Qwiic Environmental sensor to Arduino.
* Demo will read and display temperature and humidity data. Try
* adding 2x Differential I2C boards in between the Arduino and
* Environmental sensor to place the sensor at some distance up to
* 100 feet from the Arduino.
@ShawnHymel
ShawnHymel / GridEYE_LEDs.ino
Created May 2, 2018 20:24
Demo of the Grid-EYE IR sensor using an LED array
/**
* GridEye LED Array Demo
* Author: Shawn Hymel (SparkFun Electronics)
* Date: May 1, 2018
*
* Displays a heat map of what the GridEye sees (8x8 pixels).
*
* Required Components
* - Arduino: https://www.sparkfun.com/products/13975
* - Qwiic Shield: https://www.sparkfun.com/products/14352
@ShawnHymel
ShawnHymel / GridEYE_LEDs.ino
Created May 2, 2018 20:24
Demo of the Grid-EYE IR sensor using an LED array
/**
* GridEye LED Array Demo
* Author: Shawn Hymel (SparkFun Electronics)
* Date: May 1, 2018
*
* Displays a heat map of what the GridEye sees (8x8 pixels).
*
* Required Components
* - Arduino: https://www.sparkfun.com/products/13975
* - Qwiic Shield: https://www.sparkfun.com/products/14352