The first job was to get the input sorted. The plan is to use a bank of four push switches which will align with hot-key style control's on the display. The first job here of course is to connect the buttons to the Arduino and recognising in software when a button is pressed.

The switches (J5) share a common +5V supply, then each switch is fed to the Arduino Digital (J2) pins 9 through 12 and to ground via 220K Ohm resistors. When a switch is open, the resistor is effectively disconnected and the Arduino pin is held low. Whent the switch is closed, the resistor ensures that the input pin is held high, while also restricting the current flow.

In the test program, I simply read the button presses and toggle a state value with each button press and output the state (on/off) to the display. The debounce time used is 50ms, that is, the button must be held for 50ms in order to count as a press and toggle the respective state. I created a class for handling the debounce function, so the code need only instatiate the class for each required button/input pin; the constructor handles the pin initialisation, so no other initialisation is required in the setup() function. Software then only needs to call the respective Read() function for each pin.
...nice work here, I like that. Also because I am working on the same but do not such a nice documentation as you do.
ReplyDeleteYou might be interested in the following:
http://newyorkpanorama.com/2009/01/21/long-exposure-night-hdr-photography-with-arduino/
Wünsche Dir viel Erfolg,
Grüsse aus Zürich, Hans.
Why don't you use a deboucing circuit, it is quite simple and saves you some processing time.
ReplyDeleteI did consider a debouncing circuit, but as the switches are not time-critical to the camera triggering (only used for control/setup), there is no issue with the processing time cost of debouncing.
ReplyDelete