$18.99
关于
This content features Bluetooth communication with an Arduino 2WD car. Assemble the car using an ESP32 DevKit V1, TB6612FNG driver, 2WD chassis, breadboard, M-F/M-M cables, battery holder, 18650 batteries, and a switch. Then, upload this sample code to the ESP32.
The code drives two DC motors via Bluetooth (Classic BT) using commands: F (Forward), B (Backward), L (Left), R (Right), and S (Stop). Each movement automatically stops after 300–400ms.
C++ void loop() { if (SerialBT.available()) { char command = SerialBT.read(); Serial.println(command); if (command == 'F') { moveForward(); delay(400); stopMotors(); } else if (command == 'B') { moveBackward(); delay(400); stopMotors(); } else if (command == 'L') { turnLeft(); delay(325); stopMotors(); } else if (command == 'R') { turnRight(); delay(325); stopMotors(); } else if (command == 'S') { stopMotors(); } } } The car operates once you add the specific motor control functions to this loop and upload it to the ESP32.
-
Select 1 of the 10 available maps.
-
Connect Bluetooth via the Options tab.
-
Controls: A (Reverse), B (Forward), Y (Right), X (Left), Right Joystick Click (View Camera).
-
Complete 5 laps to unlock autonomous driving.
支持的平台
相关游戏
免费
免费
$14.99
免费