รบกวนผู้รู้ อธิบาย Code Arduino แต่ละตัวให้หน่อยครับ

void loop()
{
  unsigned char i=0;
  LED8(17,2);
    delay(500);
  LED8(17,8);
    delay(500);
  LED8(17,32);
    delay(500);
  LED8(17,128);
    delay(500);
 

}

void loop()
{
   unsigned char i=0;
  LED8(17,i+2);
    delay(500);
  LED8(17,i+8);
    delay(500);
  LED8(17,i+32);
    delay(500);
  LED8(17,i+128);
    delay(500);

}

void loop()
{
  LED8(17,0b00000001);
    delay(500); 
  LED8(17,0b00000010);
    delay(500); 
  LED8(17,0b00000100);
    delay(500);
  LED8(17,0b00001000);
    delay(500);
  LED8(17,0b00010000);
    delay(500); 
  LED8(17,0b00100000);
    delay(500); 
  LED8(17,0b01000000);
    delay(500);
  LED8(17,0b10000000);
    delay(500);
  LED8(17,0b01000000);
    delay(500);
  LED8(17,0b00100000);
    delay(500);
  LED8(17,0b00010000);
    delay(500);
  LED8(17,0b00001000);
    delay(500);
  LED8(17,0b00000100);
    delay(500);
  LED8(17,0b00000010);
    delay(500);
  LED8(17,0b00000001);
    delay(500);

}

void loop()
{
  motor(1,100);
    delay(500);
  //motor(1,-100);
   // delay(500);
   if(sw1())
   {
   motor_stop(ALL);
   while(ALL);
   }

}

void setup()
{
  sw_OK_press();
}

void loop()
{
  if(sw_OK())
  {
  motor (1,40);
  motor (2,40);
  sleep(1000);
  }
  
  if(sw1())
  {
    motor_stop(ALL);
  }

}

void setup()
{
  sw_OK_press();
}

void loop()
{
 
  {
    sw_OK_press();
   glcd(1,2,"Forward");
  motor (1,50);
  motor (2,40);
  sleep(1000);
  delay(500);
  motor_stop(ALL);
  }
      {
         sw_OK_press();
       glcd(1,2,"Backward");
      motor (1,-50);
      motor (2,-40);
      sleep(1000);
      delay(500);
      motor_stop(ALL);
      }
            
        {
           sw_OK_press();
         glcd(1,2,"SpinLeft");
        motor (1,50);
        motor (2,-40);
        sleep(1000);
        delay(1500);
        motor_stop(ALL);
        }
        
             
            {
               sw_OK_press();
             glcd(1,2,"SpinRight");
            motor (1,-50);
            motor (2,40);
            sleep(1000);
            delay(1500);
            motor_stop(ALL);
            }
                
                {
                   sw_OK_press();
                  tr(50);
                  glcd(1,2,"TurnLeft");
                  sleep(1000);
                  delay(1500);
                  motor_stop(ALL);
                }
                   
                    {
                       sw_OK_press();
                      tl(50);
                      glcd(1,2,"TurnRight");
                      sleep(1000);
                      delay(1500);
                      motor_stop(ALL);
                    }
                      
                      {
                         sw_OK_press();
                       glcd(1,2,"ALL Motor Stop");
                       sleep(1000);
                       delay(1500);
                       motor_stop(ALL);
                      }

}

#include <ipst.h>

void setup()
{
  sw_OK_press();
}

void loop()
{
 
  {
    sw_OK_press();
  motor (1,50);
  motor (2,40);
  sleep(1000);
  delay(150);
  tl(30);
  sleep(1000);
  delay(200);
  motor (1,50);
  motor (2,40);
  sleep(1000);
  delay(80);
  tl(30);
  sleep(1000);
  delay(200);
  motor (1,50);
  motor (2,40);
  sleep(1000);
  delay(150);
  tl(30);
  sleep(1000);
  delay(200);
  motor (1,50);
  motor (2,40);
  sleep(1000);
  delay(80);
  tl(30);
  sleep(1000);
  delay(200);
  motor_stop(ALL);
  }
}
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่