Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bitcount = 0x00;
- data = 0x00;
- ISR(INT0_vect)
- {
- /*
- if(bit_is_set(PIND, KBD_DATA_PIN))
- send_character('1');
- else
- send_character('0');
- */
- if(bitcount > 0 && bitcount < 9)
- {
- if(bit_is_set(PIND, KBD_DATA_PIN)) // Button pressed
- {
- data |= (0x01 << (bitcount - 1));
- }
- }
- if(++bitcount == 11)
- {
- char string[10];
- sprintf(string, "%02X", data);
- send_string(string);
- data = 0x00;
- bitcount = 0x00;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement