Hi,
On page 6 of this datasheet, there are commands, e.g the temperature command is 00011.
The read temperature function in the library, writes the command as 0b00000011. Why is there a 0b but in front of the command? Is the a hex value?
/**
* Reads the current raw temperature value
*/
float SHT1x::readTemperatureRaw()
{
int _val;
// Command to send to the SHT1x to request Temperature
int _gTempCmd = 0b00000011;
sendCommandSHT(_gTempCmd, _dataPin, _clockPin);
return (_val);
}
void SHT1x::sendCommandSHT(int _command, int _dataPin, int _clockPin)
{
// The command (3 msb are address and must be 000, and last 5 bits are command)
shiftOut(_dataPin, _clockPin, MSBFIRST, _command);
}
Also, I'm trying to understand what happens behind the arduino shiftout() function.
Is 0b00000011 converted to binary ? 101100000000000000000000000000010001
...and then each byte of data is shifted out one byte at a time?