Contact

This is my blog about science, physics and technology. “my brain is open” (P. Erdos).
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

email physlight@gmail.com
twitter https://twitter.com/physicslight
facebook http://www.facebook.com/physlight

Advertisements

One comment

  1. GreatSitePhysicsLight · · Reply

    Hey, I working on a project with a current sensor!
    I was wondering if you could help me figure out why this was not working!

    Its seems to sometimes, adjust the Y axis to what it should be, yet no data is ever graphed!

    /*
    * Arduino serial read with Java
    * how to serial read data from Arduino board
    * with your PC using Java
    * communication protocol based on Ardulink by Luciano Zu
    * http://www.ardulink.org/
    * author Physics Light
    * date December 2014
    * license creative commons 4.0 international (CC BY 4.0)
    * http://creativecommons.org/licenses/by/4.0/
    */

    int RelayPin = 2;

    void setup(){
    // init serial port baud rate
    Serial.begin(115200);
    // Serial.print(“SERIAL”);
    // generate different seed number if pin 0 is unconnected
    analogReference(DEFAULT);
    }

    void loop(){
    // generate a random number between 0 and max
    int CurrentRaw;
    CurrentRaw = analogRead(A2);
    /*Serial.print(“SERIAL”);*/
    Serial.print(“SERIAL”);
    Serial.print(CurrentRaw);
    Serial.write(255);
    int RelayPin = 2;
    pinMode(RelayPin, OUTPUT);
    digitalWrite(RelayPin,HIGH);

    Error: Exception in thread “Thread-4” org.jfree.data.general.SeriesException: You are attempting to add an observation for the time period

    So I moved the Serial.print line… and it connected, Y axis adjusted yet nothing was plotted.

    Do you have any ideas?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s