- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
Dim byteOut(64) As Byte
Dim i As Integer
Try
byteOut(0) = Len(outCName) + 5 'number bytes in output message
byteOut(1) = &H0 'should be 0 for NXT
byteOut(2) = &H80 '&H0 = reply expected &H80 = no reply expected
byteOut(3) = &H9 'Send Bluetooth
byteOut(4) = &H0 'Box Number - 1
byteOut(5) = Len(outCName) + 1 'message size with null terminator
For i = 1 To Len(outCName) 'copy bytes into output array
byteOut(i + 5) = Asc(Mid(outCName, i, 1))
Next
byteOut(Len(outCName) + 6) = &H0 'add null terminator
SerialPort1.Write(byteOut, 0, Len(outCName) + 7) 'send message
Catch ex As Exception
MsgBox(ex.ToString)
End Try
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Try
byteOut(0) = Len(outWState) + 5 'number bytes in output message
byteOut(1) = &H0 'should be 0 for NXT
byteOut(2) = &H80 '&H0 = reply expected &H80 = no reply expected
byteOut(3) = &H9 'Send Bluetooth
byteOut(4) = &H1 'Box Number - 1
byteOut(5) = Len(outWState) + 1 'message size with null terminator
For i = 1 To Len(outWState) 'copy bytes into output array
byteOut(i + 5) = Asc(Mid(outWState, i, 1))
Next
byteOut(Len(outWState) + 6) = &H0 'add null terminator
SerialPort1.Write(byteOut, 0, Len(outWState) + 7) 'send message
Catch ex As Exception
MsgBox(ex.ToString)
End Try
<..ещё один раз..>
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Try
byteOut(0) = Len(outWindC) + 5 'number bytes in output message
byteOut(1) = &H0 'should be 0 for NXT
byteOut(2) = &H80 '&H0 = reply expected &H80 = no reply expected
byteOut(3) = &H9 'Send Bluetooth
byteOut(4) = &H3 'Box Number - 1
byteOut(5) = Len(outWindC) + 1 'message size with null terminator
For i = 1 To Len(outWindC) 'copy bytes into output array
byteOut(i + 5) = Asc(Mid(outWindC, i, 1))
Next
byteOut(Len(outWindC) + 6) = &H0 'add null terminator
SerialPort1.Write(byteOut, 0, Len(outWindC) + 7) 'send message
Catch ex As Exception
MsgBox(ex.ToString)
End Try
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Try
byteOut(0) = Len(outHum) + 5 'number bytes in output message
byteOut(1) = &H0 'should be 0 for NXT
byteOut(2) = &H80 '&H0 = reply expected &H80 = no reply expected
byteOut(3) = &H9 'Send Bluetooth
byteOut(4) = &H4 'Box Number - 1
byteOut(5) = Len(outHum) + 1 'message size with null terminator
For i = 1 To Len(outHum) 'copy bytes into output array
byteOut(i + 5) = Asc(Mid(outHum, i, 1))
Next
byteOut(Len(outHum) + 6) = &H0 'add null terminator
SerialPort1.Write(byteOut, 0, Len(outHum) + 7) 'send message
Catch ex As Exception
MsgBox(ex.ToString)
End Try