Pages: [1]   Go Down
Author Topic: Help with Weird Processing & arduino output problem  (Read 523 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there,

I am using an Arduino Uno with firmata and processing to read values from a sensor which works fine but also to write values to an LED which doesn't work at all.

I am using Pachube to send and recieve data from a server.


I have the arduino & eeml (pacube) library folder in the right place.

Everything thing works on my laptop and it is the exact same code /libraries/ arduino setup / processing  and OS ( os x 10.5.80)

Any ideas??

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am using an Arduino Uno with firmata and processing to read values from a sensor which works fine
The sensor works fine, or the Arduino and Processing apps work fine?

Quote
but also to write values to an LED which doesn't work at all.
What kind of LED are you trying to write to? On/off or PWM?

Quote
I have the arduino & eeml (pacube) library folder in the right place.
Sketches would not even compile if this wasn't the case, so it's useless information.

Quote
Everything thing works on my laptop and it is the exact same code /libraries/ arduino setup / processing  and OS ( os x 10.5.80)
Exact same code, etc. as what?

Quote
Any ideas?
Quit beating around hte bush, and tell us what the problem is. Where is your code? What does it do that you don't want it to do? What does it not do that you want it to do?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The sensor works fine on both the Arduino program and Processing app.

I am trying to write PWM.

The sketch works as in it outputs the Pachube dataIn on too other computers that I've testing so I don't think the code is the problem.

Right now it's sending data out to a feed and fetching data from another feed, which prints it both the values fine,it  just won't write to the LED.

Here is my code anyway;

Code:
import processing.serial.*;
import cc.arduino.*;

import eeml.*;

Arduino arduino;
int myLocalValue;
int myRemoteValue;

float lastUpdate;

DataIn dIn;
DataOut dOut;

void setup()
{
    size(255,255);
    println(Arduino.list());
    arduino = new Arduino(this, Arduino.list()[0], 57600);   
    dIn = new DataIn(this,"http://api.pachube.com/v1/feeds/25550.xml", "API KEY", 15000); 
    dOut = new DataOut(this, "http://api.pachube.com/v2/feeds/19423.xml", "API KEY");
 
    dOut.addData(0,"description");

}

void draw() {
 
   myLocalValue = arduino.analogRead(0);   

   // update once every 15 seconds
    if ((millis() - lastUpdate) > 15000){
        println("ready to POST: ");
        dOut.update(0, myLocalValue); // update the datastream
          println(myLocalValue + "latest");
         
        int response = dOut.updatePachube(); // updatePachube() updates by an authenticated PUT HTTP request
        println(response); // should be 200 if successful; 401 if unauthorized; 404 if feed doesn't exist
        lastUpdate = millis();
    }   
   
     //  println(myLocalValue + "\t" + myRemoteValue);
 

   
   
}

void onReceiveEEML(DataIn d){ 
    myRemoteValue = int(d.getValue(0)); 
   println("lastest remote value");
   println(myRemoteValue);
   arduino.analogWrite(11,myRemoteValue);   
   arduino.analogWrite(10,myRemoteValue);   

}


 
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The sketch works as in it outputs the Pachube dataIn on too other computers that I've testing so I don't think the code is the problem.
So, the problem has nothing to do with Processing or the Arduino? Instead, it is a generic "something is weird with my computer" issue?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes. But seeing as this is an arduino forum and I am using arduino, I would suspect this is the right place to come to get help to try fix this kind of problem no?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I'm using Visual Studio. Can you help me with problems with it? Just because you have an application on your computer does not mean that this is the place to come for ALL your computer issues. Good luck, though.
Logged

Pages: [1]   Go Up
Jump to: