Search in Pinguino World !!

Wednesday, March 17, 2010

Simple example with Processing

I wrote this simple example to help users to associate Processing and Pinguino.
Communication is managed by Stephane Cousot Library and USB link.
Stephane example program is loaded in the Pinguino with the IDE.
A led is connected on PIN 0 of Pinguino.


// How to blink a led on PIN 0 with processing
// Jean-pierre Mandon 2010

import hypermedia.pinguino.*; // import library

Pinguino board; // pinguino object

void setup() {

size( 380, 180 ); // size the window application
board = new Pinguino( this ); // connect to Pinguino board

}

void draw() {

background(0);

fill(0);
if (board.digitalRead(0)==Pinguino.LOW)
board.digitalWrite(0,Pinguino.HIGH); // PIN 0 = 1
else
{ board.digitalWrite(0,Pinguino.LOW); // PIN 0 = 0
fill(255,0,0);
}
rect(170,70,40,40);
delay(100);

}

Stephane processing Library can be downloaded here.
The pinguino side program is here.

10 comments:

camilo said...

Hello,

I'm a newbie in python programming and out of topic here, but would somebody help me on how to make USB communication (bulk mode, HID mode), or if I have to design my own libraries assigning endpoints, VIDs and PIDs ??

thank you everyone.

Marin said...

Here you have some basic communication scripts (python and pinguino). There is also Pinguino Class written in python.

http://pmcsblah.blogspot.com/2010/03/pinguino-as-voltmeter-multimeter.html

mrp0t4t0 said...

Hi everybody, I have a little problem, again. I don't know where I have to paste the folder library "C:\Documents and Settings\David\Mis documentos\Processing\libraries\hypermedia\library" and here I have the library's file, but processing give me an error!
The package hypermedia doesn't exist.
You might be missing a library.
What's happend? Where Do I have to install o paste the files??
Thanks and regards.

Jean-Pierre MANDON said...

Pinguino folder if the library should be in the sketchbook/library/ folder.
Then it should be OK.

JP

Unknown said...

I did it! It's great.
Thanks Jean-Pierre

Celuti said...

Hello.
Could anybody please pass me a processing program to read the analogic values send by a potentiometer conected to pinguino?
Thank you in advance.
My e-mail adress is jltmoreno@gmail.com

niti said...

hi everybody i have some problems i use mac os and i can't find destination to paste libraly into processing where i didn't see sketchbook folder ??

thanks

niti said...

i have an error when i run program

!!! Pinguino error : initialization failed
USB device with idVendor 0x4d8 and idProduct 0xfeaa not found
!!! Pinguino error : invalid device handle

i use pic18f4550 how can i fix it

thanks

Yeison Cardona said...

Pynguino Módulo de Processing para pinguino en python

He hecho esto, la verdad es muy simple y aun necesita revisiones pero puede ser de ayuda para alguien.

I've done this, the truth is very simple and still needs revisions but can be helpful for someone.

http://code.google.com/p/pinno-processing/wiki/Pynguino

Vasile Guta-Ciucur said...

Somebody is very determined to manually post spam comments....

At least, he can put some intelligent phrases... or he can actively participate to our discussion.

Or maybe he really need some artificial stimulus to be able to do it :-D