Could someone please tell me if the following port manipulation is an equavaluent expression to the digitalWrite / pinMode?
DDRH = DDRH | B11000000;// set pins 6&7 as OUPUTS
PORTH = PORTH | B00000000;// set pins 6&7 LOW
delayMicroseconds(2);
PORTH = PORTH | B11000000;// set pins 6&7 HIGH
delayMicroseconds(5);
PORTH = PORTH | B00000000;// set pina 6&7 LOW
// The same pin is used to read the signal from the PING))): a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
DDRH = DDRH | B00000000;// set pins 6&7 as INPUTS
pinMode(pingPin1, OUTPUT);
pinMode(pingPin2, OUTPUT);
digitalWrite(pingPin1, LOW);
digitalWrite(pingPin2, LOW);
delayMicroseconds(2);
digitalWrite(pingPin1, HIGH);
digitalWrite(pingPin2, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin1, LOW);
digitalWrite(pingPin2, LOW);
// The same pin is used to read the signal from the PING))): a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(pingPin1, INPUT);
pinMode(pingPin2, INPUT);