mirror of
https://github.com/Sovichea/avr-i2c-library.git
synced 2025-10-16 07:54:47 +03:00
Small fixes
This commit is contained in:
26
twi_test.c
26
twi_test.c
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* TWI_Test.c
|
* TWI_Test.c
|
||||||
*
|
*
|
||||||
* Created: 08-Jun-19 10:06:47 AM
|
* Created: 08-Jun-19 10:06:47 AM
|
||||||
* Author : TEP SOVICHEA
|
* Author : TEP SOVICHEA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "uart.h"
|
#include "uart.h"
|
||||||
#include "twi_master.h"
|
#include "twi_master.h"
|
||||||
@@ -103,21 +103,21 @@ void mpu_get_accel(mpu_data_t* mpu_data)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* Initialize UART */
|
/* Initialize UART */
|
||||||
uart_init(250000); // bps
|
uart_init(250000); // bps
|
||||||
cli_reset();
|
cli_reset();
|
||||||
puts(BY "Initializing TWI_Test Project...\n" RESET);
|
puts(BY "Initializing TWI_Test Project...\n" RESET);
|
||||||
|
|
||||||
/* Initialize project configuration */
|
/* Initialize project configuration */
|
||||||
tw_init(TW_FREQ_400K, true); // set I2C Frequency, enable internal pull-up
|
tw_init(TW_FREQ_400K, true); // set I2C Frequency, enable internal pull-up
|
||||||
mpu_init();
|
mpu_init();
|
||||||
mpu_data_t accel;
|
mpu_data_t accel;
|
||||||
|
|
||||||
puts(BG CURSOR_RIGHT("14")
|
puts(BG CURSOR_RIGHT("14")
|
||||||
"--------------- Application Started ---------------\n" RESET);
|
"--------------- Application Started ---------------\n" RESET);
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
puts("Read accelerometer data.");
|
puts("Read accelerometer data.");
|
||||||
mpu_get_accel(&accel);
|
mpu_get_accel(&accel);
|
||||||
printf("Accel X: %5.2f\n", accel.x);
|
printf("Accel X: %5.2f\n", accel.x);
|
||||||
|
Reference in New Issue
Block a user