We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2018-10-05
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 4285 times
Not followed.
License: MIT license
Microwave 2 click is an accurate and reliable short to medium range motion detection Click board, based on a Doppler radar principle.
Do you want to subscribe in order to receive notifications regarding "Microwave 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Microwave 2 click" changes.
Do you want to report abuse regarding "Microwave 2 click".
Library Description
This library provides generic functions for communication with the click board.
Key functions:
uint8_t microwave2_readByte();
- Function for reading a byte of data from the serial port.uint8_t microwave2_byteReady();
- Function for testing if a byte has been received from the click board.void microwave2_uartHandler(uint8_t *packegBuffer, uint8_t rData);
- Handler function for byte's received from the click board.uint8_t microwave2_checkTrafic();
- Function will give different return values depending on the data handled in the handler function.Example description
The application is composed of three sections :
void applicationTask()
{
char tmp;
char rDat;
if( microwave2_byteReady() )
{
rDat=microwave2_readByte();
microwave2_uartHandler(&buf,rDat);
}
tmp = microwave2_checkTrafic();
if(tmp == MICROWAVE2_MOVING_CLOSER)
{
mikrobus_logWrite("Approaching",_LOG_LINE);
}
if(tmp == MICROWAVE2_STOPPED_MOVING)
{
mikrobus_logWrite("No movesment",_LOG_LINE);
}
if(tmp == MICROWAVE2_MOVING_AWAY)
{
mikrobus_logWrite("Moving away",_LOG_LINE);
}
}
Other mikroE Libraries used in the example:
Additional notes and information
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.