القائمة الرئيسية

الصفحات

arduino traffic light beginners tutorial code كود مشروع ماكيت اشارة مرور بالاردوينو

تصميم رسمة برنامج بروتوس لاشارة مرور لماكيت المشروع
تصميم رسمة بروتوس اشارة مرور لماكيت المشروع 

هذا هو الكود المستخدم علي برنامج الاردوينو لعمل اشارة مرور بالاردوينو قم بنسخة علي البرنامج وحمله وخطوات عمل ماكيت اشارة مرور الخاص بمجموعة تدريب بنها الفرقة اولي اتصالات هندسة الشروق وكذلك رسمة البروتوس التي سيتم علي اساسها عمل مشروع الماكيت في التعليقات او الصور التوضيحية الاتية 

وهذ هو الاردوينو وال7 segment  واشارات المرور التي سيتم لصقها في الماكيت من اسفله او تحت ارضية الماكيت
وهذ هو الاردوينو وال7 segment  واشارات المرور التي سيتم لصقها في الماكيت من اسفله او تحت ارضية الماكيت 

arduino traffic light beginners tutorial code
نموذج لماكيت اشارة المرور الخاص بتدريب فرقة اولي اتصالات هندسة الشروق 

arduino traffic light beginners tutorial code



void setup()

{

  // initialize digital pins 1,2,3,4,5,6,7,8,9,10,11,12  outputs.

  pinMode(1, OUTPUT);                  // Main Waking Red

  pinMode(2, OUTPUT);                  // Main waking Green

  

  pinMode(3, OUTPUT);                  // OG

  pinMode(4, OUTPUT);                  // OY 

  pinMode(5, OUTPUT);                  // OR

  

  pinMode(6, OUTPUT);                  // MG    

  pinMode(7, OUTPUT);                  // MY

  pinMode(8, OUTPUT);                  // MR 

  

  pinMode(9, OUTPUT);                   // D        

  pinMode(10, OUTPUT);                  // C

  pinMode(11, OUTPUT);                  // B

  pinMode(12, OUTPUT);                  // A

}



 // the loop function runs over and over again forever

void loop()

 {

  redmain();

  nine();

  delay(1000);              // wait for a 0.5 second

  eight();

  delay(1000);             // wait for a 0.5 second

  seven();

  delay(1000);             // wait for a 0.5 second

  six();

  delay(1000);              // wait for a 0.5 second

  five();

  delay(1000);             // wait for a 0.5 second

  four();

  delay(1000);              // wait for a 0.5 second

  three();

  delay(1000);              // wait for a 0.5 second

  redandyellowmain();      

  two();

  delay(1000);             // wait for a 0.5 second

  one();

  delay(1000);              // wait for a 0.5 second

  zero();

  delay(1000);             // wait for a 0.5 second

  redother();

  nine();

  delay(1000);            // wait for a 0.5 second

  eight();

  delay(1000);              // wait for a 0.5 second

  seven();

  delay(1000);              // wait for a 0.5 second

  six();

  delay(1000);              // wait for a 0.5 second

  five();

  delay(1000);              // wait for a 0.5 second

  four();

  delay(1000);              // wait for a 0.5 second

  three();

  delay(1000);              // wait for a 0.5 second

  //redandyellowother();

  two();

  delay(1000);              // wait for a 0.5 second

  one();

  delay(1000);              // wait for a 0.5 second

  zero();

  delay(1000);              // wait for a 0.5 second

  

  }



void redmain()

  {

  digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(2, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(3, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(4, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(7, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage leve0)

  }

  

  void redandyellowmain()

  {

  digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(2, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(3, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage leve0)

  }

  

  void redother()

  {

  digitalWrite(1, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(4, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(5, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(6, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(7, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  }

  

  void redandyellowother()

  {

  digitalWrite(1, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(5, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(6, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage leve1)

  }

  

  void zero()

  {

  digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(11, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(12, LOW);   // turn the LED on (HIGH is the voltage leve0)

  }

  

  void one()

  {

  digitalWrite(9,LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(11, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)

  }

  

  void two()

  {

  digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(11, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(12, LOW);   // turn the LED on (HIGH is the voltage leve0)

  }

  

  void three()

  {

  digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(11, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)

  }

  

  void four()

  {

  digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(11, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(12, LOW);   // turn the LED on (HIGH is the voltage leve0)

  }

  

  void five()

  {

  digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(11, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)

  }

  

  void six()

  {

  digitalWrite(9, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(11, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(12, LOW);   // turn the LED on (HIGH is the voltage leve0)

  }

  

  void seven()

  {

  digitalWrite(9,LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(10, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(11, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)

  }

  

  void eight()

  {

  digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(10, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(11, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(12, LOW);   // turn the LED on (HIGH is the voltage leve0)

  }

  

  void nine()

  {

  digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(10, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(11, LOW);   // turn the LED on (HIGH is the voltage leve0)

  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)

  }

باقي المقال :


تعليقات

تعليق واحد
إرسال تعليق
  1. يا بشمهندس ستجد الكود المستخدم وبعد المشاريع الاخري وباقي المقال هنا
    مشروع ماكيت اشارة مرور و رسمة البروتوس والمكونات وشكل نهائي للمشروع
    https://www-communication.blogspot.com/2017/08/blog-post_4.html
    traffic light with arduino code
    https://www-communication.blogspot.com/2016/08/traffic-light-with-arduino-code.html

    ردحذف

إرسال تعليق