firmata / processing Goto Github PK
View Code? Open in Web Editor NEWprocessing client for firmata
Home Page: https://github.com/firmata/arduino
processing client for firmata
Home Page: https://github.com/firmata/arduino
if you write analogWrite to some pin and try to write digitalWrite(LOW) to stop. it just don't work
Does this mean that the pullup resistors can be enabled with MODE_INPUT_PULLUP?
Processing tells me that MODE_INPUT_PULLUP does not exist.
Do you have an example on how to enable / use pullup resistors with firmata and processing?
thanks
Running any of the examples such as arduino_output, arduino_input, or arduino_servo I get a java.lang.NullPointerException. Also when I run a working sketch then add the line "import cc.arduino.*" I get the same error.
The full error is:
java.lang.NullPointerException
at processing.app.Library.getClassPath(Library.java:337)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:454)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:193)
at processing.mode.java.JavaBuild.build(JavaBuild.java:152)
at processing.mode.java.JavaBuild.build(JavaBuild.java:131)
at processing.mode.java.JavaMode.handleLaunch(JavaMode.java:126)
at processing.mode.java.JavaEditor$34.run(JavaEditor.java:1099)
at java.lang.Thread.run(Thread.java:745)
Trying to run any of the Firmata examples in Processing 2.0b5 and 2.0b6 results in an error:
Exception in thread "Animation Thread" java.lang.IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy
at cc.arduino.Arduino$SerialProxy.<init>(Arduino.java:119)
at cc.arduino.Arduino.<init>(Arduino.java:168)
at arduino_output.setup(arduino_output.java:41)
at processing.core.PApplet.handleDraw(PApplet.java:2103)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
at processing.core.PApplet.run(PApplet.java:2006)
at java.lang.Thread.run(Thread.java:680)
the highlighted line is
arduino = new Arduino(this, Arduino.list()[0], 57600);
Hi,
I think I have found and issue that a few people have had as well (googling: servo firmata processing problem returns a few pages).
Servo control works fine when using the ServoFirmata version but not with the StandardFirmata.
I think I have found the problem and how to solve it.
The problem is not in the arduino firmata but actually in the processing library.
There is an option to set pinMode(pin, SERVO) to use the pin to control a servo (not using PWM). But then the analogWrite method override that (see below), which results in the servo being controller with PWN and having a super erratic behaviour.
public void analogWrite(int pin, int value) {
pinMode(pin, PWM);
serial.write(ANALOG_MESSAGE | (pin & 0x0F));
serial.write(value & 0x7F);
serial.write(value >> 7);
}
I've solved that personnally by simply creating a servoWrite method as below:
public void servoWrite(int pin, int value) {
pinMode(pin, SERVO);
serial.write(ANALOG_MESSAGE | (pin & 0x0F));
serial.write(value & 0x7F);
serial.write(value >> 7);
}
Not sure if I'm right but I just though I'd share my findings.
Cheers.
At least I couldn't figure out how, and didn't find anything in the documentation to help. arduino.pinMode seems to take an int, and we need a string like "A2" I believe.
Thank you for your time.
Thanks!!
Is there a way to close the connection made with the arduino?
im looking for a solution to use interrupt by processing(read Encoder) while Standardfirmata is uploaded on my arduino
note the capitalization mismatch between the folder and file names: "arduino/library/Arduino.jar"
Works fine on Processing for Mac, but Processing for Rasberry Pi didn't recognize the library until I renamed it to "arduino.jar"
I want to build a design course around processing with physical interaction parts done using arduino and processing/firmata.
It works great for digital/analog sensors and motors, but today many sensors and even motor drivers are i2c.
Will there be a i2c implementation for processing in the near future? thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.