hi guys,
am a beginner in arduino, my doubts will definitely be stupid but kindly help me
can i send a hexa decimal value or decimal to a port and view it through led?
the sample codes shows i have to configure each pin n send either high or low bit, i want to access the whole port throgh some commands like portB=H5f of watever, is it possible in an arduino uno?
#define setbits(var, bits) var |= (bits) #define clrbits(var, bits) var &=~(bits) #define flpbits(var, bits) var ^= (bits)
with that, you can operate on the port (or ddr or any other register for that matter)
setbits(PORTB, (1<<2)); //sets bit2 on portb
clrbits(DDRB, (1<<0)); //bit0 on portb set as input
flpbits(PORTB, (1<<2) | (1<<3)); //flip bit2 and bit3 on portb