示例#1
0
int main()
{
	LED_OUTPUT();

	usi_init_master();
	volatile TWRESULT status = usi_start_master(0x08, 1);
	if (status != TWST_OK)
	{
		while(1)
		{
			LED_TOGGLE();
			_delay_ms(100);
		}
	}

	LED_HIGH();
	
	for (uint8_t i = 0; i < 25; ++i)
	{
		volatile uint8_t data = usi_read_master(0);
	}
	usi_read_master(1);

	usi_stop();
	LED_LOW();

	while(1);
	return 0;
}
示例#2
0
文件: rf01_receive.c 项目: benf/car
int main(void)
{
	rfxx_init();
	rf01_init();

	LED_OUTPUT();
	DDRC = 0xff;

	GICR  = (1 << INT0);
//	MCUCR = (1 << ISC01) | (1 << ISC00);
	sei();

	DDRC  |=  (1 << DDC5);
	PORTC |=  (1 << PC5);

	while (1);
	return 0;
}