theadrn:
Hello, i am new on this forum and complete beginner of arduino.
I would like to know what does this code do? Can you help me?
If you look in the datasheet for the microcontroller chip it will tell you all about the port control registers
that are used in that code, DDRx/PORTx/PINx... Its doing direct access to pins using the hardware
registers.
Well, it's not for an Arduino UNO or Nano. The ATmega328P processor doesn't have a port 'A'. The Arduino Mega (ATmega2560 processor) does and the 'sketch' will compile.
I suspect it uses a 7-segment display. The number of '1' bits in the constants matches the number of segments you would light up for the corresponding digit.