-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MINDS-i/use-common-libs
Update examples; use common libs
- Loading branch information
Showing
12 changed files
with
1,899 additions
and
11 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
examples/1-Calibration/SprayerTrailerServoCalibration/SprayerTrailerServoCalibration.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <Servo.h> | ||
|
||
/*************************************************** | ||
/ Example provided by MINDS-i | ||
/ Try checking out our arduino resource guide at | ||
/ http://mindsieducation.com/programming-resources | ||
/ Questions? Concerns? Bugs? email [email protected] | ||
/ | ||
/ This example is to be used to set the open position | ||
/ of the MINDS-i Sprayer Trailer servos attached to | ||
/ pin 2 and pin 3 | ||
/***************************************************/ | ||
|
||
Servo leftBase, rightBase; | ||
|
||
void setup() { | ||
// Defines the pins the servos and ESC are plugged into | ||
leftBase.attach(2); | ||
rightBase.attach(3); | ||
|
||
// Sets the starting position for the servos and ESC | ||
leftBase.write(135); //135 closed - 45 open | ||
rightBase.write(45); // 45 closed - 135 open | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
examples/2-Application/ProjectTrailerTemplate/ProjectTrailerTemplate.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <MINDS-i-Common.h> | ||
#include <Servo.h> | ||
|
||
/*************************************************** | ||
/ Example provided by MINDS-i | ||
/ Try checking out our arduino resource guide at | ||
/ http://mindsieducation.com/programming-resources | ||
/ Questions? Concerns? Bugs? email [email protected] | ||
/ | ||
/ This example template will change the angle of | ||
/ 2 servos based on the input from the tractor or a | ||
/ RC receiver plugged in to pin 7. | ||
/ | ||
/ The tractor will signal the trailer to run the code | ||
/ in "trailerOn" when it reaches a waypoint tagged | ||
/ trailer on. It will in turn run the code in | ||
/ "trailerOff" whenever it reaches a non tagged waypont. | ||
/***************************************************/ | ||
|
||
namespace minds_i_comms = minds_i_common::comms; | ||
|
||
Servo servo1, servo2; | ||
|
||
void setup() { | ||
servo1.attach(2); | ||
servo2.attach(3); | ||
|
||
servo1.write(90); | ||
servo2.write(90); | ||
} | ||
|
||
void loop() { | ||
if (minds_i_comms::getRadio(7) > 90) { | ||
trailerOn(); | ||
} else { | ||
trailerOff(); | ||
} | ||
} | ||
|
||
void trailerOff() { | ||
servo1.write(45); | ||
servo2.write(135); | ||
} | ||
|
||
void trailerOn() { | ||
servo1.write(135); | ||
servo2.write(45); | ||
} |
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
8 changes: 8 additions & 0 deletions
8
examples/3-Navigation-Controller/EncoderPingDriver/Encoder.cpp
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
#include "Encoder.h" | ||
|
||
// Yes, all the code is in the header file, to provide the user | ||
// configure options with #define (before they include it), and | ||
// to facilitate some crafty optimizations! | ||
|
||
Encoder_internal_state_t* Encoder::interruptArgs[]; |
Oops, something went wrong.