Hi to all
this is my first attempt to code development for B4R
How convert optimally this routine?
Where the SCK and DOUT pins are respectively A3(output) and A2(input)
Thanks
this is my first attempt to code development for B4R
How convert optimally this routine?
B4X:
long getValue()
{
byte data[3];
while (digitalRead(DOUT))
;
for (byte j = 3; j--;)
{
for (char i = 8; i--;)
{
digitalWrite(SCK, HIGH);
bitWrite(data[j], i, digitalRead(DOUT));
digitalWrite(SCK, LOW);
}
}
digitalWrite(SCK, HIGH);
digitalWrite(SCK, LOW);
data[2] ^= 0x80;
return ((uint32_t) data[2] << 16) | ((uint32_t) data[1] << 8)
| (uint32_t) data[0] << 1;
}
Where the SCK and DOUT pins are respectively A3(output) and A2(input)
Thanks