Skip to content

Instantly share code, notes, and snippets.

View bboyho's full-sized avatar

Ho Yun "Bobby" bboyho

View GitHub Profile
#include <Adafruit_NeoPixel.h> // http://librarymanager/All#adafruit_neopixel
// library reference => https://github.com/adafruit/Adafruit_NeoPixel
// Arduino Reference Language => https://www.arduino.cc/reference/en
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 6 //LED pin
#define buttonPin 2
# safe_shutdown_Pi.py
#
# -----------------------------------------------------------------------------
# Raspberry Pi Safe Shutdown Python Script
# -----------------------------------------------------------------------------
# WRITTEN BY: Ho Yun "Bobby" Chan
# @ SparkFun Electronics
# DATE: 3/31/2020
#
# Based on code from the following blog and tutorials:
# safe_restart_shutdown_Pi.py
#
# -----------------------------------------------------------------------------
# Raspberry Pi Safe Restart and Shutdown Python Script
# -----------------------------------------------------------------------------
# WRITTEN BY: Ho Yun "Bobby" Chan
# @ SparkFun Electronics
# DATE: 3/31/2020
#
# Based on code from the following blog and tutorials:
/*
HTU21D Humidity Sensor Example Code
By: Nathan Seidle
SparkFun Electronics
Date: September 15th, 2013
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Uses the HTU21D library to display the current humidity and temperature
Open serial monitor at 9600 baud to see readings. Errors 998 if not sensor is detected. Error 999 if CRC is bad.
/*
Get basic environmental readings from the BME280
By: Nathan Seidle
SparkFun Electronics
Date: March 9th, 2018
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Feel like supporting our work? Buy a board from SparkFun!
https://www.sparkfun.com/products/14348 - Qwiic Combo Board
https://www.sparkfun.com/products/13676 - BME280 Breakout Board
/*
HTU21D Humidity Sensor Example Code
By: Nathan Seidle
SparkFun Electronics
Date: September 15th, 2013
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Uses the HTU21D library to display the current humidity and temperature
Open serial monitor at 9600 baud to see readings. Errors 998 if not sensor is detected. Error 999 if CRC is bad.
/******************************************************************************
Digital Indoor Temperature Monitor with the TMP102
Written by: Ho Yun "Bobby" Chan
@ SparkFun Electronics
Date: Mar 26, 2020
Description: This sketch configures temperature sensors and prints the
temperature in degrees celsius and fahrenheit to the Qwiic microOLED.
Simply adjust the `output_select` to view the °C, °F, or both. You can
also output the values to the Serial Monitor or Plotter at 115200 baud
/******************************************************************************
Digital Indoor Temperature Monitor with the TMP117
Written by: Ho Yun "Bobby" Chan
@ SparkFun Electronics
Date: Mar 6, 2020
Description: This sketch configures temperature sensors and prints the
temperature in degrees celsius and fahrenheit to the Qwiic microOLED.
Simply adjust the `output_select` to view the °C, °F, or both. You can
also output the values to the SerialUSB Monitor or Plotter at 115200 baud
/******************************************************************************
Qwiic_Keypad_HID_Keyboard_Example.ino
Written by: Ho Yun "Bobby" Chan
Date: February 6, 2020
Development Environment Specifics:
Arduino IDE 1.8.9
Description:
Based on the following examples:
- Jim's Pro Micro "HID Mouse/Keyboard"
/******************************************************************************
Qwiic_Keypad_HID_Keyboard_Example.ino
Written by: Ho Yun "Bobby" Chan
Date: February 6, 2020
Development Environment Specifics:
Arduino IDE 1.8.9
Description:
Based on the Jim's Pro Micro "HID Mouse" and Pete' Qwiic Keypad "read button"
examples, this example outputs keyboard presses associated with the keypad.