2017-02-19 11:17:54 +00:00
|
|
|
#include "ShiftRegister.h"
|
|
|
|
|
|
|
|
void ShiftRegister::set(uint8_t value)
|
|
|
|
{
|
|
|
|
for (uint8_t bit = 0; bit < 8; ++bit)
|
|
|
|
{
|
2017-03-02 07:16:35 +00:00
|
|
|
bool currentBit = (value >> (7 - bit)) & 1;
|
|
|
|
setSerialPin(currentBit);
|
2017-02-19 11:17:54 +00:00
|
|
|
pulseShiftPin();
|
|
|
|
}
|
|
|
|
|
|
|
|
pulseStoragePin();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|