Control Picaxe with OSC controller through Max

TheAlphaNerd

New Member
So I have this school project I am working on in which I would like to use my monome (an open source OSC controller) to control a hacked hardware toy using Max/msp.

The hardware device has 2 pots and 2 button's... and I am planning on changing the values of the pots / buton's with the picaxe, using the monome to select the values, and max as the middle man.

So I am left with a few questions in regards to how to do this.

First in regards to how to approach programming the control on the pots... I initially wanted to use digital pots, but was thinking that it might actually be easier to control the pots through pulse width modulation. The pots I would be are 20k pots... and I will be measuring the voltages to create between 16 - 24 unique positions for the pots. What do you on the board think would be the simplest method to digitally control the pots?

Second In regards to the button's. The buttons I would be replacing are momentary, how should I approach this?
I have an idea of how to do this programing wise (Quick High/Low), would this work?

Now I am fairly new to both physical computing and Max programming, so I was just curious what steps I would be required to go through on the software side to Interface the picaxe through max. If anyone has a patch they have created that could serve as a template that would be perfect.

Thanks in Advance,

Myles
 

womai

Senior Member
To increase the chance that somebody can help you, it would be a good idea to explain your setup a bit more and/or provide links to components that may not be widely known. Especially don't use cryptic abbreviations without sufficient explanation. E.g. at least I have no idea what a "monome" or a "max/msp" is. Of course I could google that but while I am glad to provide help and information where I can it don't feel I want to spend time just figuring out what you are talking about. This is not meant to sound harsh, rather I'd like you to get the best support you can - and I know that after working with someting for a while one is prone to forget that others aren't as familiar with it than oneself.
 

lanternfish

Senior Member
So I have this school project I am working on in which I would like to use my monome (an open source OSC controller) to control a hacked hardware toy using Max/msp.
Just had a quick look at the monome and Maxmsp sites. :eek:

The hardware device has 2 pots and 2 button's... and I am planning on changing the values of the pots / buton's with the picaxe, using the monome to select the values, and max as the middle man.
The toy is what? Do you have a link?

So I am left with a few questions in regards to how to do this.

First in regards to how to approach programming the control on the pots... I initially wanted to use digital pots, but was thinking that it might actually be easier to control the pots through pulse width modulation. The pots I would be are 20k pots... and I will be measuring the voltages to create between 16 - 24 unique positions for the pots. What do you on the board think would be the simplest method to digitally control the pots?
ADC's? Digital pots as you have suggested! Servos?

Second In regards to the button's. The buttons I would be replacing are momentary, how should I approach this?
I have an idea of how to do this programing wise (Quick High/Low), would this work?
the pulsout command would do it (refer PICAXE Manual Section 2 Page 136)

Now I am fairly new to both physical computing and Max programming, so I was just curious what steps I would be required to go through on the software side to Interface the picaxe through max. If anyone has a patch they have created that could serve as a template that would be perfect.

Thanks in Advance,

Myles
From what I can tell from the websites for your other hardware/software you will have to do q wee bit of investigation into the protocols to see if you can output simple (RS232) serial that the picaxe uses.

Read the PICAXE manuals for good info on the basics of picaxe serial transmission/reception.

Hope this helps
 

TheAlphaNerd

New Member
Sorry if it came across a little bit muddled I'll try to explain a bit better.

I am hardware hacking a toy known as a Stringin' It
Stringin' It in Action

The hardware has 4 controls. 2 pots to control both Speed of the rope and Modulation of the strobe. 2 Buttons to Change the type of strobe and Color.

I want to use a picaxe to replace these pots and buttons so that I can control the values live from my computer through 4 variables.

I want to do this using a visually based programming language called Max/msp
Max allows you to interface with serial connections and visually map the flow of the code, as well as .

I want to control the variables that will be sent to the picaxe (and subsequently the toy) by means of a monome. The monome is an open source hardware controller using the OSC protocol. There are large libraries of patch's (pre programmed modules to be used in max/msp) that can control and monitor the monome.

phew...

So my questions are most likely 2 parts... Hardware base and Interface Based

Hardware: How would you use the picaxe to control the values of pots and buttons?

Interface: Has anyone successfully programmed the picaxe using max? If so were you able to reprogram the chip live (control the values)? As well, if you have managed to do this do you have a max patch I could see as an example.
 

lanternfish

Senior Member
Hardware:

From watching various YouTube videos and from your description what you are aiming to do is replace the existing hardware with a PICAXE to control motors, colour and strobe. Thats not too much of an ask an appropriate PICAXE.

To control motor speed you will probably want to use PWM.

As for strobing the light/LEDs, a number of ways to do it depending on if you use a picaxe with background serial receive or not.

The buttons become redundant as you will be controlling the colour and mode via serial commands.

Software: For picaxe to receive appropriate data refer to my previous post.

Cheers
 

TheAlphaNerd

New Member
So here is a site that shows a bit on the stringin' it (actual lay out of toy)
Stringin It'

Now in regards to the controls... all of the strobe and light changes are controlled by the main IC of the device which has been cleverly covered in a giant glob of glue... so I am limited in how to hack it... just want to replace the pots and buttons.
 

womai

Senior Member
Great, your amended explanation made a whole lot more sense to me.

For the buttons you'll need to find out which side is the "active" one (i.e. goes to the actual input). Usually buttons use a pullup (or pulldown) resistor that pulls the input high (or low) when the button isn't pressed. Simply connect a Picaxe output to the active side of the button. Using the command "high" and "low" of the Picaxe Basic let you simulate key presses.

For the pots probably the most straightforward solution is to replace them with digital potentiometers (also called RDACs = resistive digital to analog converters, this will help with googling). E.g. Microchip.com has suitable ones. Just make sure their resistance is similar to the pots you are replacing. The only slight obstacle is that the Picaxe needs to talk to them through an SPI interface (basically three lines - clock, data, chip enable) - that can seem daunting first if you are a beginner at electronics, but it's actually fairly easy and the forum members will be glad to help if there are questions.

As for prgramming, that software package you mention looks expensive (several hundred $$$...) - there are much better alternatives (IMHO) which are cheaper. Many people use Visual Basic to talk to the Picaxe through the serial port, so there are quite a few code examples available.

Overall, your intended project is very doable with a Picaxe - can't see anything out of the ordinary.
 

TheAlphaNerd

New Member
Womai... thanks for the response...

I already own Max/msp... bought it with a student discount and got it quite cheap, using it for a variety of things... so this is also a project to help me learn more about max.

As for talking to the Digital Pots... the basic three lines... do you have a link to any documentation I could read in regards to coding that?
 

inglewoodpete

Senior Member
As for prgramming, that software package you mention looks expensive (several hundred $$$...) - there are much better alternatives (IMHO) which are cheaper. Many people use Visual Basic to talk to the Picaxe through the serial port, so there are quite a few code examples available.
Having seen MAX used on a large scale project (ongoing but documented here) that I have been working on, it is in a league of its own. Very simple to use and very clever, especially for non-programmers. We used MAX to interface a network of PICAXEs to a server on the other side of the world via a VPN. (I didn't program with MAX personally, so I can't offer much help to anyone)

It will never replace VB or C for instance but it has a market.
 
Top