A proximity sensor turns on when the viewer is close to the box and then the viewer can see clearly what's inside. A mystery black box on a wall which contains my DCF (Florida Department of Children & Families) papers when I was in foster care. I decided to only use the significant ones such as in one in 1999 that my birthmother didn't show up to the visit. One in 2000 that the visit with my brother and birthmother went really well. Lastly, in 2001 when my adoption was finalized. In my experience as an adoptee, most people don't really know the foster system that well. Most people believe it's an orphanage of some-sort that the government runs which isn't true at all. The papers inside have a semi-gloss to them to represent self-identity and help the blue light bounce around inside the box. The blue light represents National Foster Care Month which is in May. It is symbolized with a blue ribbon.
const int signalPin= 0; //yellow wire connects to analog pin A0
const int LEDPin= 12; //LED connects to digital pin 13
int signal;//this variable, signal, will hold the analog value read by the arduino
void setup() {
Serial.begin(9600); //sets the baud rate for data transfer in bits/second
pinMode(signalPin, INPUT); //the infrared sensor signal line will be an input to the arduino
pinMode(LEDPin, OUTPUT); //the LED serves an output in the circuit
}
void loop() {
signal= analogRead(signalPin); //arduino reads the value from the infrared sensor
Serial.println(signal); //prints out analog value
delay(500); //delays the next analog reading by 500 ms or a half a second
if(signal > 199){ //if the analog value is less than 200, the object is within a few inches
digitalWrite(LEDPin, HIGH);
}
else{
digitalWrite(LEDPin, LOW);
}
}
No comments:
Post a Comment