No title available

Kaledo Art
almost home
Monterey Bay Aquarium
Mike Driver
DEAR READER
Xuebing Du

izzy's playlists!
Keni
tumblr dot com
let's talk about Bridgerton tea, my ask is open

Love Begins
RMH
d e v o n
art blog(derogatory)
wallacepolsom
cherry valley forever
Peter Solarz
Stranger Things
TVSTRANGERTHINGS
seen from United States
seen from United States
seen from Brazil

seen from T1

seen from India

seen from Türkiye
seen from United Kingdom

seen from Greece
seen from Spain
seen from Canada
seen from Spain
seen from Sri Lanka
seen from Yemen
seen from United States

seen from United Kingdom
seen from United States
seen from United States

seen from Türkiye

seen from United States

seen from Italy
@arch497-08
Flash Detector with Analog Interrupt Code
int flashes = 0;
int wait = 1000;
void setup()
{
pinMode(7,INPUT);
pinMode(13, OUTPUT);
Serial.begin(9600);
ACSR = B01011010; // comparator interrupt enabled and tripped on falling edge.
digitalWrite(13, HIGH);
}
void loop()
{
for(int i=0; i<flashes; i++)
{
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
}
delay(1000);
}
ISR(ANALOG_COMP_vect)
{
flashes++;
Serial.print("Number of Flashes: ");
Serial.println(flashes);
delay(wait);
}
Camera Flash around Crown Hall
The more a door is used the brighter its leds become.
Code:
int wdPin=13;
int edPin=12;
int wHall=0;
int eHall=0;
int westLight=3;
int eastLight=5;
int westCount=0;
int eastCount=0;
int totalCount=0;
int westValue=0;
int eastValue=0;
String wdState=”closed”;
String edState=”closed”;
int maxValue=255;
void setup()
{
pinMode(wdPin, INPUT);
pinMode(edPin, INPUT);
pinMode(eastLight, INPUT);
pinMode(westLight, INPUT);
Serial.begin(9600);
}
void loop()
{
processWest();
processEast();
processCount();
processOutput();
delay(1000);
}
void processWest()
{
wHall = digitalRead(wdPin);
// Serial.println(wHall);
if (wdState.equals(“closed”))
{
if(wHall == HIGH)
{
westCount+=40;
wdState=”open”;
}
}
else
{
if(wHall==LOW)
{
wdState=”closed”;
}
}
}
void processEast()
{
eHall = digitalRead(edPin);
Serial.println(eHall);
if (edState.equals(“closed”))
{
if(eHall == HIGH)
{
eastCount+=40;
edState=”open”;
}
}
else
{
if(eHall==LOW)
{
edState=”closed”;
}
}
}
void processCount()
{
totalCount=eastCount+westCount;
float eastPerc=(float)eastCount/(float)totalCount;
Serial.println(eastPerc);
float westPerc=(float)westCount/(float)totalCount;
Serial.println(westPerc);
if(eastCount>0)
{
eastValue=maxValue*eastPerc;
}
if(westCount>0)
{
westValue=maxValue*westPerc;
}
}
void processOutput()
{
//int westValue = map(westValue, 0, maxValue, 0, 100);
//int eastValue = map(eastValue, 0, maxValue, 0, 100);
analogWrite(westLight,westValue);
analogWrite(eastLight,eastValue);
Serial.print(“West Value: “);
Serial.println(westValue);
Serial.print(“West Count: “);
Serial.println(westCount);
Serial.print(“East Value: “);
Serial.println(eastValue);
Serial.print(“East Count: “);
Serial.println(eastCount);
Serial.print(“Total Count: “);
Serial.println(totalCount);
}
As one enters through a door the opposite door glows brighter to attract people and even out usage of both doors (symmetrical usage).
CODE:
int wdPin=13;
int edPin=12;
int wHall=0;
int eHall=0;
int westLight=3;
int eastLight=5;
int westCount=0;
int eastCount=0;
int totalCount=0;
int westValue=0;
int eastValue=0;
String wdState=”closed”;
String edState=”closed”;
int maxValue=255;
void setup()
{
pinMode(wdPin, INPUT);
pinMode(edPin, INPUT);
pinMode(eastLight, INPUT);
pinMode(westLight, INPUT);
Serial.begin(9600);
}
void loop()
{
processWest();
processEast();
processCount();
processOutput();
delay(1000);
}
void processWest()
{
wHall = digitalRead(wdPin);
// Serial.println(wHall);
if (wdState.equals(“closed”))
{
if(wHall == HIGH)
{
eastCount+=40;
wdState=”open”;
}
}
else
{
if(wHall==LOW)
{
wdState=”closed”;
}
}
}
void processEast()
{
eHall = digitalRead(edPin);
Serial.println(eHall);
if (edState.equals(“closed”))
{
if(eHall == HIGH)
{
westCount+=40;
edState=”open”;
}
}
else
{
if(eHall==LOW)
{
edState=”closed”;
}
}
}
void processCount()
{
totalCount=eastCount+westCount;
float eastPerc=(float)eastCount/(float)totalCount;
Serial.println(eastPerc);
float westPerc=(float)westCount/(float)totalCount;
Serial.println(westPerc);
if(eastCount>0)
{
eastValue=maxValue*eastPerc;
}
if(westCount>0)
{
westValue=maxValue*westPerc;
}
}
void processOutput()
{
//int westValue = map(westValue, 0, maxValue, 0, 100);
//int eastValue = map(eastValue, 0, maxValue, 0, 100);
analogWrite(westLight,westValue);
analogWrite(eastLight,eastValue);
Serial.print(“West Value: “);
Serial.println(westValue);
Serial.print(“West Count: “);
Serial.println(westCount);
Serial.print(“East Value: “);
Serial.println(eastValue);
Serial.print(“East Count: “);
Serial.println(eastCount);
Serial.print(“Total Count: “);
Serial.println(totalCount
);
}
Using a Piezo sensor to detect vibration. When detected have an alarm sound and a RGB led go off.
Changing an RGB led with 4 Pots. One of them controlling White, another Red, another Green, then Blue respectively.
The Code:
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
int Red = 3;
int Green = 5;
int Blue = 6;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(Red, INPUT);
pinMode(Green, INPUT);
pinMode(Blue, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// int intValue1;
//int redValue1;
//int greenValue1;
//int blueValue1;
// read the input on analog pin 0:
int intValue = analogRead(A0);
int redValue = analogRead(A1);
int blueValue = analogRead(A2);
int greenValue = analogRead(A3);
int intValue1 = map(intValue,0,1023,0,6);
int redValue0 = (redValue*intValue1);
int blueValue0 = (blueValue*intValue1);
int greenValue0 = (greenValue*intValue1);
int redValue1 = map(redValue0,0,5115,0,255);
int blueValue1 = map(blueValue0,0,5115,0,255);
int greenValue1 = map(greenValue0,0,5115,0,255);
analogWrite(Red, redValue1);
analogWrite(Green, greenValue1);
analogWrite(Blue, blueValue1);
// print out the value you read:
Serial.print("Intensity");
Serial.print(" ");
Serial.print(intValue1);
Serial.print(" + ");
Serial.print("Red");
Serial.print(" ");
Serial.print(redValue1);
Serial.print(" + ");
Serial.print("Green");
Serial.print(" ");
Serial.print(greenValue1);
Serial.print(" + ");
Serial.print("Blue");
Serial.print(" ");
Serial.println(blueValue1);
delay(1); // delay in between reads for stability
}
Midterm prototype
Eclipse: October 2014
Controlling the position of a servo motor with a potentiometer
Blinking an LED with a switch and a potentiameter.