วันอาทิตย์ที่ 20 มีนาคม พ.ศ. 2565

PJ#1 ไฟเลี้ยววิ่งรถหรู 2รูปแบบ ทุกคนสามารถทำเล่นเองได้ที่บ้าน

 https://www.youtube.com/watch?v=Cx847aXOeJY


โค้ดส่งฟรี Shopee https://shope.ee/6ze2MNCRiS


PJ#1 ไฟเลี้ยววิ่งรถหรู 2รูปแบบ ทุกคนสามารถทำเล่นเองได้ที่บ้าน

20/3/2565 SONGCHAI PRAPATRUNGSEE

 

/*songDIY

 * 20/3/2022

 */

void setup() {

  // initialize digital pin LED_BUILTIN as an output.

  pinMode(0, OUTPUT);

  pinMode(1, OUTPUT);

  pinMode(2, OUTPUT);

  pinMode(3, OUTPUT);

  pinMode(4, OUTPUT);

  pinMode(5, OUTPUT);

  pinMode(6, OUTPUT);

  pinMode(7, OUTPUT);

  pinMode(8, OUTPUT);

  pinMode(9, OUTPUT);

  pinMode(10, OUTPUT);

  pinMode(11, OUTPUT);

  pinMode(12, OUTPUT);

}


// the loop function runs over and over again forever

void loop() {

//  digitalWrite(12, HIGH); //PATTERN1 

//  digitalWrite(11, HIGH);

//  digitalWrite(10, HIGH);

//  delay(34);

//  digitalWrite(9, HIGH);

//  digitalWrite(8, HIGH);

//  digitalWrite(7, HIGH);

//  delay(34);

//  digitalWrite(6, HIGH);

//  digitalWrite(5, HIGH);  

//  digitalWrite(4, HIGH);

//  delay(34);

//  digitalWrite(3, HIGH);

//  digitalWrite(2, HIGH);

//  digitalWrite(0, HIGH);  

//  digitalWrite(1, HIGH);

//  delay(248);


  digitalWrite(12, HIGH); //PATTERN2 

  delay(20);

  digitalWrite(11, HIGH);

  delay(20);

  digitalWrite(10, HIGH);

  delay(20);

  digitalWrite(9, HIGH);

  delay(20);  

  digitalWrite(8, HIGH);

  delay(20);

  digitalWrite(7, HIGH);

  delay(20);

  digitalWrite(6, HIGH);

  delay(20);

  digitalWrite(5, HIGH);  

  delay(20);

  digitalWrite(4, HIGH);

  delay(20);

  digitalWrite(3, HIGH);

  delay(20);

  digitalWrite(2, HIGH);

  delay(20);

  digitalWrite(0, HIGH);  

  delay(20);

  digitalWrite(1, HIGH);

  delay(110);


  digitalWrite(0, LOW);  

  digitalWrite(1, LOW);

  digitalWrite(2, LOW);

  digitalWrite(3, LOW);  

  digitalWrite(4, LOW);

  digitalWrite(5, LOW);

  digitalWrite(6, LOW);

  digitalWrite(7, LOW);  

  digitalWrite(8, LOW);

  digitalWrite(9, LOW);

  digitalWrite(10, LOW);

  digitalWrite(11, LOW);  

  digitalWrite(12, LOW);

  delay(350);

}



 

 


ไม่มีความคิดเห็น: