Show Posts
Pages: 1 ... 26 27 [28] 29 30 ... 33
406  Using Arduino / Programming Questions / convert long integer to string on: December 14, 2011, 01:38:12 pm
How can I convert a long integer to a string?

--Scott
407  Using Arduino / Installation & Troubleshooting / Re: Problems uploading sketch from Macbook Pro on: December 05, 2011, 10:47:44 pm
This probably doesn't help, but I'll elaborate on my original post.  Like Marizon I'm running bootcamp with Win7 on my macbook book pro. I was able to upload sketches to the Uno, it was only the Duemilanove that had problems (both had the standard Ethernet shield).  Nw for some mysterious reason, the Macbook pro started working with the Duemilanove board.  I didn't do anything, just tried it again the next day.
408  Using Arduino / Programming Questions / millis rollover on: November 30, 2011, 01:53:32 pm
I was doing a little reading on watchdog timers and several places I read that when millis() reaches it's limit (49 days) it can cause the arduino to lock up.  I'm unclear about this.  Will the Arduino lock up, or is this something that might under special circumstances but normally rolls over just fine?  Should I have special code that looks at the millis value and does something before it reaches the max? 

I have Arduino IDE ver 0022 and use duemilanove (328) and Uno boards.
409  Using Arduino / Installation & Troubleshooting / Re: Problems uploading sketch from Macbook Pro on: November 30, 2011, 08:06:48 am
I have the same problem with both USB ports
410  Using Arduino / Programming Questions / Re: Does my bootloader support watchdog timer? on: November 30, 2011, 08:02:39 am
Could you write a sketch that tested an Arduino to see if it properly supported a WDT?  Is so, how would you do it.
411  Using Arduino / Programming Questions / Does my bootloader support watchdog timer? on: November 29, 2011, 11:30:33 pm
I have a couple Duemilanoves and an Uno.  Does the boot loader support a watchdog timer?  If some Arduinos do and some don't, how can I tell?
412  Using Arduino / Installation & Troubleshooting / Re: Problems uploading sketch from Macbook Pro on: November 29, 2011, 11:23:12 pm
One more thing to add, my MacPro is 32-bit OS, the MacBook Pro is 64-bit. 
413  Using Arduino / Installation & Troubleshooting / Problems uploading sketch from Macbook Pro on: November 29, 2011, 11:19:27 pm
I have a Mac Pro and a Macbook Pro.  Both are running OSX 10.6.8 and both have the Arduino IDE ver 0022 installed.  From my MacPro I can upload programs to my Arduino Duemilanove  (Atmega 328).  But when I try to do it from my Macbook Pro (using same USB cable and same program), I get this error:

Binary sketch size: 11524 bytes (of a 32256 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x86
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x1e

I know the mackbook pro is on the right port and communicating with the arduino because when I open the serial monitor, I can see the text my sketch is sending to it using serial.print command.

Any idea why I'm having problems with my MacBook Pro and ardunio?

-Scott
414  Using Arduino / Installation & Troubleshooting / Re: Can't get FTDI drivers to work on Macbook pro on: November 09, 2011, 11:39:08 am
I tried a new USB cable and it's working now!
415  Using Arduino / Installation & Troubleshooting / Can't get FTDI drivers to work on Macbook pro on: November 08, 2011, 12:33:57 pm
I have a Macbook Pro (early 2011 model) using bootcamp to run both Windows 7 (64-bit) and Mac OSX 10.6.8.  I can't get the FTDI drivers to work with either OS.  I installed them from http://www.ftdichip.com/Drivers/VCP.htm.  I'm using Arduino 022 and when I go to to Tools > Serial Port, there are no com ports listed.  In my OSX it only lists 4 bluetooth ports.  In Windows 7 the Serial Ports menu item is grayed out (I think, I'm not logged into Win 7 right now).  I've had the Arduino running fine on my MacPro and a Win XP laptop, but I can't get FTDI drivers to work on my Macbook pro. 

416  Using Arduino / Networking, Protocols, and Devices / Re: Xbee.h returning incorrect ADC values on: July 30, 2011, 08:32:41 pm
I guess I made a mistake pasting the code to the forum.  I was getting samples from ioSample.getSampleSize().  After this problem cropped up I decided to see what would happen with the Xbee_Test_IOSamples sketch that comes with xbee.h library.  It shows the same problem.  Here's the sketch

Code:
#include <XBee.h>
XBee xbee = XBee();

Rx16IoSampleResponse ioSample = Rx16IoSampleResponse();

void setup() {
  xbee.begin(9600);
}

void loop() {
  //attempt to read a packet
  xbee.readPacket();

  if (xbee.getResponse().isAvailable()) {
    // got something

    if (xbee.getResponse().getApiId() == RX_16_IO_RESPONSE) {
      xbee.getResponse().getRx16IoSampleResponse(ioSample);

      Serial.print("Received I/O Sample from: ");
      Serial.println(ioSample.getRemoteAddress16(), HEX);

      Serial.print("Sample size is ");
      Serial.println(ioSample.getSampleSize(), DEC);

      if (ioSample.containsAnalog()) {
        Serial.println("Sample contains analog data");
      }

      if (ioSample.containsDigital()) {
        Serial.println("Sample contains digital data");
      }

      for (int k = 0; k < ioSample.getSampleSize(); k++) {
        Serial.print("Sample ");
        Serial.print(k + 1, DEC);
        Serial.println(":");

        for (int i = 0; i <= 5; i++) {
          if (ioSample.isAnalogEnabled(i)) {
            Serial.print("Analog (AI");
            Serial.print(i, DEC);
            Serial.print(") is ");
            Serial.println(ioSample.getAnalog(i, k));
          }
        }

        for (int j = 0; j <= 8; j++) {
          if (ioSample.isDigitalEnabled(j) && ioSample.containsDigital()) {
            Serial.print("Digital (DI");
            Serial.print(j, DEC);
            Serial.print(") is ");
            Serial.println(ioSample.isDigitalOn(j, k));
          }
        }
      }
    }
     
    else {
      Serial.print("Expected I/O Sample, but got ");
      Serial.print(xbee.getResponse().getApiId(), HEX);
    }
  }
  else if (xbee.getResponse().isError()) {
    Serial.print("Error reading packet. Error code: ");
    Serial.println(xbee.getResponse().getErrorCode());
  }
}

417  Using Arduino / Networking, Protocols, and Devices / Re: Xbee.h returning incorrect ADC values on: July 30, 2011, 08:13:46 pm
Sample size is pulled from the xbee data using ioSample.getSampleSize()

418  Using Arduino / Networking, Protocols, and Devices / Xbee.h returning incorrect ADC values on: July 30, 2011, 03:57:05 pm
I am trying to modify the tweet-a-watt project and push the data to pachube with an Ethernet shield instead of sending to twitter from my PC. I'm having some trouble reading the analog inputs 0 and 4 (volts and amps). I have the xbee Tx is setup just like the Tweet-A-Watt project calls for:
MY=1, SM=4, ST=3, SP=C8, D4=2, D0=2, IT=13, IR=1

I'm basically using the XBee_Test_IOSamples sketch that comes with Xbee.h library to read the data. When I read xbee analog inputs, I get this:
Volts = ( 163.00 211.00 322.00 489.00 650.00 766.00 826.00 837.00 785.00 665.00 493.00 335.00 224.00 172.00 164.00 226.00 351.00 524.00 679.00 )
Current = ( 322.00 489.00 650.00 766.00 826.00 837.00 785.00 665.00 493.00 335.00 224.00 172.00 164.00 226.00 351.00 524.00 679.00 0.00 0.00 )

You'll notice that the current values are the same as the voltage values, just shifted two spots to the left. Anyone know what I am doing wrong?

Here's my sketch:
Code:
#include <XBee.h>
XBee xbee = XBee();
Rx16IoSampleResponse ioSample = Rx16IoSampleResponse();

void setup() {
  xbee.begin(9600);
}

void loop() {
  float volts[19];
  float current[19];
 
  //attempt to read a packet
  xbee.readPacket();

  if (xbee.getResponse().isAvailable()) {
    // got something

    if (xbee.getResponse().getApiId() == RX_16_IO_RESPONSE) {
      xbee.getResponse().getRx16IoSampleResponse(ioSample);

      Serial.print("Received I/O Sample from: ");
      Serial.println(ioSample.getRemoteAddress16(), HEX);

      Serial.print("Sample size is ");
      Serial.println(ioSample.getSampleSize(), DEC);

      for (int k = 0; k < ioSample.getSampleSize(); k++) {
          volts[k] = ioSample.getAnalog(0, k);
          current[k] = ioSample.getAnalog(4, k);
      }
     
      // Print array with voltage and current ADC values from Xbee
      Serial.print("Volts =   ( ");
      for (int i = 0; i < samples; i++) {
          Serial.print(volts[i]);
          Serial.print(" ");
      }
      Serial.println(" )");
      Serial.print("Current = ( ");
      for (int i = 0; i < samples; i++) {
          Serial.print(current[i]);
          Serial.print(" ");
      }
      Serial.println(" )");
     
    }
    else {
      Serial.print("Expected I/O Sample, but got ");
      Serial.print(xbee.getResponse().getApiId(), HEX);
    }
  }
  else if (xbee.getResponse().isError()) {
    Serial.print("Error reading packet. Error code: ");
    Serial.println(xbee.getResponse().getErrorCode());
  }
}
419  Using Arduino / Networking, Protocols, and Devices / Re: Xbee Series 1 mxing AT commands with readpacket() on: July 03, 2011, 09:23:47 pm
I don't how to tell when it's in command mode.  So I added the command ATCN at the end of Loop() which is supposed to make it exit command mode.  But this didn't help.  I still have the same problem.
420  Using Arduino / Networking, Protocols, and Devices / Re: Xbee Series 1 mxing AT commands with readpacket() on: July 03, 2011, 08:28:46 pm
Is this true even if you don't call the remove AT command function?

If you do call the remote AT command function, do the transmit and receive lights on the shield blink when the remote XBee sends data?

Yes, I actually had this part working first.  I just added the AT Command code today. Before that I was reading the inputs with the readpacket().
Pages: 1 ... 26 27 [28] 29 30 ... 33