Skip to content

Instantly share code, notes, and snippets.

View bboyho's full-sized avatar

Ho Yun "Bobby" bboyho

View GitHub Profile
@bboyho
bboyho / OpenLCD_Custom_Character.ino
Created February 7, 2019 21:48
Testing Custom Character code
/*
OpenLCD is an LCD with Serial/I2C/SPI interfaces.
By: Nathan Seidle
SparkFun Electronics
Date: November 12th, 2015
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
OpenLCD gives the user multiple interfaces (serial, I2C, and SPI) to control an LCD. SerLCD was the original
serial LCD from SparkFun that ran on the PIC 16F88 with only a serial interface and limited feature set.
This is an updated serial LCD.
// We'll use SoftwareSerial to communicate with the XBee:
#include <SoftwareSerial.h>
//For Atmega328P's
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2, 3); // RX, TX
//For Atmega2560, ATmega32U4, etc.
@bboyho
bboyho / APDS9301_NightLightTest.ino
Last active March 7, 2019 10:47
Test of the APDS9301
#include "Wire.h"
#include <Sparkfun_APDS9301_Library.h>
APDS9301 apds;
#define INT_PIN 2 // We'll connect the INT pin from our sensor to the
// INT0 interrupt pin on the Arduino.
bool lightIntHappened = false; // flag set in the interrupt to let the
// mainline code know that an interrupt occurred.
int threshold = 26;
/*
SparkFun Inventor’s Kit
Circuit 1C-Photoresistor
Use a photoresistor to monitor how bright a room is, and turn an LED on when it gets dark.
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
This code is completely free for any use.
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
/*
SparkFun Inventor’s Kit
Circuit 1C-Photoresistor
Use a photoresistor to monitor how bright a room is, and turn an LED on when it gets dark.
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
This code is completely free for any use.
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
/******************************************************************************
servo-skatch.ino
Example sketch for connecting a hobby servo to a sparkfun redboard
(https://www.sparkfun.com/products/9065)
(https://www.sparkfun.com/products/12757)
Byron Jacquot@ SparkFun Electronics
May 17, 2016
**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).**
/******************************************************************************
servo-skatch.ino
Example sketch for connecting a hobby servo to a sparkfun redboard
(https://www.sparkfun.com/products/9065)
(https://www.sparkfun.com/products/12757)
Byron Jacquot@ SparkFun Electronics
May 17, 2016
**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).**
@bboyho
bboyho / primary_sec_tertiary.ino
Created March 20, 2019 05:32
color mixing tests with two 180Ohm and one 100Ohm resistor
#include <SoftwareSerial.h>
SoftwareSerial xbee(2, 3); //Rx = 2, Tx = 3
//Declare variables and pin definitions
//SEND Button
const int button1Pin = 4; //push button
const int ledPin1 = 13; //LED on the push button
@bboyho
bboyho / PIR_Screensaver_wake-up.ino
Last active August 18, 2020 22:22
PIR_Screensaver_wake-up.ino
/******************************************************************************
PIR_Screensaver_wake-up.ino
Modified by: Ho Yun "Bobby" Chan
June 4th, 2019
Original sketch for SparkFun's PIR Motion Detector
(https://www.sparkfun.com/products/13285)
Jim Lindblom @ SparkFun Electronics
May 2, 2016
// We'll use SoftwareSerial to communicate with the XBee:
//#include <SoftwareSerial.h>
//For Atmega328P's
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
//SoftwareSerial XBee(2, 3); // RX, TX
//For Atmega2560, ATmega32U4, etc.