@@ -4,20 +4,27 @@ const float carSpeed = 1.0;
44const long distanceToTravel = 40 ;
55const int degreesToTurn = 90 ;
66
7- BrushedMotor leftMotor (smartcarlib::pins::v2::leftMotorPins);
8- BrushedMotor rightMotor (smartcarlib::pins::v2::rightMotorPins);
7+ ArduinoRuntime arduino;
8+ BrushedMotor leftMotor (arduino, smartcarlib::pins::v2::leftMotorPins);
9+ BrushedMotor rightMotor (arduino, smartcarlib::pins::v2::rightMotorPins);
910DifferentialControl control (leftMotor, rightMotor);
1011
11- GY50 gyroscope (37 );
12+ GY50 gyroscope (arduino, 37 );
1213
1314const auto pulsesPerMeter = 600 ;
1415
1516DirectionlessOdometer leftOdometer (
16- smartcarlib::pins::v2::leftOdometerPin, []() { leftOdometer.update (); }, pulsesPerMeter);
17+ arduino,
18+ smartcarlib::pins::v2::leftOdometerPin,
19+ []() { leftOdometer.update (); },
20+ pulsesPerMeter);
1721DirectionlessOdometer rightOdometer (
18- smartcarlib::pins::v2::rightOdometerPin, []() { rightOdometer.update (); }, pulsesPerMeter);
22+ arduino,
23+ smartcarlib::pins::v2::rightOdometerPin,
24+ []() { rightOdometer.update (); },
25+ pulsesPerMeter);
1926
20- SmartCar car (control, gyroscope, leftOdometer, rightOdometer);
27+ SmartCar car (arduino, control, gyroscope, leftOdometer, rightOdometer);
2128
2229void setup ()
2330{
0 commit comments