Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino error on launch (osx intel) on: April 04, 2006, 06:51:54 am
ok I've done a bit more homework. Processing has the same problems with the serial library see here: http://dev.processing.org/bugs/show_bug.cgi?id=315 I'm not entirely sure how to proceed from here if  any of you have suggestions I'd be happy to give it a try.

gck thanks for your suggestions I've checked serial device selected and made sure there where no other apps using the port. Sketches compile fine..

Thanks.
2  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino error on launch (osx intel) on: April 03, 2006, 11:54:25 pm
Hi Massimo I had a go at building rxtx. downloaded done ./configure; make; sudo make install; without problems I copy the new library to the Arduino folder and now the app launches (which is good news smiley ) The problem I get now is that I try to run serial_write_basic for instance and get the following error..

Error inside Serial.<init>()
gnu.io.PortInUseException: Unknown Application
      at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
      at processing.app.Serial.<init>(Serial.java:127)
      at processing.app.Serial.<init>(Serial.java:72)
      at processing.app.Uploader.downloadJava(Uploader.java:130)
      at processing.app.Sketch.upload(Sketch.java:1570)
      at processing.app.Sketch.exportApplet(Sketch.java:1629)
      at processing.app.Editor.handleExport(Editor.java:1724)
      at processing.app.EditorButtons.mouseReleased(EditorButtons.java:343)
      at java.awt.Component.processMouseEvent(Component.java:5166)
      at java.awt.Component.processEvent(Component.java:4963)
      at java.awt.Container.processEvent(Container.java:1613)
      at java.awt.Component.dispatchEventImpl(Component.java:3681)
      at java.awt.Container.dispatchEventImpl(Container.java:1671)
      at java.awt.Component.dispatchEvent(Component.java:3543)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3242)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172)
      at java.awt.Container.dispatchEventImpl(Container.java:1657)
      at java.awt.Window.dispatchEventImpl(Window.java:1606)
      at java.awt.Component.dispatchEvent(Component.java:3543)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
[VP 1] Device is not responding correctly.


BTW I have also tried with the serial library in prcessing  0111 which claims to be universal binary and it doesn't work either I get the same error.  :-/
3  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino error on launch (osx intel) on: April 03, 2006, 03:16:39 am
Hey Massimo I'm not quite the java guru but if you give me precise instructions I can have a go myself. I've got xcode & eclipse running on the machine already...

Thanks.
4  Forum 2005-2010 (read only) / Troubleshooting / Arduino error on launch (osx intel) on: April 02, 2006, 11:58:40 am
Hi there I've tried to install arduino on a new machine (intel mac) and get the following error (see pic). Have you ever seen this before? any suggestions on what might be causing it? thank you.
 
http://www.flickr.com/photos/61113983@N00/121949069/
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: trouble writing PIR library (C++) on: August 28, 2009, 10:00:30 am
Thanks Mike, I tried that but the problem seems to persist. One sensor works more than one doesn't.
6  Forum 2005-2010 (read only) / Syntax & Programs / trouble writing PIR library (C++) on: August 27, 2009, 12:51:57 pm
Hello I am trying to convert the playground code for detecting presence using PIRs http://www.arduino.cc/playground/Code/PIRsense into a library so I can connect several PIRs together.

I am new to C++ but have followed a few examples. The code compiles but doesn't seem to work as expected. I get readings from two PiRs the first few times but then I only get readings from one of them (the second object initialised). I have the suspicion that objects don't work as I think in C++ and one object is overwriting variables for all, I have declared variables protected but not much luck.

all comments, suggestions much appreciated.
PIR.h
Code:
#ifndef PIR_H
#define PIR_H

#include "WProgram.h"
#include "inttypes.h"

class PIR
{
    public:
    PIR(int nodeId, int pinId, long pause);
    void initialise();
    void checkStatus();
    
    protected:
    int _nodeId;
    int _pinId;
    unsigned long lowIn;        
    unsigned long start;
    unsigned long end;
    int _pause;

    bool _ready;
    bool lockLow;
    bool takeLowTime;
    
};
#endif

PIR.cpp
Code:
#include "PIR.h"

/*
 *
 * The Parallax PIR Sensor is an easy to use digital infrared motion sensor module.
 * (http://www.parallax.com/detail.asp?product_id=555-28027)
 *
 * The sensor?s output pin goes to HIGH if motion is present.
 * However, even if motion is present it goes to LOW from time to time,
 * which might give the impression no motion is present.
 * This program deals with this issue by ignoring LOW-phases shorter than a given time,
 * assuming continuous motion is present during these phases.
 */


bool lockLow = true;

PIR::PIR(int nodeId, int pinId, long pause){
_nodeId = nodeId;
_pinId = pinId;
_pause = pause;
}

void PIR::initialise(){

    pinMode(_pinId, INPUT);
    digitalWrite(_pinId, LOW);

    //give the sensor some time to calibrate
    for(int i = 0; i < 30; i++){
        Serial.print(".");
        delay(1000);
    }
    Serial.println("SENSOR ACTIVE");
    _ready = true;
}

void PIR::checkStatus(){
    
    if (_ready == true) {
        
        if(digitalRead(_pinId) == HIGH){
            if(lockLow){  
              //makes sure we wait for a transition to LOW before any further output is made:
              lockLow = false;            
              start = millis()/1000;
              delay(50);
            }        
            takeLowTime = true;
        }
    
        if(digitalRead(_pinId) == LOW){
        
            if(takeLowTime){
                 lowIn = millis();          //save the time of the transition from high to LOW
                 takeLowTime = false;       //make sure this is only done at the start of a LOW phase
               }
               //if the sensor is low for more than the given pause,
               //we assume that no more motion is going to happen
               if(!lockLow && millis() - lowIn > _pause){  
                 //makes sure this block of code is only executed again after
                 //a new motion sequence has been detected
                 lockLow = true;                      
                 end = (millis() - _pause)/1000;
                 Serial.print( _nodeId );
                 Serial.print( " " );
                 Serial.print( _pinId );
                 Serial.print( " " );
                 Serial.print( end - start );
                 Serial.println();
                 delay(50);
               }
       }
    }
}
7  Forum 2005-2010 (read only) / Troubleshooting / BT Board not showing up for pairing on: March 25, 2007, 02:32:15 pm
Hi all,

I have been working with a couple of BT boards for the last couple of weeks, yesterday I removed all the paired devices on my machine (macbook pro running osx 10.4.9) to start over and test my setup for installation with another machine. One of the BT boards is not showing up for pairing anymore, it powers up but it is not discoverable anymore... I have tried to pair it with other 2 machines and it doesn't work either...

has anyone had a similar experience? do you have any suggestions of what might be happening?

many thanks,

G.
8  Forum 2005-2010 (read only) / Interfacing / Re: i2c and a Dallas RTC Anyone?? on: July 02, 2007, 12:17:35 pm
yep, that's done the trick. One final thing if I'm setting the hour to be 6, how do I know if its am or pm? or how can I set it to be 18:00 instead of 6?

Many thanks,
9  Forum 2005-2010 (read only) / Interfacing / Re: i2c and a Dallas RTC Anyone?? on: July 02, 2007, 11:37:40 am
Bob thanks for your reply, the time display issue seems to be solved now.

What I am still struggling with is the module configuration. To set it to 17:31:00 Monday, 2-7-2007 I am doing the following on setup()


Code:
Wire.beginTransmission(104); // transmit to device #104, the ds1307
  Wire.send(0);
  Wire.send(0x00);
  
  Wire.send(0);  //sec
  Wire.send(31); //min
  Wire.send(17);  //hour
  Wire.send(2);  //day
  Wire.send(2);  //date
  Wire.send(7);  //month
  Wire.send(7);  //year
  Wire.endTransmission();    // stop transmitting

  delay(100); /* */

when printing back the values, I get:

Code:
21:05:32 Sunday, 2/2/2007

something its obviously not working..  smiley-razz
10  Forum 2005-2010 (read only) / Interfacing / Re: i2c and a Dallas RTC Anyone?? on: July 02, 2007, 03:05:28 am
Hi there, I have modified slightly the code to give me the full set of data the module outputs, and removed the code specific to the display.

the problem I'm getting is that the data returned doesn't seem to make much sense...  smiley


Code:
/*
 * A single-digit clock
 * (c) 2007 Bob Copeland <me at bobcopeland.com>
 */

#include <Wire.h>


void setup()
{

  Wire.begin();
  Serial.begin(9600);

  /*
    // program the time & enable clock
   Wire.beginTransmission(0x68);
   Wire.send(0);
   Wire.send(0x00);
   Wire.send(0x52);
   Wire.send(0x80 | 0x21);
   Wire.endTransmission();
   */
}

void loop()
{
  // reset register pointer
  Wire.beginTransmission(0x68);
  Wire.send(0);
  Wire.endTransmission();
  delay(100);

  Wire.requestFrom(0x68, 6);
  char secs = Wire.receive();
  char mins = Wire.receive();
  char hrs = Wire.receive();
  char day = Wire.receive();
  char date = Wire.receive();
  char month = Wire.receive();
  char year = Wire.receive();

  Serial.print("time is: ");
  Serial.print( hrs, DEC );
  Serial.print(":");
  Serial.print( mins, DEC );
  Serial.print(":");
  Serial.print( secs, DEC );
  Serial.print(" day, ");
  Serial.print( day, DEC );
  Serial.print(" date, ");
  Serial.print( date, DEC );
  Serial.print(" month, ");
  Serial.print( month, DEC );
  Serial.print(" year, ");
  Serial.print( year, DEC );
  Serial.println();

  delay(1000);

}

this what the module is outputting

Code:
time is: 34:49:66 day, 2 date, 5 month, 5 year, 0
time is: 34:49:67 day, 2 date, 5 month, 5 year, 0
time is: 34:49:68 day, 2 date, 5 month, 5 year, 0
time is: 34:49:69 day, 2 date, 5 month, 5 year, 0
time is: 34:49:70 day, 2 date, 5 month, 5 year, 0

I guess it has to do with the clock config, how do you go about configuring the module for your own time? I am a I2C newbie  :-? and I'm not making much sense of the address map below:



Thanks.
11  Forum 2005-2010 (read only) / Interfacing / Re: Sensirion SHT11 Temperature/Humidity Sensor on: February 08, 2007, 10:25:42 am
If you don't mind posting it, it would be useful, I have parked the sensor since so to have some use for it would be nice.  smiley
12  Forum 2005-2010 (read only) / Interfacing / Sensirion SHT11 Temperature/Humidity Sensor on: August 08, 2006, 07:24:57 am
Helloo, has anybody had any experience interfacing the module above with Arduino? the confusion lies on several points..

circuit schematic seems to be different on the Parallax data sheet and the actual Sensirion data sheet.

the coms protocol/sequences seem understandable although I don't speak C nor basic... but the maths doing the conversion from the temp & humidity readings to usable numbers seems to do extensive use of floats....

all comments / suggestions would be welcome.

many thanks,

G.

http://www.parallax.com/detail.asp?product_id=28018
Pages: [1]