User manual
ECE 477 Final Report Spring 2004
write_LCD(1, 0x42);
for (j = 0; j < 22; j++) {
write_LCD(0, ' ');
}
}
}
else if (input[0] == 1) {
//it's for me, and it's an alert packet!!!!
// send confirm packets 0x07, 0x07 and clear button
press flags//
putchar1(0x07);
putchar1(0x07);
button_press = 0;
// light up LEDs, delay for a few seconds, turn off
LEDs
PORTD.0 = !PORTD.0;
PORTD.1 = !PORTD.1;
PORTD.3 = !PORTD.3;
PORTD.4 = !PORTD.4;
/* delay_ms(5000);
PORTD.0 = 1;
PORTD.1 = 1;
PORTD.3 = 1;
PORTD.4 = 1;
*/ }
}
// }
/* scan inputs from buttons. if a button is selected w/ debounce send
appropriate packet and
flag that button as pressed. If a button is flagged as pressed and not
pressed,
turn off that flag */
if (button_press == 0) {
//check for button press
if (PINA.5 == 0) {
//enter key pressed
delay_ms(12);
if (PINA.5 == 0) {
// yes, it's really pressed
button_press = 1;
//send enter press packet w/ checksum!
putchar1(0x06);
putchar1(0x06);
// write_LCD(0, 'E');
}
} else if (PINA.4 == 0) {
//up key pressed
delay_ms(12);
if (PINA.4 == 0) {
// yes, it's really pressed
button_press = 1;
//send up press packet w/ checksum!
putchar1(0x02);
putchar1(0x02);
// write_LCD(0, 'U');
}
F-16