Kinetic Sculpture
3.1
Software to Architecture for the Junior Kinetic Sculpture Project
|
#include <Disc.h>
Public Member Functions | |
Disc (Motor *attachedMotor) | |
void | updateSpeed (float desiredRpm) |
unsigned long | getRotationsPerMinute () |
void | setISR () |
void | turnOnMotor () |
void | turnOffMotor () |
void | runDisc (double percent) |
void | runDiscRandomly () |
bool | setMinMotorPercentage (byte percent) |
bool | setMaxMotorPercentage (byte percent) |
Public Attributes | |
Motor * | motor |
Disc Class
Class that represents a disc (front or back disc) on the Kinetic Sculpture. Written by Wade Varesio & Courtney McIntosh 05/13/2019
|
inline |
|
inline |
Updates power sent to motors
Checks if the current RPM of each motor is greater or less than the desired RPM. If it is less, the motor is sped up, and if it is greater, the motor slows down is slowed down. It is also ensured that the motor will spin in the right direction by sending a positive or negative percentage when needed.
desiredRpm | the desired RPM at which the motor would spin. Max desiredRpm is 30RPM |
|
inline |
Get the rotations per minute
|
inline |
Set the interrupt service routine for the associated tachometer
|
inline |
Forwards the call to turnOnMotor() to the appropriate Motor object using pointers
|
inline |
Forwards the call to turnOffMotor() to the appropriate Motor object using pointers
|
inline |
Forwards the call to runMotor() to the appropriate Motor object using pointers
percent | the percent at which you want the motor to run at |
|
inline |
Run the disc in a random fashion.
Determines a random speed (RPM) and direction to run the disc at
|
inline |
Set the minimum percent nedded to run this discs motor at
percent | the minimum percent needed to run the motor at. Must be non negative and less than 100 or the request will be ignored |
|
inline |
Set the maximum amount of power the motor is allowed to run at
percent | the new maximum amount of power the motor is allowed to run at. Must be greater than setMinimumUsablePercent but less than or equal to 100. |