Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino control with Pure Data
26-07-2013, 02:40 PM, (This post was last modified: 02-09-2013, 02:42 PM by RobertoB.)
#1
Pinguino control with Pure Data
Hello everyone,

So I have come up with a communication application between Pinguino and Pure Data. Files are included here.

In specific, this application works for PINGUINO PIC32 OTG.

The communication protocol takes as inspiration Firmata and uses the MIDI message protocol to send instructions to the PIC, in order to chante Pin values and states, as well as report back the current state of Digital Inputs, Digital Outputs, Analogue Inputs and Analogue Outputs.

I am attaching the .zip with all the files you need.

All you need to do is include the file with the extension .pdl32 in the folder with the same name, found in p32/ and the source file with the extension .c in p32/include/pinguino/core on the IDE directories.

I've also included a .pde application (io_PureData_Control.pde) that uses two main functions of this library:

PureData.init(), which initializes the necessary ports and pins to work with Pure Data; and

PureData.communicate(char inputData[3], char Dgtl[22], long int Anlg[8]): this function returns the lenght of the read data, which is stored in input Data. It also fills the Dgtl and Anlg arrays with the current values of the pins and sends this information over the USB.

To use the USB with a PC, I downloaded and installed a driver called CDC RS-232 EMULATION DEMO. It is a one minute process really.

Finally, in the .zip there are the Pure Data files that communicate with a Pinguino PIC32 OTG programmed with this pde I have just mentioned.

To control the Pinguino board with PD:
1- Connect Pinguino via USB to the computer (RS 323 has to be installed if you dont have a COM Port)

2- Open io_Pinguino_PureData_INTERFACE.pd with Pure Data.

3- In io_Pinguino_PureData_INTERFACE.pd click on "Click to show available Ports on the PD window" to find out which ports are available and your Pinguino is hooked up to.

4- Finally, take the number of that Port, write it on the number box "Set Port Number" and click on the bang button "Open Port", and voilà! You can now control states and pin modes in real time from Pure data.

If you could not connect or there are no COM ports available, reset your PIC and try again.

Please help abusing this project, to improve it and find all its faults.

I will try and publish a more in detail description of the project now in:

http://iobridger.wordpress.com/

cheers!


Attached Files
.zip   IO_PureData_Pinguino_V_1_2.zip (Size: 38.3 KB / Downloads: 4)
Reply
27-07-2013, 02:35 AM,
#2
RE: Pinguino control with Pure Data
Good work - it would get an even bigger audience and be very much appreciated if you also updated the empty Wiki page at http://wiki.pinguino.cc/index.php?title=...&redlink=1

Thanks in advance!
Reply
27-07-2013, 11:19 AM,
#3
RE: Pinguino control with Pure Data
Hello!

I have tried, but that link you gave me gives this Server Error

The website encountered an error while retrieving http://wiki.pinguino.cc/index.php?title=...&redlink=1.
It may be down for maintenance or configured incorrectly.
Error code: 500

Even when I am signed in and all.

So, for nowI posted it here. However I have emailed Sebastien, the administrator of the wiki page meanwhile.


(27-07-2013, 02:35 AM)Pinguino Wrote: Good work - it would get an even bigger audience and be very much appreciated if you also updated the empty Wiki page at http://wiki.pinguino.cc/index.php?title=...&redlink=1

Thanks in advance!
Reply
28-07-2013, 06:46 AM, (This post was last modified: 28-07-2013, 06:57 AM by Pinguino.)
#4
RE: Pinguino control with Pure Data
How odd - when I follow the link I get:
Code:
Editing With Pure Data
You have followed a link to a page that does not exist yet.

To create the page, start typing in the box below (see the help page for more info).
If you are here by mistake, click your browser's back button.

Try this link: http://wiki.pinguino.cc/index.php/With_Pure_Data - you should be able to Edit the page.
Reply
28-07-2013, 11:34 AM,
#5
RE: Pinguino control with Pure Data
Yeah this is weird. I can indeed visit the link you put here, but when I log in and click on the edit link or tab I get sent to that page I mentioned. This actually happens for all the wiki site.

I wonder if I need any privileges or settings in my account, I have tried ticking boxes... are you able to modify things though?
Reply
28-07-2013, 12:25 PM,
#6
RE: Pinguino control with Pure Data
(28-07-2013, 11:34 AM)RobertoB Wrote: Yeah this is weird. I can indeed visit the link you put here, but when I log in and click on the edit link or tab I get sent to that page I mentioned. This actually happens for all the wiki site.

I can confirm this behaviour of the wiki. I have the same problem since yesterday.

PinguPlus
Reply
29-07-2013, 10:58 AM,
#7
RE: Pinguino control with Pure Data
Even with Administrator access I cannot see anything wrong with your (RobertoB/pinguPlus) user access rights. No wonder the wiki spam stopped dead (it may be related :-)

I think we need a Wiki Sysop to sort this problem out. Regis?
Reply
29-07-2013, 11:50 AM,
#8
RE: Pinguino control with Pure Data
(29-07-2013, 10:58 AM)Pinguino Wrote: Even with Administrator access I cannot see anything wrong with your (RobertoB/pinguPlus) user access rights. No wonder the wiki spam stopped dead (it may be related :-)

I think it's not a problem with the user acces rights. It seems to be server related. If I click an edit link a blank screen appears. This means, the php interpreter dies because of an error.
The sysadmin should take a look at the httpd error log

Oliver
Reply
29-07-2013, 12:04 PM,
#9
RE: Pinguino control with Pure Data
I already spoke with Regis, and he suggested to email Sebastien instead, the admin of Wiki. So I did, but have not got reply yet...
Reply
29-07-2013, 04:23 PM,
#10
RE: Pinguino control with Pure Data
(29-07-2013, 11:50 AM)pinguPlus Wrote: I think it's not a problem with the user acces rights. It seems to be server related.

Except it works for me - I can create and edit pages :-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)