This is my first time in robotics and also for my research paper, so I apologize for my terrible knowledge of it. Anyway...
The robot I'm using is LAFVIN 2WD Smart Robot Car Kit V2. I've been trying for a few days to make it move, but to no avail. I used their IDE called Mixly but it still didn't move. Batteries are fine, The IR sensors works too and everything is connected properly (I think). I'm not really sure what more info I should add, but I'll try to provide them. Here's the code I used:
void setup(){
pinMode(2, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);
}
void loop(){
while (true) {
digitalWrite(2,HIGH);
analogWrite(5,50);
digitalWrite(4,LOW);
analogWrite(6,50);
delay(1000);
digitalWrite(2,LOW);
analogWrite(5,50);
digitalWrite(4,LOW);
analogWrite(6,50);
delay(1000);
digitalWrite(2,LOW);
analogWrite(5,50);
digitalWrite(4,HIGH);
analogWrite(6,50);
delay(1000);
digitalWrite(2,HIGH);
analogWrite(5,50);
digitalWrite(4,HIGH);
analogWrite(6,50);
delay(1000);
}
}
15 posts - 4 participants