-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2a3662
commit ffbdb6f
Showing
8 changed files
with
76 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
Ardunio_2Wheel_Robot_Boilerplate/myAIDriver/Ultrasonic.cpp
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 6 additions & 14 deletions
20
Ardunio_2Wheel_Robot_Boilerplate/myAIDriver/myAIDriver.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,26 @@ | ||
#include "AIDriver.h" | ||
#include "Ultrasonic.h" | ||
|
||
//Instantiate a Ultrasonic Sensor called 'distanceRanger' | ||
Ultrasonic distanceRanger(6, 7); | ||
|
||
// Declare a pointer to a AIDriver object | ||
// Declare a pointer to a AIDriver object | ||
AIDriver *mrJonesDriving; | ||
|
||
void setup(){ // sets up once as the program starts | ||
//Configure and debug the serial monitor | ||
Serial.begin(9600); | ||
Serial.println("Debug Serial Monitor"); | ||
|
||
//Instantiate a two wheeled to the pointer 'mrJonesDriving' | ||
// Instantiate a two wheeled to the pointer 'mrJonesDriving' | ||
mrJonesDriving = new AIDriver(); | ||
} | ||
|
||
void loop(){ // loops continuously 50 times a second | ||
// Read the distanceRanger ulstrasonic sensor and return the object distance in mm | ||
Serial.println(distanceRanger.read()); | ||
Serial.println(mrJonesDriving->read()); | ||
|
||
//obj->doSomething(); in this case make the object mrJonesDriving rotate to the right at a speed of 200 | ||
// obj->doSomething(); in this case make the object mrJonesDriving rotate to the right at a speed of 200 | ||
mrJonesDriving->rotateRight(125); // speed can be between 0-255 | ||
// wait 2000 milliseconds or 2 seconds | ||
delay(2000); | ||
mrJonesDriving->rotateLeft(125); | ||
delay(2000); | ||
//Make mrJonesDriving drive forward left wheel speed 200 and right wheel speeed 200 | ||
// Make mrJonesDriving drive forward left wheel speed 200 and right wheel speeed 200 | ||
mrJonesDriving->driveForward(125,125); | ||
delay(2000); | ||
mrJonesDriving->driveBackward(125,125); | ||
delay(2000); | ||
} | ||
} |
Oops, something went wrong.