Skip to content

Commit

Permalink
round delay before each round; pin mapping for analog pins and crazyM…
Browse files Browse the repository at this point in the history
…achine
  • Loading branch information
stefanbrenner committed Apr 14, 2012
1 parent 880db44 commit d450ee3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
9 changes: 6 additions & 3 deletions Droplet/RELEASE-NOTES
Expand Up @@ -24,7 +24,6 @@ Release 0.1
* label for control number and info in docu
* Configuration for IDropletMessageProtocol (implements send/start/stop/rounds/delay/...)
to show or hide ui controls
* Focus for Camera

* Aufpassen bei Arduino Ordner in dem die cpp und h files liegen!
* create sexy icons
Expand All @@ -33,7 +32,6 @@ Release 0.1
* remove beta state

* correct dsc-protocol.txt
* Draw Arduino Layout in Fritzing
* Simple Logging of photo number combined with the current configuration
* Logging of exceptions/errors/informations/...
* Add Tests to the most important services and util methods
Expand Down Expand Up @@ -69,6 +67,11 @@ Release 0.1
* Setup Flashes without valves
* Empty valves (all, single, combination)
* Processing:
o links for metadata edit:
- http://www.adobe.com/devnet/xmp.html
- http://sourceforge.net/projects/im4java/
- http://www.sno.phy.queensu.ca/~phil/exiftool/
- http://code.google.com/p/metadata-extractor/
o embed Comments, Tags to EXIF
o embed the setup information in some kind of 'code' to EXIF
o watch folder / distribution folder
Expand All @@ -89,7 +92,7 @@ NEW FEATURES:


NOTES:
*
* Camera Focus can be configured with a second camera device


CHANGES:
Expand Down
2 changes: 1 addition & 1 deletion Droplet/src/main/arduino/sketch_droplet/droplet.h
Expand Up @@ -22,7 +22,7 @@
#define __DROPLET_H__


#define DEVICE_NUMBERS 13
#define DEVICE_NUMBERS 70


// TODO use bit masks for better performance
Expand Down
4 changes: 2 additions & 2 deletions Droplet/src/main/arduino/sketch_droplet/protocol.cpp
Expand Up @@ -181,13 +181,13 @@ void processSetCommand() {
duration = MIN_DURATION;
}

if(deviceNumber > DEVICE_NUMBERS) {
if(deviceNumber < 0 || deviceNumber > DEVICE_NUMBERS - 1) {
logging(ERROR, "Wrong device number");
return;
}

// add new actions to droplet
addActions(deviceMapping[deviceNumber - 1], offset, duration);
addActions(deviceMapping[deviceNumber], offset, duration);

// read next time
token = strtok(NULL, FIELD_SEPARATOR);
Expand Down
16 changes: 14 additions & 2 deletions Droplet/src/main/arduino/sketch_droplet/sketch_droplet.ino
Expand Up @@ -27,8 +27,20 @@
#define MAX_INPUT_SIZE 50 // how many memory can we use one the different arduino devices?


// 1 2 3 4 5 6 7 8 9 10 11 12, 13
char deviceMapping[DEVICE_NUMBERS] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
// device mapping for crazyMachine
// char deviceMapping[DEVICE_NUMBERS] = { 3, 2, 11, A2, A1, A3, A4, A5, 13, 12 };

// /*
char deviceMapping[DEVICE_NUMBERS] = { 0, 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,
// analog pins start at 50
A0, A1, A2, A3, A4, A5, A6, A7, A8, A9,
// higher analog pins on arduino mega
A10, A11, A12, A13, A14, A15, A16, A17, A18, A19 };
// */


/*
Expand Down
Expand Up @@ -89,7 +89,7 @@ public String createStartMessage(int rounds, int delay) {

int chksum = rounds;

if (rounds > 1 && delay > 0) {
if (delay > 0) {
chksum += delay;
result += FIELD_SEPARATOR + delay;
}
Expand Down
Expand Up @@ -93,7 +93,6 @@ public DropletToolbar(final JFrame frame, final IDropletContext dropletContext)
spRoundDelay.setModel(SpinnerAdapterFactory.createNumberAdapter(
adapter.getValueModel(IDropletContext.PROPERTY_ROUND_DELAY), 1000, 0, 99999999, 1));
((JSpinner.DefaultEditor) spRoundDelay.getEditor()).getTextField().setColumns(8);
spRoundDelay.setEnabled(dropletContext.getRounds() > 1);
updateTooltip();
adapter.addBeanPropertyChangeListener(IDropletContext.PROPERTY_ROUND_DELAY, new PropertyChangeListener() {
@Override
Expand All @@ -111,13 +110,6 @@ public void propertyChange(PropertyChangeEvent event) {
JButton btnCancel = new JButton(new CancelAction(frame, dropletContext));
add(btnCancel);

dropletContext.addPropertyChangeListener(IDropletContext.PROPERTY_ROUNDS, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
spRoundDelay.setEnabled(dropletContext.getRounds() > 1);
}
});

}

private void updateTooltip() {
Expand Down

0 comments on commit d450ee3

Please sign in to comment.