├── LANC-Interface1.png ├── LANC-Interface2.png ├── 2015-10-26 16.58.05.jpg ├── Screenshot_layout.jpg ├── LANC_SAMPLE_ARDUINO.ino ├── README.md └── full_LANC_command_list_doc └── LANC_commands.html /LANC-Interface1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexNe/arduino_lanc_sample/HEAD/LANC-Interface1.png -------------------------------------------------------------------------------- /LANC-Interface2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexNe/arduino_lanc_sample/HEAD/LANC-Interface2.png -------------------------------------------------------------------------------- /2015-10-26 16.58.05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexNe/arduino_lanc_sample/HEAD/2015-10-26 16.58.05.jpg -------------------------------------------------------------------------------- /Screenshot_layout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexNe/arduino_lanc_sample/HEAD/Screenshot_layout.jpg -------------------------------------------------------------------------------- /LANC_SAMPLE_ARDUINO.ino: -------------------------------------------------------------------------------- 1 | int PinLANC = 0; // 5V limited input signal from LANC data 2 | int PinCMD = 1; // Command to send to LANC 3 | byte typeCam = B00101000; 4 | byte typeVTR = B00011000; 5 | 6 | bool setRec=1; 7 | void setup() { 8 | 9 | 10 | } 11 | 12 | void loop() 13 | { 14 | int ZOOM = analogRead(A0); // get 15 | if( ZOOM > 505 && ZOOM < 525 ) { ZOOM = 0; } 16 | else if( ZOOM >= 530 ) { ZoomWide( map(ZOOM,525,1023,0,7) ); } 17 | else if( ZOOM <= 500 ) { ZoomTele( map(ZOOM,505,0,0,7) ); } 18 | 19 | if(analogRead(A2)==0 ) 20 | { 21 | if(setRec){ 22 | setRec=0; 23 | sendCMD(typeVTR, B00110011); // start/stop 24 | //sendCMD(typeVTR, B00111001); // photo 25 | //sendCMD(typeVTR, B00101011); // photo 26 | } 27 | } 28 | else setRec=1; 29 | } 30 | 31 | 32 | 33 | //################################################################################## 34 | //################################################################################## ZOOM CONTROL 35 | //################################################################################## 36 | void ZoomWide(int Wide) 37 | { 38 | switch(Wide) 39 | { 40 | case 0: //speed 1 41 | sendCMD(typeCam, B00010000); 42 | break; 43 | case 1: //speed 2 44 | sendCMD(typeCam, B00010010); 45 | break; 46 | case 2: //speed 3 47 | sendCMD(typeCam, B00010100); 48 | break; 49 | case 3: //speed 4 50 | sendCMD(typeCam, B00010110); 51 | break; 52 | case 4: //speed 5 53 | sendCMD(typeCam, B00011000); 54 | break; 55 | case 5: //speed 6 56 | sendCMD(typeCam, B00011010); 57 | break; 58 | case 6: //speed 7 59 | sendCMD(typeCam, B00011100); 60 | break; 61 | case 7: //speed 8 62 | sendCMD(typeCam, B00011110); 63 | break; 64 | } 65 | } 66 | void ZoomTele(int Tele) 67 | { 68 | switch(Tele) 69 | { 70 | case 0: //speed 1 71 | sendCMD(typeCam, B00000000); 72 | break; 73 | case 1: //speed 2 74 | sendCMD(typeCam, B00000010); 75 | break; 76 | case 2: //speed 3 77 | sendCMD(typeCam, B00000100); 78 | break; 79 | case 3: //speed 4 80 | sendCMD(typeCam, B00000110); 81 | break; 82 | case 4: //speed 5 83 | sendCMD(typeCam, B00001000); 84 | break; 85 | case 5: //speed 6 86 | sendCMD(typeCam, B00001010); 87 | break; 88 | case 6: //speed 7 89 | sendCMD(typeCam, B00001100); 90 | break; 91 | case 7: //speed 8 92 | sendCMD(typeCam, B00001110); 93 | break; 94 | } 95 | } 96 | 97 | //################################################################################## 98 | //################################################################################## LANC SEND FUNC 99 | //################################################################################## 100 | int bitDuration = 96; /// 104 - 8 // Writing to the digital port takes about 8 microseconds so only 96 microseconds are left till the end of each bit 101 | void sendCMD(unsigned char cmd1, unsigned char cmd2) 102 | { 103 | for (int cmdRepeatCount = 0; cmdRepeatCount < 5; cmdRepeatCount++) { //repeat 5 times to make sure the camera accepts the command 104 | while (pulseIn(PinLANC, HIGH) < 5000) { 105 | //"pulseIn, HIGH" catches any 0V TO +5V TRANSITION and waits until the LANC line goes back to 0V 106 | //"pulseIn" also returns the pulse duration so we can check if the previous +5V duration was long enough (>5ms) to be the pause before a new 8 byte data packet 107 | //Loop till pulse duration is >5ms 108 | } 109 | //LOW after long pause means the START bit of Byte 0 is here 110 | delayMicroseconds(bitDuration); //wait START bit duration 111 | for( int i=0; i<8; i++){ 112 | digitalWrite(PinCMD, (cmd1 & (1< 2 |
ABCD
1
2
DECBINHEXbin 0010 1000 | dec 40 | hex 28
3
0000000000variable speed zoom Tele: slowest speed
4
2000000102variable speed zoom Tele: faster than 00
5
4000001004variable speed zoom Tele: faster than 02
6
6000001106variable speed zoom Tele: faster than 04
7
8000010008variable speed zoom Tele: faster than 06
8
10000010100Avariable speed zoom Tele: faster than 08
9
12000011000Cvariable speed zoom Tele: faster than 0A
10
14000011100Evariable speed zoom Tele: fastest speed
11
160001000010variable speed zoom Wide: slowest speed
12
180001001012variable speed zoom Wide: faster than 10
13
200001010014variable speed zoom Wide: faster than 12
14
220001011016variable speed zoom Wide: faster than 14
15
240001100018variable speed zoom Wide: faster than 16
16
26000110101Avariable speed zoom Wide: faster than 18
17
28000111001Cvariable speed zoom Wide: faster than 1A
18
30000111101Evariable speed zoom Wide: fastest speed
19
330010000121grid (AVCHD)
20
370010010125fader
21
390010011127rec start (DV, some cameras)
22
410010100129rec stop (DV, some cameras)
23
480011000030variable speed zoom Tele (avoiding digital zoom, some cameras): slowest speed
24
500011001032variable speed zoom Tele (avoiding digital zoom, some cameras): faster than 30
25
520011010034variable speed zoom Tele (avoiding digital zoom, some cameras): faster than 32
26
530011010135Zoom Tele slow (working all cameras since approx. 1996)
27
540011011036variable speed zoom Tele (avoiding digital zoom, some cameras): faster than 34
28
550011011137Zoom Wide slow (working all cameras since approx. 1996)
29
560011100038variable speed zoom Tele (avoiding digital zoom, some cameras): faster than 36
30
570011100139Zoom Tele fast (working all cameras since approx. 1996)
31
58001110103Avariable speed zoom Tele (avoiding digital zoom, some cameras): faster than 38
32
59001110113BZoom Wide fast (working all cameras since approx. 1996)
33
60001111003Cvariable speed zoom Tele (avoiding digital zoom, some cameras): faster than 3A
34
62001111103Evariable speed zoom Tele (avoiding digital zoom, some cameras): fastest speed
35
650100000141Auto-Focus on/off (not if there is a real switch at the camera)
36
690100010145Focus manual far
37
710100011147Focus manual near
38
730100100149White balance toggle (only cameras until approx. 1996)
39
75010010114BBacklight (not DV)
40
810101000151Backlight (DV)
41
830101001153Exposure auto/man. toggle (models of the early 90's)
Iris more close
42
850101010155Iris more open
43
970110000161Shutter (models of the early 90's)
44
1190111011177White balance reset (not if white balance is selected via menu)
45
1331000010185Memory impose (models of the early 90's)
46
1351000011187Color / Mode (models of the early 90's)
47
1371000100189Superimpose (models of the early 90's)
48
17510101111AFIris auto
49
DECBIN
HEX
Normal command to VTR or video camera BIN 0001 1000 HEX 18 DEC 24
50
00000000000program 1
51
20000001002program 2
52
40000010004program 3
53
50000010105mode (only HDV/AVCHD)
54
60000011006program 4
55
80000100008program 5
56
10000010100Aprogram 6
57
12000011000Cprogram 7
58
14000011100Eprogram 8
59
160001000010program 9
60
180001001012program 0 (10: SL-HF950 MKII)
61
200001010014program 11 (SL-HF950 MKII)
62
220001011016enter, program 12 (SL-HF950 MKII)
63
240001100018program 13
64
26000110101Aprogram 14
65
28000111001Cprogram 15
66
30000111101Eprogram 16
67
320010000020program +
68
340010001022program -
69
360010010024
70
380010011026
71
400010100028x2
72
42001010102Apower (or viewfinder) off
73
43001010112Bphoto write
74
44001011002Ceject
75
46001011102Emain/sub
76
480011000030stop
77
500011001032pause
78
510011001133start/stop
79
520011010034play
80
530011010135tele (only CCD-V90)
81
540011011036rew
82
550011011137wide (only CCD-V90)
83
560011100038fwd
84
570011100139photo capture
85
58001110103Arec
86
60001111003Crec-pause (some devices)
87
62001111103E
88
640100000040still
89
660100001042
90
680100010044x1/10
91
700100011046x1/5 (sometimes: vis. scan)
92
720100100048
93
74010010104Ax14
94
76010011004Cx9
95
78010011104Etracking auto/manual
96
800101000050search -
97
820101001052search +
98
840101010054TV/VTR
99
860101011056
100
880101100058
101
90010110105AVTR
102
91010110115Bdate search / photo search / photo scan
103
92010111005C
104
94010111105Epower off
105
960110000060rev frame
106
980110001062fwd frame
107
1000110010064
108
1010110010165edit-search -
109
1020110011066x1
110
1030110011167edit-search +
111
1040110100068
112
1050110100169rec-review (not i.e. TR-2200)
113
106011010106A
114
108011011006Csleep
115
110011011106Etracking normal
116
1120111000070
117
1140111001072
118
1160111010074rew+play
119
1180111011076
120
1200111100078AUX
121
122011110107Aslow +
122
123011110117Btape end search (HDV)
123
124011111007Cslow -
124
126011111107E
125
1281000000080
126
1301000001082display mode
127
1321000010084menu up
128
1341000011086menu down
129
1361000100088tracking/fine +
130
138100010108Atracking/fine -
131
140100011008Ccounter reset
132
142100011108Ezero mem
133
1441001000090index mark
134
1461001001092index erase
135
1481001010094shuttle edit +
136
1501001011096shuttle edit -
137
1521001100098data code or goto
138
1531001100199data code or recording parameters
139
154100110109Amenu
140
156100111009C
141
158100111109Einput select
142
16010100000A0
143
16210100010A2execute
144
16410100100A4quick timer
145
16610100110A6index
146
16810101000A8
147
17010101010AA
148
17210101100ACindex search +, date search 01 (HDV)
149
17410101110AEindex search -, date search -01 (HDV)
150
17610110000B0tape speed
151
17810110010B2goto zero / tape return (not DV)
152
18010110100B4counter display, data screen
153
18210110110B6open/close (SL-HF950), replay (FauHaEss)
154
18410111000B8timer display
155
18610111010BA
156
18810111100BC
157
18910111101BDdate display off
158
19010111110BE
159
19110111111BFdate display on
160
19211000000C0timer set
161
19411000010C2menu right, next
162
19611000100C4menu left
163
19811000110C6timer clear
164
20011001000C8timer check
165
20211001010CAtimer record
166
20411001100CC
167
20611001110CE
168
20811010000D0audio dub
169
21011010010D2
170
21211010100D4edit assemble
171
21411010110D6edit mark
172
21611011000D8synchro edit
173
21811011010DA
174
22011011100DCdigital off (VCR), print (DV)
175
22211011110DEspeed +
176
22411100000E0speed -
177
22611100010E2stop motion
178
22811100100E4
179
23011100110E6
180
23211101000E8channel scan / flash motion
181
23411101010EA
182
23611101100ECvoice boost
183
23811101110EE
184
24011110000F0
185
24211110010F2
186
24411110100F4
187
24611110110F6
188
24811111000F8digital scan
189
25011111010FAhigh-speed-rew
190
25211111100FCstill/shuttle (EV-S880)
191
25411111110FE
192
DECBIN
HEXNormal command to still video camera BIN 0001 1110 HEX 1E DEC 30
193
10000000101variable speed zoom Tele: slowest speed
194
30000001103variable speed zoom Tele: faster than 01
195
50000010105variable speed zoom Tele: faster than 03
196
70000011107variable speed zoom Tele: faster than 05
197
90000100109variable speed zoom Tele: faster than 07
198
11000010110Bvariable speed zoom Tele: faster than 09
199
13000011010Dvariable speed zoom Tele: faster than 0B
200
15000011110Fvariable speed zoom Tele: fastest speed
201
170001000111variable speed zoom Wide: slowest speed
202
190001001113variable speed zoom Wide: faster than 11
203
210001010115variable speed zoom Wide: faster than 13
204
230001011117variable speed zoom Wide: faster than 15
205
250001100119variable speed zoom Wide: faster than 17
206
27000110111Bvariable speed zoom Wide: faster than 19
207
29000111011Dvariable speed zoom Wide: faster than 1B
208
31000111111Fvariable speed zoom Wide: fastest speed
209
820101001052photo preview
210
880101100058photo save (or in movie mode: start-stop)
211
94010111105Epower off
212
1481001010094Zoom Tele slow
213
1501001011096Zoom Wide slow
214
1521001100098Zoom Tele fast
215
154100110109AZoom Wide fast
216
217
218
219
220
Нормальный исходний прошивки
221
http://www.next-zero.com/Lib/LANC-RemCon/001.html
3 | 40 | --------------------------------------------------------------------------------