Buscando en la red: como crear GUIs (Interfaces Graficas de Usuario) en lenguaje C/Java para
Android-OS y microcontroladores (Arduino), encontré el Lenguaje Processing

Download 2.0 Beta 3 (10 September 2012)
http://www.processing.org/download/http://www.openprocessing.org/Les dejo una serie de enlaces para que se informen
Tutorial en castellano
http://processing.joan.cat/cs/index.htmlUn codigo ejemplo para guiar una elipse por medio del raton
void setup(){
size(131,80); // tamanio de la cuadro o ventana
smooth();
background(0); // Fondo color negro
}
void draw(){
background(0); // Fondo color negro, comentar esta linea para que superponga la imagen generada anteriormente
ellipse(mouseX, mouseY,20,30); // Dibujar elipse según posición actual del cursor
}otro codigo mas complejo
/*
By Magda Arques
Based on http://jamesalliban.co.uk/blogContent/pages/motion_trails_v01.pde
which seems to be based on http://processing.org/learning/libraries/framedifferencing.html
*/
import processing.video.*;
Capture video;
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int sensor;
int sensor2;
float velocidad;
float velocidad2;
int numPixels;
int[] previousFrame;
int[][] diffPoints;
int diffAmount = 0;
int particleMin = 2;
int particleAlpha = 100;
void setup()
{
size(1024, 720);
background (255);
noStroke();
frameRate(30);
fill(100);
smooth();
video = new Capture(this, width, height, 30);
numPixels = width * height;
previousFrame = new int[numPixels];
diffPoints = new int[height][width];
arduino = new Arduino(this, Arduino.list()[1], 57600);
}
void captureEvent(Capture video) {
video.read();
}
void draw()
{
diffAmount = 0;
for (int i = 0; i < numPixels; i++)
{
diffPoints[abs(i / width)][i % width] = 0;
color currColor = video.pixels[i];
color prevColor = previousFrame[i];
// Extract the red, green, and blue components from current pixel
int currR = (currColor >> 16) & 0xFF; // Like red(), but faster
int currG = (currColor >> 8) & 0xFF;
int currB = currColor & 0xFF;
// Extract red, green, and blue components from previous pixel
int prevR = (prevColor >> 16) & 0xFF;
int prevG = (prevColor >> 8) & 0xFF;
int prevB = prevColor & 0xFF;
// Compute the difference of the red, green, and blue values
int diffR = abs(currR - prevR);
int diffG = abs(currG - prevG);
int diffB = abs(currB - prevB);
// Render the difference image to the screen
color diff = color(diffR, diffG, diffB);
int isPointDiff = 0;
if (diff > -15000000) //-16777216
{
isPointDiff = 1;
++diffAmount;
}
diffPoints[abs(i / width)][i % width] = isPointDiff;
}
checkForNewPoint(diffAmount);
arraycopy(video.pixels, previousFrame);
}
void checkForNewPoint(int diffAmount)
{
int sensor = arduino.analogRead(0);
int sensor2 = arduino.analogRead(1);
if(diffAmount > 100000)
{
return;
}
float milliseconds = millis();
if (milliseconds < 1000) return;
if (diffAmount < 40) return;
int blocks = 0;
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
if(i > 1 && j > 1 && diffPoints[i][j] == 1)
{
if(diffPoints[i - 1][j] == 1 && diffPoints[i - 2][j] == 1
|| diffPoints[i][j - 1] == 1 && diffPoints[i][j - 2] == 1)
{
++blocks;
int randNum = 10;
int randX = int((randNum / 2) - random(randNum));
int randY = int((randNum / 2) - random(randNum));
color c = previousFrame[(i * width) + j];
fill(c, particleAlpha);
int particleSize = diffAmount / 700;
if(random(particleSize) > (particleSize - (.9999999 / particleSize)))
{
ellipse(j, i, particleMin + sensor, particleMin + sensor2);
}
}
}
}
}
}
void mousePressed() {
fill(255);
rect(0, 0, width, height);
}Juegos
/*
Versión del juego clássico SPACE INVADERS programado para el taller
Processing y Arduino en CAMON de Alacant, que el autor impartido por
Quelic Berga, Daniel García i Joan Soler-Adillon
http://www.tucamon.es/contenido/processing-y-arduino
Autor: Joan Soler-Adillon [www.joan.cat]
Enero 2009
Licencia: Creative Commons, Attribution-Noncommercial-Share Alike 3.0 Unported
http://creativecommons.org/licenses/by-nc-sa/3.0/
Este programa está diseñado para ser utilitzado tanto por usuarios noveles como avanzados.
Para los primeros, existen una serie de variables al principio de todo (bajo el título de
"variables principales" que determinan todos los aspectos importantes de juego. Sólo manipulando
estos valores se verán cambios importantes en el juego.
*/
//////////////////////
// VARIABLES PRINCIPALES
//
//------PANTALLA------------:
//
//Ancho de la pantalla
int theWidth = 600;
//Alto de la pantalla
int theHeight = 400;
//
//------INVASORES------------:
//
//velocidad de los invasores
float invadersSpeed = 1;
//incremento de la velocidad cada vez que cambian de dirección
float invadersSpeedIncrement = 0.05;
//pixels que bajan cada vez que cambian de dirección
int invadersYStep = 4;
//
//------NAVE------------:
//
//distancia de la nave al borde inferior de la pantalla
int spaceShipDistanceToBottom = 25;
//velocidad a la que se mueve la nave
int spaceShipSpeed = 5;
//
//------BALAS------------:
//
//Velocidad a la que van las balas
int bulletSpeed = 4;
//Tiempo (en milisegundos) que ha de pasar desde que se disparó una bala
//hasta que se puede disparar otra
int delayBetweenBullets = 500;
//
////// FIN DE VARIABLES PRINCIPALES
//////////////////////////////////////////////////
//creamos los objetos para el juego
int numOfInvaders = 50;
invader[] invaders = new invader[numOfInvaders];
spaceShip nave = new spaceShip(theWidth/2, theHeight-spaceShipDistanceToBottom,spaceShipSpeed, delayBetweenBullets);
//imágenes
PImage spaceShip, bulletImage,invadersFrameOne,invadersFrameTwo;
ArrayList bulletsList = new ArrayList();
void setup(){
size(theWidth,theHeight);
imageMode(CENTER);
//cargamos imágenes
spaceShip = loadImage("nau.gif");
invadersFrameOne = loadImage("bitxo1.gif");
invadersFrameTwo = loadImage("bitxo2.gif");
bulletImage = loadImage("bala.gif");
spaceShipSpeed = 5;
bulletSpeed = 4;
//INICIALIZACION (esto funciona para 50 invasores a 10x5)
int invaderCount = 0;
for(int i=50;i<200;i+=30){
for(int j=75;j<550;j+=50){
invaders[invaderCount]=new invader(j,i,invaderCount, invadersSpeed, invadersSpeedIncrement, invadersYStep);
invaderCount++;
}
}
}
void draw(){
background(0);
for(int i=0;i<numOfInvaders;i++){
invaders[i].update();
}
nave.update();
if(bulletsList.size()>0){
for(int i=0; i<bulletsList.size();i++){
bullet _b = (bullet) bulletsList.get(i);
_b.update();
}
}
}
///////////CONTROL CON TECLADO
//cuando le damos a una tecla
void keyPressed(){
//miramos si es de las raras:
if (key == CODED) {
//y si lo es, si es la flecha izquierda o derecha
if (keyCode == LEFT) {
nave.decrementX();
}
else if (keyCode == RIGHT) {
nave.incrementX();
}
}
else {
//si le damos a la tecla espacio
if(key==' '){
nave.shoot();
}
}
}
Mas de 10 Video Tutoriales
Mas info
Control con Arduino y Lenguaje Processinghttp://processing.joan.cat/camon/10/indexcs.htmlhttp://processing.joan.cat/camon/index.htmlhttp://www.arduino.cc/playground/Interfacing/Processingmaking video with arduino-processing
Lo que deseo es buscar entusiastas que quieran desarrollar o portar la biblioteca serial de Processing para microcontroladores PIC o Freescale http://processing.org/reference/libraries/serial/http://www.arduino.cc/playground/Interfacing/ProcessingAdemas creo que los codigos creados por este lenguaje se ejecutan en Windows/Linux teniendo instalado JAVA
http://processing.joan.cat/camon/spaceInvadersCamon09/index.htmlRedactando ...