/////////////////////// // Shift Register /////////////////////// void Distance::setShift(uint8_t val, int micro) { uint8_t high_bit = 1; //Shift values in for(int i=0; i<8; i++){ if(val & high_bit) digitalWrite(SHIFT_SER_PIN, HIGH); else digitalWrite(SHIFT_SER_PIN, LOW); shiftOnce(); high_bit = (high_bit << 1); } //Send it out shiftOnce(); enableOutput(); delayMicroseconds(micro); disableOutput(); }
void Shift::setRegister(uint8_t val) { //Initialize disableOutput(); clearRegister(); uint8_t high_bit = 1; //Shift values in for(int i=0; i<8; i++){ if(val & high_bit) digitalWrite(SR_INPUT_PIN, HIGH); else digitalWrite(SR_INPUT_PIN, LOW); shiftOnce(); high_bit = (high_bit << 1); } //Send it out shiftOnce(); enableOutput(); m_current_val = val; }
MetaBlock::MetaBlock(const Block *block, xmlNodePtr node) : Block(block->extension(), block->owner(), node), parent_(block), root_ns_(node->ns), key_("meta") { disableOutput(true); }