I understood that that digitalwrite() function could only take HIGH or LOW as arguments.
I'm looking that the code behind shiftout() and the argument is !!(val & (1 << i))).
What is happening here? For example if I called this, what happens the 0b00000011 in the first iteration of the for loop?
int _gTempCmd = 0b00000011;
shiftOut(_dataPin, _clockPin, MSBFIRST, _gTempCmd );
void shiftOut_function(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
uint8_t i;
for (i = 0; i < 8; i++) {
if (bitOrder == LSBFIRST)
digitalWrite(dataPin, !!(val & (1 << i)));
else
digitalWrite(dataPin, !!(val & (1 << (7 - i))));
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
}
}