Hello
Just starting to try to get my head around b4R
If I have a byte array that contains 1011 (received from asyncstreams via serial port)
What would be the best way of representing that on pins digital output pins 4,5,6 and 7? There must be a more elegant way of setting the pins without a bundle of if statements.
ok so I declared the pins
Dim rly(4) As Pin
initialize them:
For i = 0 To rly.Length -1
rly(i).Initialize(i+4,rly(i).MODE_OUTPUT)
Next
then I tried ass per your example:
Dim data(4) As Byte
data ="1010"
For i = 0 To 3
rly(i).DigitalWrite(data(i)=1)
Next
I am a bit confused as the digitalwrite seems to be a boolean value?