Maximum sensor distance is rated at 250cm. #define MAX_DISTANCE 250 // Maximum distance we want to ping for (in centimeters). #define ECHO_PIN A2 // Arduino pin tied to echo pin on the ultrasonic sensor. 2 TinkerKit connectors for the TWI interface (in white with 4 pins), one for input and the other one for output.#include // Include Servo Library #include // Include Newping Library // L298N Control Pins const int LeftMotorForward = 4 const int LeftMotorBackward = 5 const int RightMotorForward = 6 const int RightMotorBackward = 7 #define TRIGGER_PIN A1 // Arduino pin tied to trigger pin on the ultrasonic sensor. This dual bidirectional motor driver is based on the very popular L298 Dual H, -Bridge Motor Driver Integrated Circuit.2 TinkerKit connectors for two Aanlog Outputs (in orange in the middle), connected to PWM outputs on pins D5 and D6.2 TinkerKit connectors for two Analog Inputs (in white), connected to A2 and A3.Screw terminal to connect the motors and their power supply.The additional sockets on the shield are described as follow: If you don't need the Brake and the Current Sensing and you also need more pins for your application you can disable this features by cutting the respective jumpers on the back side of the shield. The shield's pins, divided by channel are shown in the table below: You can use each channel separately to drive two DC motors or combine them to drive one bipolar stepper motor. In total there are 8 pins in use on this shield. motors, which are used to drive windshield wipers, electric windows. This shield has two separate channels, called A and B, that each use 4 of the Arduino pins to drive or sense the motor. Aimed at both the educational and the hobbyist market, the VEX system is based. The shield can supply 2 amperes per channel, for a total of 4 amperes maximum. GND Ground on the screw terminal block.By cutting the "Vin Connect" jumper you make this a dedicated power line for the motor. An external power supply connected to this pin also provide power to the Arduino board on which is mounted. Vin on the screw terminal block, is the input voltage to the motor connected to the shield.You can program the controller to make the car do any number of driving patterns and stunts.
The absolute limit for the Vin at the screw terminals is 18V. Autonomous Control of RC Car Using Arduino: This instructable shows how to modify an inexpensive RC car so it can be controlled by an on-board microcontroller. This is possible by cutting the "Vin Connect" jumper placed on the back side of the shield. If your motor require more than 9V we recommend that you separate the power lines of the shield and the Arduino board on which the shield is mounted. To avoid possible damage to the Arduino board on which the shield is mounted, we reccomend using an external power supply that provides a voltage between 7 and 12V. The adapter can be connected by plugging a 2.1mm center-positive plug into the Arduino's board power jack on which the motor shield is mounted or by connecting the wires that lead the power supply to the Vin and GND screw terminals, taking care to respect the polarities. The required motor current often exceeds the maximum USB current rating.Įxternal (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. Because the L298 IC mounted on the shield has two separate power connections, one for the logic and one for the motor supply driver. The Arduino Motor Shield must be powered only by an external power supply.