Monday 19 August 2013

Dome Bump Controller - Part 1

The DBC arrived the other day.  It is a pretty piece.  I followed the PDF and soldered it up.  Then went to look at fitting it.  The dome has 2 bigger holes so that the buttons sit under the outer layer, this was perfect for the DBC, and didnt need any work at all.  But i had no way to add screws, and didnt want to add the the steampunk look by bolting through both layers.  But the fit on the dome is so nice.  So much so that i just cleaned the dome and the housing and used superglue powerflex to stick it in place.  Its not perfectly square, but the buttons seem to work fine, so good enough, and it's not coming out without a fight, and if it does i can straighten it next time. :)

So with it fitted i needed to decide how to use it.  The default code controls the rear PSI and outputs different signal lines depending on the combo used.  But i need the rear PSI able to be triggered to run the same as the front PSI during things like the Cantina and Leia message, so it needed to be able to receive I2C commands.  So after a lot of bad ideas i went for a simple setup that will work with my current setup, but that wont be required, so can be left out.  This is the plan:

I2C triggers using the same as the teeces, run the rear PSI options, e.g. flash one colour
Rear PSI will flash in the default way while inactive, so std sweep unless set by the user in code or by pad.
Buttons will flash the rear PSI when pressed, so A is one colour, B is the other and Both is all LEDs on
The code will look out for the following:
If both held for 1.5s then flash the Rear PSI in a pattern, then either press A for .5s up to 3 times, or B up to 3 times.  The corresponding colour will flash for each press registered.
Then press both again for 1.5s  (any alternate combos or held far too long etc will reset combo seek)
Rear PSI will flash a fattern
Using 3 output lines signal out the chosen on the 6 options  e.g. for 1 use B001 for 6 use B110
The signal will go high on all three lines to signal a new command is due, then it will set the output lines for long enough to be read.

This gives the option for change and growth, by adding more lines and combos if needed.

So far i have the following planned for the options:
1 x A = Random Sounds On/Off
2 x A = Random Delay Long/Short
3 x A = High Low Volume
1 x B = Random Dome Motion On/Off
2 x B = Feet Drives On/Off
3 x B = 2-3-2 ?  Maybe add extra combo for this one to make sure

So i made a start this weekend, but working with 2 buttons was more of a pain than i expected. :) I didnt work hard on it, just popped in and out, maybe why it wasn't happening.  But i got there.  I have coded all the button combo stuff and PSI default running stuff in, added the I2C base, i just need to add in the Teeces script alternatives and get the timing right on those. :)  Im pleased with it so far, it should be easy to use but not easy to accidentally trigger. :) Just needs testing to death now. :)

I have a test setup with 2 buttons, and a rear PSI, then 3 LEDs setup as the output pins and will test the code on that Uno.  Then i will need to update the master to read those pins, assuming i have enough spare. :)  Then get all the timings right for the teeces scripts and then once all that is done i will upload to the DBC.  All this fuss for 2 buttons and 6 options, i must be mad.  But that DBC is too tarty to leave out. :)

No comments:

Post a Comment