This repository has been archived by the owner on Jul 31, 2022. It is now read-only.
-
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.
Merge pull request #6 from KenwoodFox/prototype
Housekeeping
- Loading branch information
Showing
3 changed files
with
25 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
task blink() | ||
{ | ||
//int blinkState = true; | ||
while(true) | ||
while(true) //forever... | ||
{ | ||
while(SensorValue(bumpSwitch) == true) //If you are holding the bump switch | ||
{ | ||
turnLEDOn(LEDOne); | ||
delay(1000); //...do the code | ||
turnLEDOff(LEDOne); | ||
delay(1000); //more code | ||
turnLEDOn(LEDOne); //turn on the LED | ||
delay(1000); //wait.. | ||
turnLEDOff(LEDOne); //turn it off | ||
delay(1000); //this second wait is here, beacuse as it loops, there needs to be a delay between turning off and then turning back on | ||
} | ||
} | ||
} |
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,11 +1,12 @@ | ||
void motorInit() | ||
{ | ||
int rev = 1000; | ||
//motor init | ||
startMotor(starboardMotor, 80); | ||
int rev = 1000; //this is the revolution duration variable, it exists only inside motorInit, | ||
|
||
//motor init | ||
startMotor(starboardMotor, 80); //start both motors going forward at power 80 out of 127 pwm | ||
startMotor(portMotor, 80); | ||
delay(rev); //adjust me! 1 rev | ||
stopMotor(starboardMotor); | ||
stopMotor(starboardMotor); //stop both motors and wait two seconds | ||
stopMotor(portMotor); | ||
delay(2000); //delay for 2 seconds | ||
} |
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