DeviceLib/ShiftRegister.cpp

17 lines
233 B
C++
Raw Normal View History

#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);
pulseShiftPin();
}
pulseStoragePin();
}