I got a simple hardware project with simple task: I have to turn on LED buttons with responsive regular buttons, using ATMega32 microcontroller. As an IDE we use Proteus 8.6 with C as programming language. I could realise turning on/off first button, but the problem is that the similiar method does not work with other buttons (you can see it on the first image - first two buttons are pressed, but only first LED is on). I don`t know if the problem is in schema or the code. If you have any idea how to implement it or even simplify the bit logic without 8 "if"-blocks, I would be really thankfull!
Here are images of schema and the code: Schema C Code
Solved (with one line of code, PORTC - output for LED buttons, PIND - value of input buttons):
PORTC = PIND;