mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
parent
409fedf11c
commit
71e2ec4cc9
@ -46,9 +46,9 @@ void Tm16XXSend(byte data)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
digitalWrite(tm1638_clock_pin, LOW);
|
digitalWrite(tm1638_clock_pin, LOW);
|
||||||
delayMicroseconds(TM1638_CLOCK_DELAY);
|
|
||||||
digitalWrite(tm1638_data_pin, data & 1 ? HIGH : LOW);
|
digitalWrite(tm1638_data_pin, data & 1 ? HIGH : LOW);
|
||||||
data >>= 1;
|
data >>= 1;
|
||||||
|
delayMicroseconds(TM1638_CLOCK_DELAY);
|
||||||
digitalWrite(tm1638_clock_pin, HIGH);
|
digitalWrite(tm1638_clock_pin, HIGH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,9 +81,7 @@ byte Tm16XXReceive()
|
|||||||
temp >>= 1;
|
temp >>= 1;
|
||||||
digitalWrite(tm1638_clock_pin, LOW);
|
digitalWrite(tm1638_clock_pin, LOW);
|
||||||
delayMicroseconds(TM1638_CLOCK_DELAY);
|
delayMicroseconds(TM1638_CLOCK_DELAY);
|
||||||
if (digitalRead(tm1638_data_pin)) {
|
if (digitalRead(tm1638_data_pin)) { temp |= 0x80; }
|
||||||
temp |= 0x80;
|
|
||||||
}
|
|
||||||
digitalWrite(tm1638_clock_pin, HIGH);
|
digitalWrite(tm1638_clock_pin, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user