Пример #1
0
int main(void)
{
	DelayInit();
	lcd16x2_init(LCD16X2_DISPLAY_ON_CURSOR_OFF_BLINK_OFF);
	
	// Initialize HMC5883L
	HMC5883_Init();
	
	while (1)
	{
		HMC5883_GetHeadings();
		
		lcd16x2_clrscr();
		lcd16x2_puts("X,Y,Z =\n");
		sprintf(buf, "%d,", rawX);
		lcd16x2_puts(buf);
		sprintf(buf, "%d,", rawY);
		lcd16x2_puts(buf);
		sprintf(buf, "%d", rawZ);
		lcd16x2_puts(buf);
		
		DelayMs(250);
	}
}
Пример #2
0
/* ===================================================================*/
void PeripheralInit(void)
{
    /* Initialize MPU6050 and HMC5883. */
	HMC5883_Init();
	MPU6050_Init();
}