Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void button() {
- volatile uint8_t button = 0, oldButton = 1;
- volatile uint8_t toggle = 1;
- while(1) {
- button = (PINB & 128) >> 7;
- if (oldButton == 1 && button == 0) {
- toggle ^= 1;
- }
- oldButton = button;
- LCDDR0 &= ~(1<<6 | 1 << 1);
- LCDDR0 = LCDDR0 | (1 << ((toggle) ? 6:1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement