Red Signal Crossing by Karam : 3 Steps - hodgsonthille
Institution: Red Signal Crossing past Karam
ان المشروع مثل اشارة المرور بدون الون الاخضر مع عداد يعد
الى العشرة واذا تحرك شيئ امامها سوف تزمر و تبقا اشارة
امرور الحمراء مضيئة,انها تحمي اذا دخل شخص غريب الى
البيت او الفندق او المكتب او اي مكان اخر , او تستخدم الى
تعليم الاطفال كيف تعمل اشارة المرور .
Step 1:
PARTS:
1:SEVEN SEGMENTS.
2:Ultrasonic Ranging Faculty HC - SR04.
3:buzzer.
4:TWO RED (LEDS) .
5:WIRES.
6: Cardinal RESISTANC(RED,RED,BLACK,Atomic number 79)220 Georg Simon Ohm, And one Resistanc ( green, blue, brown, gold)561 OHM.
Step 2: Code
int trigPin = 13;
int echoPin = 12;
int led = 7;
int buzzer = 1;
//#define led2 11
int Sig1_G=11;
int Sig1_R =10;
int a = 2; //For displaying segment "a"
int b = 3; //For displaying segment "b"
int c = 4; //For displaying segment "c"
int d = 5; //For displaying segment "d"
int e = 6; //For displaying section "e"
int f = 8; //For displaying segment "f"
int g = 9; //For displaying section "g"
int i;
void frame-up() {
pinMode(a, End product); //A
pinMode(b, OUTPUT); //B
pinMode(c, OUTPUT); //C
pinMode(d, End product); //D
pinMode(e, OUTPUT); //E
pinMode(f, Production); //F
pinMode(g, OUTPUT); //G
pinMode(Sig1_G,OUTPUT);
pinMode(Sig1_R,OUTPUT);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(led, OUTPUT);
pinMode(buzzer,Output signal);
Ordered.begin(9600);
}
void displayDigit(int digit)
{
//Conditions for displaying segment a
if(figure!=1 && finger's breadth != 4)
digitalWrite(a,Broad);
//Conditions for displaying segment b
if(digit != 5 && figure != 6)
digitalWrite(b,HIGH);
//Conditions for displaying segment c
if(digit !=2)
digitalWrite(c,Top);
//Conditions for displaying segment d
if(finger's breadth != 1 && finger's breadth !=4 &adenosine monophosphate;& digit !=7)
digitalWrite(d,HIGH);
//Conditions for displaying segment e
if(digit == 2 || digit ==6 || digit == 8 || digit==0)
digitalWrite(e,HIGH);
//Conditions for displaying segment f
if(digit != 1 && digit !=2 && dactyl!=3 &adenylic acid;& digit !=7)
digitalWrite(f,Graduate);
if (digit!=0 && figure!=1 && digit !=7)
digitalWrite(g,Utmost);
//digitalWrite(Sig1_G,Treble);
}
void crossRedsignal()
{
digitalWrite(bell,LOW);
lank continuance, length;
digitalWrite(trigPin, LOW); // Added this wrinkle
delayMicroseconds(2); // Added this line
digitalWrite(trigPin, HIGH);
// delayMicroseconds(1000); - Remote this line
delayMicroseconds(10); // Added this melodic phras
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
if (distance < 100) { // This is where the LED On/Off happens
digitalWrite(led,HIGH); // When the Red condition is met, the Common LED should turn off
// digitalWrite(led2,LOW);
}
other {
digitalWrite(led,LOW);
//digitalWrite(led2,HIGH);
}
if (distance >= 200 || outdistance <= 0){
Asynchronous.println("Out of range");
}
else {
Serial.print(distance);
Serial.println(" centimetre");
// digitalWrite(led,HIGH);
}
delay(500);
}
void turnOff()
{
digitalWrite(a,Miserable);
digitalWrite(b,LOW);
digitalWrite(c,LOW);
digitalWrite(d,Low-spirited);
digitalWrite(e,LOW);
digitalWrite(f,LOW);
digitalWrite(g,LOW);
// delay(2000);
}
void loop() {
for( i=0;i<10;i++)
{
displayDigit(i);
crossRedsignal();
digitalWrite(Sig1_G,HIGH);
digitalWrite(Sig1_R,HIGH);
delay(1000);
turnOff();
}
if ( i = 10) {digitalWrite(Sig1_G,LOW);digitalWrite(Sig1_R,Short); delay(1000);}
//crossRedsignal();
}
Whole tone 3:
Represent the First to Share
Recommendations
-
Anything Goes Contest 2022
Source: https://www.instructables.com/Red-Signal-Crossing-by-Karam/
Posted by: hodgsonthille.blogspot.com
0 Response to "Red Signal Crossing by Karam : 3 Steps - hodgsonthille"
Post a Comment