joystick3
2.1.0.0
|
Joystick 3 Click is a compact add-on board that can fulfill your directional analog input needs. This board features 2765, a high-quality mini 2-axis analog output thumbstick from Adafruit Industries. This small joystick is a 'self-centering' analog-type with a black rocker cap similar to the PSP joysticks. It comprises two 10kΩ potentiometers, one for up/down and another for left/right direction. Knowing that this joystick represents an analog type, it connects with mikroBUS™ through the SPI interface through the MCP3204 12-bit A/D converter.
We provide a library for the Joystick 3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for Joystick 3 Click driver.
joystick3_cfg_setup
Config Object Initialization function. joystick3_init
Initialization function. joystick3_default_cfg
Click Default Configuration function. joystick3_read_raw_adc
This function reads the raw ADC for X and Y axis by using SPI serial interface. joystick3_get_angle
This function calculates and returns joystick angle in degrees from raw ADC values for X and Y axis. joystick3_get_position
This function calculates and returns joystick position flag from raw ADC values for X and Y axis. This example demonstrates the use of the joystick 3 click board by reading
and displaying the raw ADC for X and Y axis, as well as the joystick angle and position calculated from those ADC readings.
The demo application is composed of two sections :
Initializes the driver and logger.
Reads the raw ADC measurements for X and Y axis, and calculates the joystick angle and position
from those readings. The results will be displayed on the USB UART approximately every 100ms.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.