-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblinky controller 3.au3
140 lines (133 loc) · 4.4 KB
/
blinky controller 3.au3
1
2
3
4
5
6
7
8
9
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include <GUIConstants.au3>
#include 'CommMG64.au3' ;or if you save the commMg.dll in the @scripdir use #include @SciptDir & '\commmg.dll'
#include <GuiEdit.au3>
#include <GuiComboBox.au3>
#include <windowsconstants.au3>
#include <buttonconstants.au3>
Local $err
$init = _CommSetPort(3, $err)
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 374, 251, 195, 127)
GUISetBkColor(0x0022aa)
;~~~~~~~~~~~~~~~~ Colours ~~~~~~~~~~~~~~~~
$Group1 = GUICtrlCreateGroup("Colours", 8, 8, 361, 145)
;~~~~~~~~~~~~~~~~ Red ~~~~~~~~~~~~~~~~
$Button1 = GUICtrlCreateButton("", 16, 24, 75, 25)
GUICtrlSetBkColor(-1, 0xFF0000)
$Button2 = GUICtrlCreateButton("", 16, 56, 75, 25)
GUICtrlSetBkColor(-1, 0xDE3A38)
$Button3 = GUICtrlCreateButton("", 16, 88, 75, 25)
GUICtrlSetBkColor(-1, 0xEA5939)
$Button4 = GUICtrlCreateButton("", 16, 120, 75, 25)
GUICtrlSetBkColor(-1, 0xF7A22E)
$Button5 = GUICtrlCreateButton("", 104, 24, 75, 25)
GUICtrlSetBkColor(-1, 0xEDD739)
$Button6 = GUICtrlCreateButton("", 104, 56, 75, 25)
GUICtrlSetBkColor(-1, 0x00FF00)
$Button7 = GUICtrlCreateButton("", 104, 88, 75, 25)
GUICtrlSetBkColor(-1, 0x00AA00)
$Button8 = GUICtrlCreateButton("", 104, 120, 75, 25)
GUICtrlSetBkColor(-1, 0x366F7E)
$Button9 = GUICtrlCreateButton("", 192, 24, 75, 25)
GUICtrlSetBkColor(-1, 0x295B91)
$Button10 = GUICtrlCreateButton("", 192, 56, 75, 25)
GUICtrlSetBkColor(-1, 0x151D7B)
$Button11 = GUICtrlCreateButton("", 192, 88, 75, 25)
GUICtrlSetBkColor(-1, 0x284BBB)
$Button12 = GUICtrlCreateButton("", 192, 120, 75, 25)
GUICtrlSetBkColor(-1, 0x284EBB)
$Button13 = GUICtrlCreateButton("", 280, 24, 75, 25)
GUICtrlSetBkColor(-1, 0x4F347D)
$Button14 = GUICtrlCreateButton("", 280, 56, 75, 25)
GUICtrlSetBkColor(-1, 0xD0489A)
$Button15 = GUICtrlCreateButton("", 280, 88, 75, 25)
GUICtrlSetBkColor(-1, 0xE476AF)
$Button16 = GUICtrlCreateButton("", 280, 120, 75, 25)
GUICtrlSetBkColor(-1, 0xFFFFFF)
;~~~~~~~~~~~~~~~~ Controls ~~~~~~~~~~~~~~~~
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Controls", 8, 160, 361, 81)
$Button17 = GUICtrlCreateButton("Off", 16, 176, 75, 25)
$Button18 = GUICtrlCreateButton("On", 16, 208, 75, 25)
$Button19 = GUICtrlCreateButton("Strobe", 104, 176, 75, 25)
$Button20 = GUICtrlCreateButton("Fade", 104, 208, 75, 25)
$Button21 = GUICtrlCreateButton("Smooth", 192, 176, 75, 25)
$Button22 = GUICtrlCreateButton("Flash", 192, 208, 75, 25)
$Button23 = GUICtrlCreateButton("Speed", 280, 176, 75, 25)
$Button24 = GUICtrlCreateButton("Dim", 280, 208, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
#EndRegion ### END Koda GUI section ###
;~ _CommSendString('0') ; Y
;~ ;~ Exit
;~ For $i = 1 To 137 Step +1
;~ _CommSendString(Chr($i)) ; Y
;~ $ret = InputBox('','')
;~ If $ret Then
;~ ConsoleWrite($ret & ' ' & $i & ' ' & Chr($i) & @CRLF) ; Y
;~ EndIf
;~ ;~ _CommSendString('i') ; Y
;~ ;~ Sleep(250)
;~ Next
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
; ~~~~~~~~~~~~~~~~ Colours ~~~~~~~~~~~~~~~~
Case $Button1 ;Red
_CommSendString('d') ; Y
Case $Button2 ;vermilion
_CommSendString('b') ; Y
Case $Button3 ; Orange light
_CommSendString('f') ; Y
Case $Button4 ;yellow
_CommSendString('a') ; y
Case $Button5 ;chartreuse
_CommSendString('e') ; y
Case $Button6 ;green
_CommSendString('t') ; y
Case $Button7 ;light green
_CommSendString('r') ; y
Case $Button8 ;light blue
_CommSendString('6') ; y
Case $Button9 ;lighter blue?
_CommSendString('1') ; y 1 or v?
Case $Button10 ;blue
_CommSendString('l') ; y
Case $Button11 ;purple
_CommSendString('5') ; y i / n / v who knows
Case $Button12
_CommSendString('n') ; y i / n / v who knows
Case $Button13
_CommSendString('i') ; y
Case $Button13
_CommSendString('v') ; ?
Case $Button14
_CommSendString('v') ; y
Case $Button15 ; Pink
_CommSendString('m') ; y
Case $Button16
_CommSendString('<') ; y
; ~~~~~~~~~~~~~~~~ Controls ~~~~~~~~~~~~~~~~
Case $Button17 ;Off
_CommSendString('h')
Case $Button18 ;On
_CommSendString('8')
Case $Button19 ;Strobe
_CommSendString('i')
Case $Button20 ;Fade
_CommSendString('}')
Case $Button21 ;Smooth
_CommSendString('y') ;9
Case $Button22 ;Flash
_CommSendString(':')
Case $Button23 ;Speed
_CommSendString('@')
Case $Button24 ;Dim
_CommSendString('0')
EndSwitch
WEnd