Line Follower Click
Line Follower Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Nenad Filipovic
- Date : Dec 2019.
- Type : GPIO type
Software Support
Example Description
Line Follower Click carries an array of five QRE1113 miniature reflective object sensors, reading staus of AN, RST, PWM, TX and RX pins and reading tracking data.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.LineFollower
Example Key Functions
- linefollower_cfg_setup Config Object Initialization function.
void linefollower_cfg_setup(linefollower_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition linefollower.h:150
- linefollower_init Initialization function.
LINEFOLLOWER_RETVAL linefollower_init(linefollower_t *ctx, linefollower_cfg_t *cfg)
Initialization function.
Click ctx object definition.
Definition linefollower.h:135
- linefollower_default_cfg Click Default Configuration function.
- linefollower_data_track Get status of all pin function.
void linefollower_data_track(linefollower_t *ctx, linefollower_direction_t *data_track)
Get status of all pin function.
Definition linefollower.h:177
Application Init
Application Init performs logger and Click Initialization.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_printf( &logger, "----------------------\r\n" );
log_printf( &logger, " - Application Init -\r\n" );
log_printf( &logger, "----------------------\r\n" );
log_printf( &logger, " Line Follower Click \r\n" );
log_printf( &logger, "----------------------\r\n" );
}
#define LINEFOLLOWER_MAP_MIKROBUS(cfg, mikrobus)
Definition linefollower.h:64
void application_init(void)
Definition main.c:38
Application Task
Application Task shows the functionality of the Line Follower Click. Each one of the QRE1113 sensors consist of an infrared transmitter and infrared receiver. By default the sensor output a Logic Level 1, until they encounter a white surface which changes the output signal to 0.
{
log_printf( &logger, " %u\t%u\t%u\t%u\t%u\r\n",
(uint16_t) data_track.
u1,
(uint16_t) data_track.
u2,
(uint16_t) data_track.
u3,
(uint16_t) data_track.
u4,
(uint16_t) data_track.
u5);
Delay_ms ( 100 );
}
void application_task(void)
Definition main.c:67
uint8_t u3
Definition linefollower.h:180
uint8_t u4
Definition linefollower.h:181
uint8_t u5
Definition linefollower.h:182
uint8_t u1
Definition linefollower.h:178
uint8_t u2
Definition linefollower.h:179
Note
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.