Skip to content

Instantly share code, notes, and snippets.

View zach-c-d's full-sized avatar

Zach C. D. zach-c-d

  • Toronto, Ontario
View GitHub Profile
//blink LED at rate specified by analog input from light resistor
int light_resistor = 0;
int LED = 13;
int i = 0; //level of resistance from light_resistor
void setup() {
Serial.begin(9600); //begin serial communication
pinMode(light_resistor, INPUT);
pinMode(LED, OUTPUT);
//blink LED at rate specified by analog input from light resistor
//analogue input gives numbers between 0-1033
//analogue output expects numbers between 0-255
int light_resistor = 0; //light resistor port
int LED = 9; //LED port
int i = 0; //level of resistance from light_resistor
void setup() {
Serial.begin(9600); //begin serial communication
int tempPin = 9;//temperature sensor is in pin 0
float tempC = 0; //stores temperature sensor input data
void setup() {
analogReference(INTERNAL);
Serial.begin(9600); //opens serial communication
pinMode(tempPin, INPUT);
}
void loop() {
//Take analogue readings from four temperature sensors (LM35). When temperature increases sufficiently (hand touches
//sensor), light up one LED. Each sensor has it's own LED.
//variables for storing the reading, then converting reading to celsius
int reading0;
int reading1;
int reading2;
int reading3;
float tempC0;
@zach-c-d
zach-c-d / Temp Sensor 3
Last active February 3, 2016 18:50
Temp Sensor 3
//Take analogue readings from four temperature sensors (LM35). When temperature increases sufficiently (hand touches
//sensor), light up one LED. Each sensor has it's own LED.
//cycle count
int cycle = 0;
//variables for storing the reading, then converting reading to celsius
int reading0;
int reading1;
int reading2;