AVR - Atmega 32.
GCC application.
Microchip Studio.
I need the program code.
Digital I/O challenges:
- Input: Push switch - 2 pcs
- Output: LED - 8 pcs, 7-segment - 1 pcs
- Adder (LED output) - maximum (255), minimum (0)
When Push switch 1 is pressed:
- Receive current 4-bit information of Digital input
- The present value and the input value are added and outputted to the LED (binary representation)
When Push switch 2 is pressed:
- Output the difference from the current value
When Push switch 1 and Push switch 2 are pressed at the same time:
- Initialize the current value to "0"
- Adder (7-segment output) - maximum (9), minimum (0)
- Repeat the above process, but the result output is expressed as a decimal number
- Display 2-digit numbers sequentially (displays 10's digit, 1's digit). Display interval is 1 second.
- A T-segment dot is displayed for the 1's digit display.