---
# System prepended metadata

title: Arduino Car

---

# Arduino Car

### only L298N control

```clike=
void setup() {
  //46~53

  //for(參考值 ; 條件 ; 遞進式){}
  for(int x = 46 ; x < 54 ; x = x + 1) {
    pinMode(x,OUTPUT);
  }

  serial.begin(9600);

}

void loop() {


  digitalWrite(46,HIGH);
  digitalWrite(47,LOW);

  serial.print("46High \n")

  delay(1000);

}
```




```clike=
void setup(){
//46-53
  for (int x = 46 ; x < 54 ; x - 1){
 
  pinMode( x , OUTPUT); 
  }
  Serial.begin(9600);
}
void loop() {

  digitalWrite (46, HIGH);
  Serial.print("46HIGH \n");
  delay(1000);

}

```

-------------------------------------------------------

50    48
52    46
-------------------------------------------------
https://github.com/madsci1016/Arduino-PS2X

DATA --> 17
COMMAND -->16
Attention(CS) --> 15
CLOCK --> 14
https://blog.jmaker.com.tw/ps2x/
ps2x.NewButtonState