A large portion of work for creating the LOBBYIST comes from implementing software to control fans, motors, and lights at the appropriate times. If your curious as to what that looks like, below is a detailed code listing of the software that went into the final version of our LOBBYIST. It includes code in C that went on our TIVA as well as assembly code that was used to program a PIC on the LOBBYIST.
Code Listing
The DMCTransmitSM is a state machine that transmits a UART message to the PIC operating the Display of Memory and Commitment (DMC). The main Lobbyist state machine posts to this state machine when it needs to transmit an array of bytes to the DMC.
|
|
|
dmctransmitsm_statediagram.pdf | |
File Size: | 8 kb |
File Type: |
The dmc_main module is a service written in assembly language that interprets the UART message from the Lobbyist TIVA and instructs the PIC to perform the appropriate action. Overall, this service controls the position of the Lobbyist timing mechanism (the acrylic genie) as well as Lobbyist team color display.
|
|
The LaunchServoService is a state machine that actuates the servo powered swords on the sides of the Lobbyist to swing out and go back in. The main Lobbyist state machine posts to this state machine when it wants to initiate the swinging event.
|
|
|
launchservoservice_statediagram.pdf | |
File Size: | 7 kb |
File Type: |
The LiftFunctions module is a service that includes public functions that initialize and actuate the lift fan.
|
|
|
The LobbyistSM is the main state machine that oversees all functionalities on the Lobbyist. It pairs up with a PAC and communicates with it based on the class-wide communication protocol. It then operates the lift fan, the drive propellers, the sword servos, and commands to the DMC accordingly.
|
|
|
lobbyist_state_diagram.pdf | |
File Size: | 266 kb |
File Type: |
The PropulsionDirection module includes helper functions that take in thrust and direction commands and turns these numbers to desired duty cycles on the PWM signals that drive the propellers based on our team's drive algorithm. Additionally, because one motor is more powerful than the other, offsets are built into the software in order to account for the differing thrust capabilities.
|
|
|
The ReceiveSM module is a state machine that implements receiving multi-byte UART communication messages from an XBee radio.
|
|
|
communications_receive_state_machine.pdf | |
File Size: | 13 kb |
File Type: |
The SetDutyCycle module includes functions that adjust the PWM duty cycles that drive the propellers.
|
|
|
The TransmitSM is a state machine that transmits multi-byte UART messages and contains helper functions useful for XBee radio communication
|
|
|
communications_transmit_state_machine.pdf | |
File Size: | 8 kb |
File Type: |