Closed bamboo-master closed 3 years ago
The shiftin and shiftout is not implemented yet. You can use a for loop do it.
@sh4had you may add this function in your sketch to use the shiftout function.
void shiftOut(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);
}
}
Thanks! Now everything works.
I wanted to use a CH552 and a seven-segment display using a 74hc595 shift registers. On stm8s103f3p6 (sduino) it works fine, but ch552 doesn't even compile. I get errors:
If I drop these two lines with "shiftOut", the sketch will compile successfully.