Hello,
Noob question, but can I copy my processing code and paste it into the Arduino IDE?
Hello,
Noob question, but can I copy my processing code and paste it into the Arduino IDE?
See if this answers your question.
http://playground.arduino.cc/Interfacing/Processing
I'm sorry but what am i looking for specifically. I dont see anything that rings a bell.
A more verbose answer then. What you asked is if you can cut and paste. You can but you have to load the library that does the translation. The link above has the steps to find, download, install, and use the library. Examples are included.
If you have more specific questions about your code, you need to show us the code.
So I downloaded that zip for Firmata. What am I doing next?
What am I doing next?
You're going to tell us what you want to do. (that'll upset Vaclev)
Yes, you can cut and paste Processing code into the Arduino IDE, but no, it probably won't compile.
This is because Processing is based on Java and Arduino is C/C++.
If you want to interface Processing and Arduino, I can move this to a different section of the forum.
wmj259:
So I downloaded that zip for Firmata. What am I doing next?
Un zip it, load it into the arduino IDE and download it into the arduino.
Congratulations you have now lobotomized your arduino and reduced it's intelligence to zero.
Any further problems should be addressed to the Processing forum because it is not an arduino any more.
What?
Grumpy_Mike:
Congratulations you have now lobotomized your arduino and reduced it's intelligence to zero.
wmj259:
What?
It means what it says.
A lot of people, me included, think Firmata is an abomination.
What ever you think, once it is in your arduino, then the arduino ceases to be anything but a dumb I/O board.
So what ever you want to do that is so very secret that we are not allowed to know, is done entirely by Processing code. Therefore is outside the realm of this forum. Our work is at an end.
Whatever, This is CIA confidentiality, but I'll share it with you.
I am making a barcode attendance scanning program in processing. At the beginning of the semester all students were given a barcode to tape to their notebook. In order to open the engineering room door, my second project was room access. I make the processing program so that if a barcode scan matches the list of a CSV file for all engineering students, then it sens a "1" character to the Arduino. When the arduino receives a "1" then it sends a signal o the motorshield which operates a motor that hangs off the door handle. The motor has a spool of string which is wound of, which pulls down the door handle. After 5 secs it releases, therefore locking the door again.
Please don't report this to the CIA.
Grumpy
Ok that would suggest that Firmata is the last thing you want, because the interaction between the processing code and the arduino will not be fast enough.
You want the arduino to read the code and then send it to processing using serial print.
I already have the import.serial; setup correctly
I just want to remove the processing end. So everything runs from the Arduino if i disconnect the USB cable.
wmj259:
I already have the import.serial; setup correctlyI just want to remove the processing end. So everything runs from the Arduino if i disconnect the USB cable.
So just remove the cable and things sent to Processing will no longer be sent to Processing. What are you using Processing to do anyway?
I have the Scan barcode code on processing, So it makes a pop-up, like this one.
So my barcode scanner scans the students barcode when they are at the door.
When I run the program I have a csv file of all the students barcode.
So I make a match the barcodes methods.
If its a successful scan then where it says "No Messages" will change to "Succesful scan......."
And then I have a if statement where if it detects "Successful scan...." it will print a "1" on the myport serial.
I am wondering if I can remove the processing end so everything runs on and from the arduino. Thinking about using a USB host shield.
Well that is a challenge.
First off you need to know how the bar scanner appears to the computer. It could be an HID device or a serial device or some other device.
Then you need to know what the processing code does to interact with the scanner.
Next you have to get the the USB shield to talk to your bar code scanner, USB drivers can be tricky and there are not many examples with the host shield, but you never know you might be lucky.
Then all you have to do is get the arduino to do the same sort of thing as the Processing code. Some of it will be copy and paste but library functions are handled differently in Java so there might be a bit of patching to do.
So I make a match the barcodes methods.
If its a successful scan then where it says "No Messages" will change to "Succesful scan......."
And then I have a if statement where if it detects "Successful scan...." it will print a "1" on the myport serial.
Concentrate on getting the fundamentals of communication working first before you tackle surface gloss like this.