Compiler: AVR-GCC
uC: ATMega644
Ext Freq: 8MHz
/*trigger the wireless_flag here*/ wireless_on = 1; /*conditionA [wireless button is pressed]*/ if (wireless_on == 1) { /*conditionB [edit settings?]*/ /*display [EDIT SETTINGS Yes/No]*/ OUT_ALLCLR(); exit_flag = 0; while (exit_flag == 0) { if (get_key_short( 1<<KEY4 )) { /*display [Pan ID X X X X Enter]*/ OUT_NO_DATA(); /*set the PAN ID, let but_5 as confirm button*/ /*use buttons 1-4 to increment each digit, 5 to confirm selection*/ exit_flag2 = 0; while (exit_flag2 == 0) { if (get_key_short( 1<<KEY1 )) { /*increment the PAN4*/ pan4 = hexinc(pan4); /*convert or decode and display to lcd*/ convert_decode (pan4, 4); } else if (get_key_short( 1<<KEY2 )) { /*increment the PAN3*/ pan3 = hexinc(pan3); /*convert or decode and display to lcd*/ convert_decode (pan3, 3); } else if (get_key_short( 1<<KEY3 )) { /*increment the PAN2*/ pan2 = hexinc(pan2); /*convert or decode and display to lcd*/ convert_decode (pan2, 2); } else if (get_key_short( 1<<KEY4 )) { /*increment the PAN1*/ pan1 = hexinc(pan1); /*convert or decode and display to lcd*/ convert_decode (pan1, 1); } else if (get_key_short( 1<<KEY5 )) { /*confirm button is pressed*/ exit_flag2 = 1; } } /*send the values of Pan4 to Pan1 to the assembly for display and decoding*/ /*or create a decoding function here*/
Problem:
*no display upon entering the while loop
- OUT_NO_DATA(); does not display
Notes:
*i used the debouncing algorithm of danni
*functions beginning with OUT are calling assembly functions for LCD display
*could it be that the while loop is too fast to detect a button press?
tnx and good day