Ich versuche, das Äquivalent der Arduino shiftOut()
Funktion in nativen c auf meinem MCU zu erstellen.arduino `shiftOut()` Funktion in nativen c
Ich möchte den Befehl int gTempCmd = 0b00000011;
über eine shiftOut()
Typ-Funktion mit MSBFIRST
senden.
Wie würde der Pseudocode aussehen, damit ich die gpio-Funktionen meines MCUs zuordnen kann?
Dank
float readTemperatureRaw()
{
int val;
// Command to send to the SHT1x to request Temperature
int gTempCmd = 0b00000011;
sendCommandSHT(gTempCmd);
...
return (val);
}
//Send Command to sensor
void sendCommandSHT(int command)
{
int ack;
shiftOut(dataPin, clockPin, MSBFIRST, command);
....
}
Siehe https://www.arduino.cc/en/Reference/ShiftOut – Michael