Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
added comments
  • Loading branch information
KenwoodFox committed Oct 2, 2018
1 parent 9df0e62 commit 1070a51
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion MiniChallenge3/portOperation.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ task portOperation()
}
else //if the switch is not pressed
{
stopMotor(portMotor);
stopMotor(portMotor); //stop the motor
}
}
}
16 changes: 8 additions & 8 deletions MiniChallenge3/source.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@
Looks good to me doc
*/

int error = 0;
int error = 0; //the error variable here can be changed to throw during an adverse condition

task main()
{
startTask(portOperation);
startTask(portOperation); //start the two task threads
startTask(starboardOperation);
while(error < 1)
while(error < 1) //as long as no errors are thrown
{
if(SensorValue(ultrasonic) > 4)
if(SensorValue(ultrasonic) > 4) //In pragma we set our ultrasonic to read inches, so imputting 4 here is equal to four inches
{
turnLEDOn(LEDOne);
turnLEDOn(LEDOne); //turn on the LED if in range, and stop the servo
stopMotor(servo);
}
else
else //while not in range
{
turnLEDOff(LEDOne);
turnLEDOff(LEDOne); //turn the led off and the servo on
startMotor(servo, 90);
}
delay(30);
delay(30); //altocate CPU time for other tasks
}
}
4 changes: 2 additions & 2 deletions MiniChallenge3/starboardOperation.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
task starboardOperation()
{
int MAGICREVO = 1200;
int MAGICREVO = 1200; //magic revo is a magical time based integer and is not actualy reading the rotation of the motors

while(true)
{
Expand All @@ -17,7 +17,7 @@ task starboardOperation()
}
else //if the switch is pressed
{
stopMotor(starboardMotor);
stopMotor(starboardMotor); //stop the motor
}
}
}

0 comments on commit 1070a51

Please sign in to comment.