linefollower 2.2.0
linefollower


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

Application Init

Application Init performs logger and Click Initialization.

void application_init ( void )
{
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" );
// Click initialization.
LINEFOLLOWER_MAP_MIKROBUS( cfg, MIKROBUS_1 );
linefollower_init( &linefollower, &cfg );
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.

void application_task ( void )
{
linefollower_data_track ( &linefollower, &data_track );
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.