Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
aaron
aaron's Profile
5
Posts
4
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
arduino + processing help me plz
[0 Replies]
15-Sep-2013 12:47 PM
Forum:
Integration and Hardware
hi , i have a problem plz help
me,
how can i read many data of arduino on processing D: ??
plz help mee :(
arduino code :
#include "DHT.h"
#define DHTPIN 7
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
int val = 0 ;
int val2 = 0 ;
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
int h = dht.readHumidity();
int t = dht.readTemperature();
val = h ;
val2 = t ;
Serial.write('h');
Serial.write(val);
Serial.write('t');
Serial.write(val2);
}
processing code :
import processing.serial.*;
Serial port;
PFont text;
int val;
void setup (){
size(500,500);
smooth();
text = loadFont("AgencyFB-Reg-48.vlw");
println(Serial.list());
port = new Serial(this,Serial.list()[1],9600);
textFont(text);
textSize(60);
}
void draw() {
background(0);
if(port.available() > 0 ){
val = port.read() ;
switch(val){
case 'h' :
val = port.read() ;
fill(#03F4FF);
text("HUMIDITY : "+ val + " %",50,300);
break;
case 't' :
val = port.read() ;
fill(#FF0303);
text("TEMPERATURE : " + val + " °C",50,125);
break;
}
}
Processing + Arduino serial comunication
[1 Reply]
14-Sep-2013 02:18 PM
Forum:
Integration and Hardware
HI , I HAVE A PROBLEM PLZ HELP ME
arduino code :
#include "DHT.h"
#define DHTPIN 7
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
int val = 0 ;
int val2 = 0 ;
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
int h = dht.readHumidity();
int t = dht.readTemperature();
val = h ;
val2 = t ;
Serial.write('h');
Serial.write(val);
Serial.write('t');
Serial.write(val2);
}
processing code :
import processing.serial.*;
Serial port;
PFont text;
int val;
void setup (){
size(500,500);
smooth();
text = loadFont("AgencyFB-Reg-48.vlw");
println(Serial.list());
port = new Serial(this,Serial.list()[1],9600);
textFont(text);
textSize(60);
}
void draw() {
background(0);
if(port.available() > 0 ){
val = port.read() ;
switch(val){
case 'h' :
val = port.read() ;
fill(#03F4FF);
text("HUMIDITY : "+ val + " %",50,300);
break;
case 't' :
val = port.read() ;
fill(#FF0303);
text("TEMPERATURE : " + val + " °C",50,125);
break;
}
}
how can i read many data of arduino on processing D: ??
plz help mee :(
How to read float variable from serial port (processing + arduino)
[0 Replies]
05-Aug-2013 07:09 PM
Forum:
Integration and Hardware
plz help me :(
PROCESSING CODE
import processing.serial.*;
Serial port;
PFont text;
int h=401;
int num;
float mapa,x,y;
void setup(){
smooth();
size(500,500);
rectMode(CORNER);
text = loadFont("Chiller-Regular-48.vlw");
textFont(text);
textSize(40);
port = new Serial(this,Serial.list()[1],9600);
}
void draw(){
background(0);
fill(#E5E3DE);
rect(30,50,60,401);
ellipse(150,60,25,25);
ellipse(190,60,25,25);
ellipse(230,60,25,25);
if(keyPressed){
if(keyCode == DOWN){
if(h >= -1 && h <= 400){
h++; }}}
if(keyPressed){
if(keyCode == UP){
if( h >=0 && h <= 402 ){
h--;}}}
fill(#09CBD3);
mapa = map(h,401,-1,255,0);
port.write(mapa);
colores();
posicion();
if(keyPressed){
if ( keyCode == LEFT){
num = 1;
port.write(num);
}
if( keyCode == RIGHT){
num = 2;
port.write(num);
}
}
sentido(num);
for(int i =440 ;i >=0;i-=10){
line(43,i,80,i);
}
}
void posicion() {
if(mapa >= 127.5){
y = map (mapa,255,0,250,150);
x = map (mapa,255,0,350,150);
}
else {
y = map(mapa,127.5,0,200,250);
x = map(mapa,127.5,0,250,150);
}
fill(#FF0DB7);
line(250,250,x,y);
strokeWeight(5);
}
void colores() {
if(h >250 && h <=401){
fill(#FC0000);
arc(250,250,200,200,radians(180),radians(360));
text("Speed(pwm): " + mapa ,150,450);
rect(30,50,60,h);
ellipse(150,60,25,25);
fill(255);
ellipse(190,60,25,25);
fill(255);
ellipse(230,60,25,25);
}
if(h <=251 && h >=118){
fill(255);
ellipse(150,60,25,25);
fill(#FFE603);
arc(250,250,200,200,radians(180),radians(360));
text("Speed(pwm): " + mapa ,150,450);
rect(30,50,60,h);
ellipse(190,60,25,25);
fill(255);
ellipse(230,60,25,25);
}
if( h < 118 && h >=-1){
fill(255);
ellipse(150,60,25,25);
fill(255);
ellipse(190,60,25,25);
fill(#64FC00);
arc(250,250,200,200,radians(180),radians(360));
text("Speed(pwm): " + mapa ,150,450);
rect(30,50,60,h);
ellipse(230,60,25,25);
}}
void sentido(int x) {
if(x == 1) {
fill(#189093);
rect(160,300,190,50);
line(220,325,250,300);
line(220,325,245,349);
line(220,325,283,324);
}
else if ( x == 2 ){
fill(#0F3DF0);
rect(160,300,190,50);
line(283,324,261,300);
line(283,324,266,349);
line(220,325,283,324);
}
}
ARDUINO CODE:
int led = 3;
int val = 0;
void setup () {
Serial.begin(9600);
pinMode(led,OUTPUT);
}
void loop () {
while(Serial.available() == 0 );
val = Serial.read() - '0';
analogWrite(led,val);
}
processing + arduino
[2 Replies]
31-Jul-2013 07:21 PM
Forum:
Integration and Hardware
hi !!! i want to learn about processing + arduino(how to connect processing + arduino), there any book to learn ?
Help me with this compilation error
[5 Replies]
25-Jul-2013 06:46 PM
Forum:
Integration and Hardware
Hi , when i´m running this example :
// Example 11-01 from "Getting Started with Processing"
// by Reas & Fry. O'Reilly / Make 2010
import processing.opengl.*;
void setup() {
size(440, 220, OPENGL);
noStroke();
fill(255, 190);
}
void draw() {
background(0);
translate(width/2, height/2, 0);
rotateX(mouseX / 200.0);
rotateY(mouseY / 100.0);
int dim = 18;
for (int i = -height/2; i < height/2; i += dim*1.2) {
for (int j = -height/2; j < height/2; j += dim*1.2) {
beginShape();
vertex(i, j, 0);
vertex(i+dim, j, 0);
vertex(i+dim, j+dim, -dim);
vertex(i, j+dim, -dim);
endShape();
}
}
}
I HAVE THE NEXT PROBLEM WHEN I´M COMPILED :
java.lang.RuntimeException: java.lang.RuntimeException: Framebuffer objects are not supported by this hardware (or driver)
at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:100)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:205)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:483)
at processing.opengl.PGL.requestDraw(PGL.java:1155)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1602)
at processing.core.PApplet.run(PApplet.java:2141)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Framebuffer objects are not supported by this hardware (or driver)
at processing.opengl.PGL$PGLListener.init(PGL.java:2659)
at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:535)
at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:555)
at javax.media.opengl.awt.GLCanvas$6.run(GLCanvas.java:1037)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1022)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:899)
at javax.media.opengl.awt.GLCanvas$8.run(GLCanvas.java:1065)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:666)
at java.awt.EventQueue.access$400(EventQueue.java:81)
at java.awt.EventQueue$2.run(EventQueue.java:627)
at java.awt.EventQueue$2.run(EventQueue.java:625)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:636)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I DON´T NOW WHAT HAPPEN PLEASE HELP ME , !!!! D:
MY PROCESSING VERSION IS : 2.0.1
THANKS GUYS!!! :)
«Prev
Next »
Moderate user : aaron
Forum