Skip to content

Instantly share code, notes, and snippets.

View hhayley's full-sized avatar

Hayley Hwang hhayley

View GitHub Profile
const int transistorPin = 9;
int redSwitch = 3;
int switchValue = 0;
int poten = A0;
void setup() {
Serial.begin(9600);
pinMode(transistorPin, OUTPUT);
pinMode(redSwitch, INPUT);
pinMode(poten, INPUT);
const int transistorPin = 9;
int redSwitch = 8;
int switchValue = 0;
int poten = A0;
int B = 3; //Connect Blue led to Digital pin 3
int R = 5; //Connect Red led to Digital pin 5
int G = 6; //Connect Green led to Digital pin 6
//electromagnet test 01
int onBtn = 2;
int btnState = 0;
int mag = 9;
int led = 13;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(mag, OUTPUT);
#define SensorLED 13
#define SensorINPUT 3 //Connect the sensor to digital Pin 3 which is Interrupts 1.
unsigned char state = 0;
int cnt = 0;
void setup()
{
pinMode(SensorLED, OUTPUT);
pinMode(SensorINPUT, INPUT);
@hhayley
hhayley / index.html
Created October 27, 2016 18:55
Today than yesteday
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.2/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.2/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.2/addons/p5.sound.min.js"></script>
<script src="moment.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
const int btn_1 = 2; // the number of the pushbutton pin
const int btn_2 = 3;
const int btn_3 = 4;
const int btn_4 = 5;
const int btn_5 = 6;
const int btn_6 = 7;
const int btn_7 = 8;
const int btn_8 = 9;
const int btn_9 = 10;
int led = 9;
int btn = 2;
int buttonState = 0;
int lastButtonState = 0;
void setup() {
pinMode(led, OUTPUT);
pinMode(btn, INPUT);
Serial.begin(9600);
@hhayley
hhayley / abushcandle.ino
Created February 8, 2017 14:40
A Brush Candle
#include "Interval.h"
/*
A Brush Candle - Hayley Hwang
for Lighting & Interactivity Class
- NeoPixel RGBW x 1
- Piezo Sensor x 1
- 1mOhm x 1
*/
#include <Adafruit_NeoPixel.h>
#include "Interval.h"
#include <Adafruit_NeoPixel.h>
const int knockSensor = A0;
int val = 0;
#define PIN 6
const int numPixels = 7;
#include <CapacitiveSensor.h>
/*
CapitiveSense Library Demo Sketch
Paul Badger 2008
Uses a high value resistor e.g. 10M between send pin and receive pin
Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
Receive pin is the sensor pin - try different amounts of foil/metal on this pin
*/