Hello everybody.
I just read User Guide about Port : Arduino Reference - Arduino Reference
But it 's so little informations ,how to use Port: turn on ,turn off each pins.
Example:
PORTD = B10101000; // sets digital pins 7,5,3 HIGH
PORTB |= B00000001; // sets digital pins 8 HIGH
I don't know how to set digital pins 8 to LOW ?
Can you explain PORTB | ,PORTB~ ,and give some examples using Port ?
I aslo upload a sample of linking led for everyone
void setup()
{
DDRD = B11111111; // set PORTD (digital 7~0) to outputs
}
void loop()
{
PORTD = B11110000; // digital 4~7 HIGH, digital 3~0 LOW
delay(1000);
PORTD = B00001111; // digital 4~7 LOW, digital 3~0 HIGH
delay(1000);
}