PURE DATA forum~

...that deal with pure data

You are not logged in.

#1 2012-01-22 19:11:07

silas202
Member

how to have more digital "pwm"?

Hello everybody,

first, sorry if my English is not always correct, I try to do my best ... :)

I'm doing a project with an Arduino Mega 2560 with 16 proximity sensors, I have 16 LEDs that light up depending on the intensity of each sensor.

The problem is that on my arduino mega I only have 13 outputs digital "PWM", how to get more?

I searched google and I found it (it use i2c with an arduino master and a slave):
http://www.youtube.com/watch?v=FiDaNkuw … ure=relmfu
I have a second arduino uno so I tried to connect them (current flows), my problem is I can not send data to a second digital PWM outputs ...

What I do is it possible or not? (knowing that I already use the PWM output of my arduino mega) if yes how can i do?
if somebody know other solutions to get more out "PWM"...?

Here is the patch that I use and I changed, and I want to thank the people who created this patch!

Last edited by silas202 (2012-01-22 19:18:08)


Attachments:
Attachment Icon arduino-test-forum.pd, Size: 41,053 bytes, Downloads: 18

Offline

 

#2 2012-01-22 19:19:17

dwan
Member

Re: how to have more digital "pwm"?

Have a look to the TLC5940, it has 16 PWM outputs and you can control it with 3 pins if i remember well.

Offline

 

#3 2012-01-23 00:47:45

silas202
Member

Re: how to have more digital "pwm"?

@dwan thank you dawn, i've just bought one, i will receive it in 2 days,
i have read some explanation on how to connect the TLC5940 but i don't understand how can i control all my 16 led by the way of just 5 digital "pwm" on my arduino mega? what i have to change in my sketch? i have to make a bridge between my array of pin and a new one or something like that?
thanks for your response

Offline

 

#4 2012-01-23 07:55:38

dwan
Member

Re: how to have more digital "pwm"?

see here, there is an arduino library : http://www.arduino.cc/playground/Learning/TLC5940

Offline

 

#5 2012-01-24 16:03:11

silas202
Member

Re: how to have more digital "pwm"?

hello dwan (and others :) ),
i've just received my tlc5940 and it work with the basic use in arduino IDE,
now i need to control my leds with pure data, i've  uploaded standard firmata with library ( #include <Tlc5940.h>), but with my sketch (in my previous post) i don't understand what can i change to control my led?

and i've find this patch... i don't know if it can help?
thank you to response


Attachments:
Attachment Icon TLC5940.pd, Size: 539 bytes, Downloads: 20

Offline

 

#6 2012-01-24 19:13:00

dwan
Member

Re: how to have more digital "pwm"?

IMHO, you cannot drive the TLC from puredata only. You have to write some function in the arduino that receives orders from puredata and then speaks to the TLC.
For example, you could send [1 128< and the arduino would interpret it as "set the first PWM output to a duty cycle of 128". Now you just have to translate from pd to arduino :) It should be easy if you read the library's documentation

Oh, and the patch you posted won't be of any help.

Last edited by dwan (2012-01-24 19:23:16)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson


pd.webring info