ECE4760 - Laser Projector (ipb7, jcc384, pfc38)
1
Raster Laser Projection
|
Analog joystick input. More...
#include "joystick.h"
Go to the source code of this file.
Functions | |
void | joystick_init (void) |
Initialize joystick state and peripherals. More... | |
struct joystick_vect | joystick_get_pos (void) |
Get most recent recorded joystick direction. More... | |
bool | joystick_pushed (void) |
Whether the joystick button is pressed. More... | |
Analog joystick input.
Definition in file joystick.c.
struct joystick_vect joystick_get_pos | ( | void | ) |
Get most recent recorded joystick direction.
The ADC is constantly converting, this returns the most recently sampled vector of the joystick position. This should be polled as frequently as desired, there is no notion of "consuming" a value.
Definition at line 111 of file joystick.c.
void joystick_init | ( | void | ) |
|
inline |
Whether the joystick button is pressed.
Inteded to be polled. Any event-ish view should be provided by a state machine that consumes this.
Definition at line 148 of file joystick.c.