Code: Select all
Private Const Input_Clock as Byte = 7 ' clock pin
Private Const Input_Data as Byte = 10 ' data pin
Private Const Input_Load as Byte = 6 ' load pin
Function ReadInput(ByVal value as Bit) as Bit
Call PutPin(Input_Load, zxOutputHigh)
Call PutPin(Input_Clock, zxOutputLow)
Call PulseOut(Input_Load, 5, 0)
Dim InputByte as Byte
InputByte = ShiftIn(Input_Data, Input_Clock, 8)
ReadInput = GetBit(InputByte, value)
End Function
Sub Main()
Dim RoofOpenState as Bit
Dim RoofOpen as Bit = 1
RoofOpenState = ReadInput(RoofOpen)
End Sub
"Simple Function.bas:11: Error: assignment type conflict; left:Bit, right:Byte"
I can't get my head around this. . .ReadInput should be a bit, and the output from GetBit should be a bit. . .??? So why this error?
I know this is an extremely elementary concept for most everyone, but I'm really having problems with this. Any help would be appreciated. Thanks!
-Jeff