Open thrust vector control (opentvc) is a model rocket flight firmware that is built to runs on the hyphen flight computer.
The firmware features libaries that supports control for servos, USART, SPI and the on-board hardware.
Data is sent from an AVR microcontroller via UART and received by Nordic nRF5832 BLE module.
This exchage is biodirectional so data can also be sent out from the BLE module to AVR microcontroller.
- Build docker environment
docker build -t opentvc:0.5 .
- Run docker environment
docker run -it opentvc:0.5
- Change directory to where source file sits
cd board
- Build firmware
make
#include "drivers/servo.h"
int main(void) {
servoInit(); // Configures 16 bit registers for 50Hz PWM signal.
servoAttach(Y_SERVO);
servoAttach(Z_SERVO);
while(1) {
servoWriteY(0); // Write angle 0 to servo controlling Y axis
servoWriteZ(0); // Write angle 0 to servo controlling Z axis
}
return 0;
}
- board -- Code that runs on the ATmega328/328P
- doc -- Doxygen documentation folder
board
├── fxas21002 # Library used for retrieving gyroscope data
├── fxos8700cq # Library used for retrieving accelerometer and magnetometer data
├── servo # Library used for servo control
├── usart # Library used for USART communication
├── time # Library used timing events
├── spi # Library used for SPI communication
├── hardware # Library used to control on-board hardware
├── firmware # Folder that holds compiled firmware