Pages: [1]   Go Down
Author Topic: Help with Arduino and Processing  (Read 368 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello, im workin on a project, which is developed in processing enviroment and communicates with arduino (with Firmata). I want to ask if someone has arduino libraries in processing (or at least arduino processing). processing doesnt support c/c++ and im newbie to convert those libraries. i will need especially lcd library, so if someone knows where i could find it for processing, or send me an arduino processing project with lcd (but without using the library), i' d thankful. Or suggest me what would you do. thanks in advice

ps1: i ve search the web and found nothing on that
ps2: sorry for my bad english
Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3011
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to use the processing software in processing (  which is some kind of Java ).

You will still need the arduino IDE  to write arduino programs  and download to your arduino device.

Your processing program on the PC  will then communicate with your arduino program on the arduino,  by USB/serial communications.

You may be thinking,  that you can use the processing environment  to write your arduino programs.  AFAIK,  you can't.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 625
Posts: 34104
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have Firmata running on the arduino then you can't run anything else on the arduino. Firmata reduces the arduino to a dumb I/O device and you have to do all your code in processing.
Much better is if you forget about Firmata and split the task between the two computers, your PC and arduino. That way you run arduino libraries on the arduino.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Grumpy_Mike: that was exactly what i tried.. BUT i cant do that because firmata already uses serial port.. so there is no communication beween arduino and processing.. also i think that is better to have all my code in processing and arduino just run firmata..
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 625
Posts: 34104
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

. BUT i cant do that because firmata already uses serial port.. so there is no communication beween arduino and processing.
You are missunderstanding something fundamental but I am not sure what it is. When you say Firmata is using the serial port do you mean in the Arduion because yes it will or do you mean in processing because yes it will but your code can still use the calls to it. The whole point about Firmata is that you communicate between the two with processing.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well yes, i didnt explain it very well.. i d like for example to check button/sensors states on processing, do stuff on computer, and then send back to arduino (via serial) some values, to print on LCD. Or connecet an I2C sensor, add its library (along with firmata) and send back values to processing. But i am not able because if i have upload firmata on arduino, create an arduino object on processing and try to add the same serial port to processing (with the same baudrate) i get error. So i thing that i could mix codes in firmata but without serial. and as i understand i have to find a way to programm lcd, and all the sensors in arduino. Also i tried to avoid firmata and send via serial an array to processing but i got HUGE delay (tried to increase baudrate and framerate in processing but nothing happend). I searched about and everyone suggested firmata (which is perfect and got no delay). but i now i want to have libraries that are standart in arduino enviroment and i cant. Sorry if i repeat myshelf and became dull, but i think that this is an important issue for people that are not programmers (like me) and want simple tools to develop something..
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 612
Posts: 49213
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i d like for example to check button/sensors states on processing
Firmata is not essential for that to happen.

Quote
do stuff on computer,
Firmata is not essential for that to happen.

Quote
and then send back to arduino (via serial) some values, to print on LCD.
Firmata is not essential for that to happen.

Quote
Or connecet an I2C sensor, add its library
Firmata is not essential for that to happen.

As Grumpy Mike said, if the Arduino is to be more than a dumb device, like a keyboard or mouse, you MUST ditch Firmata.

Quote
So i thing that i could mix codes in firmata but without serial.
The Processing application talks to the Firmata sketch using the serial port, so, no, you can't.

Quote
Also i tried to avoid firmata and send via serial an array to processing but i got HUGE delay
Well, you haven't posted any code for either end, so we have no idea. Plenty of guesses, but they won't help you.

Quote
I searched about and everyone suggested firmata
Obviously your search did not include the Arduino site. Nobody here recommends it (unless you ignore the nots sprinkled all over the place).

Quote
which is perfect and got no delay
It isn't perfect or you would not be complaining about its limitations.

Quote
but i think that this is an important issue for people that are not programmers (like me)
How are you writing a program in Processing, then? Wishful thinking will only get you so far. At some point, you need to quit wishing and start learning to be a programmer.

Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 625
Posts: 34104
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but i now i want to have libraries that are standart in arduino enviroment and i cant.
I will try again slowly.
Once you put firmata onto the arduino YOU CAN NOT HAVE ANYTHING ELSE in the arduino. That is no libraries, no other code, nothing.

So you have to do EVERYTHING in Processing just using the arduino as a dumb bunch of Input / output pins. That means if you attach an LCD then you have to drive that LCD with a Processing routine to waggle the appropriate output bits. That means you have to re write what the arduino library does in Processing. I guess that with your current state of knowledge this is a non starter. It fact it will take you more programming skills to use this "simple" tool the way you want to, than to tackle your problem correctly.

Quote
but i think that this is an important issue for people that are not programmers (like me) and want simple tools to develop something
Simple tools will only take you so far. The problem with simple tools is exactly what you are experiencing, you think you know what is going on but the instant you step outside what the tool is designed to do you are lost.
Logged

Pages: [1]   Go Up
Jump to: