/**************************************************************************//**
* [url=home.php?mod=space&uid=288409]@file[/url] main.c
* [url=home.php?mod=space&uid=895143]@version[/url] V1.00
* $Revision: 4 $
* $Date: 15/09/04 2:22p $
* [url=home.php?mod=space&uid=247401]@brief[/url] NUC200 Series I2S Controller Sample Code
*
* @note
* Copyright (C) 2011 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
#include <stdio.h>
#include "NUC230_240.h"
#include "NuEdu-Basic01.h"
/*---------------------------------------------------------------------------------------------------------*/
/* MAIN function */
/*---------------------------------------------------------------------------------------------------------*/
int main(void)
{
SYS_Init();
UART0_Init();
I2C_MMA7455_Init();
Init_MMA7455_Reg();;
while(1)
{
READ_MMA7455_ACCEL(); //加速度正負2G,8位模式
printf("ACCEL: X: %d Y: %d Z: %d \n", MMA7455_X, MMA7455_Y,MMA7455_Z);
CLK_SysTickDelay(300000);
CLK_SysTickDelay(300000);
CLK_SysTickDelay(300000);
}
}
|