hbridge3 2.0.0.0
main.c File Reference

HBridge3 Click example. More...

#include "board.h"
#include "log.h"
#include "hbridge3.h"

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

uint8_t motor_direction = 0
 

Detailed Description

HBridge3 Click example.

Description

H-bridge in general, allows the current to flow in one or another direction. This click is used for driving a H-Bridge motor by changing output states. The outputs can be pulse width modulated at frequencies up to 20kHz by means of PWM/DIR control.

The demo application is composed of two sections :

Application Init

Initializes SPI and LOG modules, AN, RST, CS and PWM pins

Application Task

This example demonstrates the use of H-Bridge 3 Click board, by running dc motor in both directions - increasing and decreasing PWM duty cycle. Results are being sent to the Usart Terminal where you can track their changes.

Author
Nikola Peric

Function Documentation

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

Variable Documentation

◆ motor_direction

uint8_t motor_direction = 0