ShiftRegister74HC595
ShiftRegister74HC595 copied to clipboard
Ability to change bit order + SPI support
added SPI support. arduino uno can shift data out at up to 8mhz with almost 0 cpu cycles. also, no breaking changes ;)
That's pretty cool, thanks for the contribution. (I'll test this before merging.)
That's pretty cool, thanks for the contribution. (I'll test this before merging.)
ok ;) how long it could take?
#define SHIFT_REGISTER_USES_SPI_WITH_FREQUENCY 20000000UL
#include <ShiftRegister74HC595.h>
#include <SPI.h>
#define LATCH 7
ShiftRegister74HC595<3> sr(LATCH);
void setup() {
Serial.begin(115200);
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = 0;
OCR1A = 10;
TCCR1B |= (1 << WGM12);
TCCR1B |= (1 << CS21);
TIMSK1 |= (1 << OCIE1A);
sei();
}
volatile uint8_t b[3] = { 0b10010011, 0b11010011, 0b1111000 };
ISR(TIMER1_COMPA_vect)
{
sr.setAll(b);
}
void loop() {
delay(1000);
}
(signal is not clear because of long jumpwires)
hey, any progress / problems with this PR?
hey @Simsso what do you think about this? is there anything i can improve?