int main() { clock_begin(); bool success; LCD lcd; lcd.init(); #if BAUD == 9600 usart1.init(0x33, true); #elif BAUD == 38400 usart1.init(12, true); #endif // usart1.setTriggerTime(50); char tmp[32]; lcd.dis("Zigbee Test"); // _delay_ms(1000); Zigbee zigbee; int panid = zigbee.panid(); // _delay_ms(500); int addr = zigbee.addr(); sprintf(tmp, "PAN: %x\nADDR: %x", panid, addr); lcd.clear(); lcd.dis(tmp); while (1); { _delay_ms(1000); } }
int main() { LCD lcd; lcd.init(); char s[128]; sprintf(s, "short: %d\n int: %d\n long: %d\n ", sizeof(short), sizeof(int), sizeof(long)); lcd.dis(s); while (1); }
int main() { clock_begin(); lcd.init(); lcd.drawText(0, 0, "Ready"); usart.init(12, true); // usart.init(0x33, true); // usart.setTrigger(';'); _delay_ms(1000); usart1.send("zigbee_ready(b);"); while (1) { if (usart.triggered()) { sprintf(tmp, "[%02x %02x %02x %02x %s", usart.buf[0], usart.buf[1], usart.buf[2], usart.buf[3], usart.buf+4); // lcd.clear(); // lcd.drawText(0, 0, usart.buf); // usart.send(usart.buf); lcd.dis(tmp); usart.clear_buf(); } _delay_ms(500); } }