-
Coś już napisał
"get_usb_power"
niezrównany Fingalo myśli podobnie jak ja
i próbuje wykorzystać tą komendę do wykonywania różnych komend/skryptów w zależności od czasu trwania sygnału na usb (z pilota)
na razie napisał coś takiego :
Some testing with remote signaling to see if it is possible to make a multibutton control.
I found that the USB signal need to be at minimum 50-60ms in length in order to be detected at all.
Under this length I could not detect any signals.
Also the length varies a lot, when setting a signal 0.2sec long it will be detected between .19 to .23s.
I just used the length of the signal as a code for a simple test.
5 different signal with following timing (seconds)
0.065, 0.21, 0.33, 0.44, 0.60
In the keydecode routine just adding a counter every 10ms when the USB signal is high and set the value to the usb_power variable when usb signal goes low.
This way I just get a value (in 10ms counts) for USB signal. It is decoded with the following script:
@title Remote button
do
do
a = get_usb_power
until a>0
rem remote button 1
if a>0 and a<15 then
release "zoom_in"
release "zoom_out"
endif
rem remote button 2
if a>15 and a<25 then press "zoom_in"
rem remote button 3
if a>25 and a<38 then press "zoom_out"
rem remote button 4
if a>38 and a<47 then shoot
rem remote button 5
if a>50 then exit_alt
if a>0 then print a
rem clear my internal usb_power signal, fix for now.
wait_click 1
a = is_key "remote"
until is_key "set"
end
This works stable, but the timing is really not what I expected, I thought it should be a 10ms resolution for the USB signal.
I tested by a 5 V signal from the PC's printer port and a program to time the signal to the camera.
(I have not made any testbuild, it need some cleanup and adjustment to be useful!)
więc możliwe ,że w końcu zrealizuje ten super pomysł
Uprawnienia umieszczania postów
- Nie możesz zakładać nowych tematów
- Nie możesz pisać wiadomości
- Nie możesz dodawać załączników
- Nie możesz edytować swoich postów
-
Zasady na forum