A large portion of work for creating the PAC comes from implementing software read from sensors, trigger audio, and communicate with the LOBBYIST. 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 PAC.
Code Listing
The ADService periodically collects analog readings from two accelerometers on the magic carpet and calculates a weighted moving average of each signal. The tilt of the magic carpet was measured to create thrust and direction commands for the LOBBYIST.
|
|
|
The CAP1188_I2C_LIB contains helper functions that interface the Tiva with the CAP1188 integrated circuit over I2C. The CAP1188 is used to sense touch on the magic lamp which initiates a pair command.
|
|
|
The CapTouchDebounce module implements a state machine that debounces the magic lamp touch events transmitted by the CAP1188.
|
|
|
The I2C module contains functions for initializing, transmitting, and requesting I2C communication over Tiva's I2C1 module. I2C communication was used to interface the Tiva with the CAP1188 capacitive touch sensor.
|
|
|
The PACSM module is a state machine that implements the class-wide communications protocol and integrates the sensing modalities of our PAC into the communication protocol.
|
The ReceiveSM module is a state machine that implements receiving multi-byte UART communication messages from an XBee radio.
|
The TivaFunctions module is a small library of general use functions for using the Tiva's Hardware.
|
|
|
The TransmitSM is a state machine that transmits multi-byte UART messages and contains helper functions useful for XBee radio communication
|
The UART3TX is a state machine that transmits general multi-byte UART messages with Tiva's UART3 module. This module was used by the WAVTrigger module.
|
The WAVTrigger module is a library of functions useful for building UART messages for the WAV Trigger which is responsible for the playing and amplifying the polyphonic audio on the PAC. Dependent on the UART3TX module.
|
|