slapyak: tinkering and fidgeting
Just another WordPress.com weblog

it’s alive!

it works! it only took until 3 in the morning, but it works and works well, the refresh rate is way higher than i expected. I can play as fast as I want and not lose a single note. it turns out the major obstacles came down to a few little things that were really screwing up my logic and basic function.

first: the original windmeadow entry and especially the responses to it on the original page proved to be the most helpful for me. the biggest issue i was having was the two-wire library runs at 400k, this was locking up my program or giving me junk based on the guitars mood at the moment. I switched the one line in ..\arduino-0011\hardware\libraries\Wire\utility\twi.h from

#ifndef TWI_FREQ
#define TWI_FREQ 400000L
#endif

to

#ifndef TWI_FREQ
#define TWI_FREQ 100000L
#endif

as well as added
#define TWI_FREQ 100000L

to the beginning of ..\arduino-0011\hardware\libraries\Wire\wire.h

this allowed me to get meaningful data out of the guitar.

next step was figuring out what means what. the data that came out (in the guitar library i made a demo program that does nothing but take the raw data and spit it back out over serial in binary.) the guitar library is no more. I kept getting errors saying i have ‘undefined references” to one variable that seems to be very clearly defined to me. as a result, the guitar functions are now included as a separate include file, not a library. not as pretty, but it works.
Jleyrer had pointed out on his blog that he got the guitar to light up some leds on a protoboard. i was unable to handle the data his program was making, so just dropped his previous work from the project. I do still have the same variable names and the code he had in common with mindmeadow.

The guitar puts out a ‘1’ for a button at rest and a ‘0’ for a button in use. so i had to turn my logic upside down in order to get the format I had written the program around. what I ended up with is grossly reverse engineered to make the data that was coming from the function turn into the data i wanted to see.

also, inspired by the midi_touchpad by ludo i think i’m going to change the operation of the joystick to controlling a sound parameter of some kind. something cool…

left to do today:
-add shiftIn() and shiftOut() to get the dipswitches and leds operational
-reprogram the joystick to operate a continuous controller type parameter.
-make the voltage divider for the intended 9v supply and to allow neg voltage for the lcd contrast
-see if those tiny surface mounted resistors i have will work.
-find a nice way to bundle it all up inside the guitar
-make the notes hold until the button is released.

Advertisements

No Responses to “it’s alive!”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: