-
Notifications
You must be signed in to change notification settings - Fork 1
1. Control Interface
The Control Interface comprises various classes and methods to control the different components of the fossbot. Below is a detailed list of the classes along with their corresponding methods:
Handles the timer of the fossbot.
Stops the timer.
Starts the timer.
Prints the elapsed time from start.
Returns (int) the elapsed time in seconds.
Handles the motors of the fossbot.
Set the motor speed immediately within the range of 0 to 100.
-
Param:
-
speed
(int): The speed value to be set (0-100).
-
Change motor direction to input direction.
-
Param:
-
direction
(str): The direction to be headed to.
-
Start moving motor with default speed towards input direction.
-
Param:
-
direction
(str): The direction to be headed to. Defaults to "forward".
-
Stops the motor.
Handles the odometer of the fossbot.
Increases the total steps by one.
Returns (int) the total number of steps.
Returns (float) the total number of revolutions.
Returns (float) the total distance traveled so far (in cm).
Resets the total traveled distance and revolutions.
Handles the ultrasonic sensor of the fossbot.
Gets the distance to the closest obstacle. Returns (float) the distance to the closest obstacle (in cm).
Handles the accelerometer of the fossbot.
Gets the acceleration for a specific dimension.
-
Param:
-
dimension
(str): The dimension requested.
-
- Returns (float): The acceleration for the specified dimension.
Gets the gyroscope for a specific dimension.
-
Param:
-
dimension
(str): The dimension requested.
-
- Returns (float): The gyroscope for the specified dimension.
Handles the analogue readings of the fossbot.
Gets the reading of a specific sensor specified by the input pin.
-
Param:
-
pin
(int): The pin of the sensor.
-
- Returns (float): The reading of the requested sensor.
Handles the noise detection of the fossbot.
Returns (bool) True only if noise was detected.
Handles the general input of the fossbot.
Returns (int) the state (0 or 1).
Handles the general output of the fossbot.
Sets the output pin to High.
Sets the output pin to Low.
Handles the LED of the fossbot.
Changes the color of the LED.
-
Param:
-
color
(str): The desired color. To turn off the LED, usecolor == 'closed'
.
-