Show Posts
Pages: 1 ... 34 35 [36] 37 38 39
526  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Parse Data on: November 05, 2009, 10:06:27 am
I actually get more than 4 lines of data, but I always have 3 values and they are always on the last line.    Anyone have and examples?
527  Forum 2005-2010 (read only) / Frequently-Asked Questions / Parse Data on: November 05, 2009, 07:17:54 am
I'm GETting data from Pachube, but not sure how to use it.
I've been told to
Quote
Parse the data down to just the CSV values and then use sscanf() to put the data into variables.
I haven't a clue how to do that.
The data I get is the following:
Content-Length: 7
Vary: Accept-Encoding

39,60,0
I need to have the last 3 numbers in variables like temperature=39.
Can anyone point me in the right direction?
528  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: RGB LED setup? on: November 03, 2009, 07:09:56 pm
The leds I have are Common Anode.  Anyone have a code example?
529  Forum 2005-2010 (read only) / Frequently-Asked Questions / RGB LED setup? on: November 02, 2009, 07:14:46 pm
Hi,
Silly question, but I can't find what I'm looking for.
Can anyone direct me to how you setup an RGB led with 4 leads?
Also any sample code would be much appreciated.

Thanks  smiley-wink
530  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Power issue? on: November 01, 2009, 04:48:29 pm
Thanks Mike.  That did the trick!
531  Forum 2005-2010 (read only) / Frequently-Asked Questions / Power issue? on: October 31, 2009, 04:34:05 pm
Hi,
I have 3 leds and an LCD connected using the liquid crystal library and one switch running off a 9 volt battery .  Program was running fine, but now it doesn't work until I press reset.

The lcd backlight lights up when I turn it on, but the program doesn't run until I hit reset.  Any ideas as to what is causing this? I've tried switching batteries but no luck.  What could cause this? Is it a power issue?

Thanks!
532  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Atmega328 LCD LiquidCrystal problem on: October 31, 2009, 01:19:53 pm
Have you tried the tutorial?  It has some great pics. Liquid Crystal works fine with the 328.  My problem always comes down to the wiring.

http://www.arduino.cc/en/Tutorial/LiquidCrystal
533  Forum 2005-2010 (read only) / Frequently-Asked Questions / Posting sensor value to a web page on: October 14, 2009, 06:02:05 pm
Hiya,
I've got my Arduino connected to some temp sensors and a WiShield.
What is the best method for getting the sensor data on a web page?
I know HTML, Javascript, but am a beginner at PHP.

I want to end up with a personalized weather page  using my sensor values .  What is the best way to get my live data into a web page?
Is it to POST to a PHP page?

Any help is appreciated.

Thanks!
534  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: HOW/WHERE TO START - PLEASE HELP ME on: October 12, 2009, 07:58:22 am
Start with a starter pack from Adafruit.

http://www.adafruit.com/index.php?main_page=product_info&cPath=17&products_id=68&zenid=083f77a6813a0dd9fcc33371e3c97016
535  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Sources for a shield for a stepper motor on: October 13, 2009, 08:42:09 am
Try this one from Adafruit.
http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=81&zenid=2f5b648532d43cfee198f24a1517c39f
536  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Suggestions please! (ordering for the first time) on: October 03, 2009, 07:32:21 pm
I would start out with a complete Arduino from Adafruit http://www.adafruit.com/index.php?main_page=product_info&cPath=17&products_id=50&zenid=4a93e37550f3f08fed267bd7b1dd0ed6 (no soldering involved as it is already done) and a WiShield from http://Asynclabs.com.
537  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Date & time goes off on: October 02, 2009, 02:12:25 pm
Your latest code is sequencing correctly.
How do I look at what is coming down the serial port?
538  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Date & time goes off on: October 02, 2009, 06:20:15 am
I get a perfect sequence of numbers in Arduino Serial monitor when running your sketch.  Haven't tried Processing yet.
539  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Date & time goes off on: October 01, 2009, 05:45:35 pm
Hi,
I've posted data received from the Serial Monitor
and from Processing as they are slightly different.

Code:
Arduino Serial Monitor

Clock synced at: 1254422090

18:34:ber 1

ÿ1254422091

18:34:52 Thursday Oc18:34:ursday October 1

ÿ1254422093

18:34:54 Thursday Oc18:34:2095

18:35:41 Thursday October 1
18:35:42 Thu18:35:43 Thursday October 1
18:35:44 Thu11:38:50 Fri11:38:5232

11:38:53 Friday November 20

ÿ1258717133

11:38:5ovember 20

ÿ1258717134

11:38:55 Friday Novemberÿ1258717135

Processing

Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
[0] "/dev/tty.modem"
[1] "/dev/cu.modem"
[2] "/dev/tty.usbserial-A40014V7"
[3] "/dev/cu.usbserial-A40014V7"
 Connecting to -> /dev/tty.usbserial-A40014V7
51 Thursday Octotober 1


[ch711]1254422092


53 Thtober 1


[ch711]1254422094


55 Thursday October 1


[ch711]125442tober 1


[ch711]1254422096
rsday October 1


[ch711]1254422144


day November 20


[ch711]1258717131


 Friday November 20


[ch711]125871714 Friday N 20


er 20



540  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Date & time goes off on: October 01, 2009, 05:54:48 am
My thoughts exactly.  I ran the example code and it has the same problem.  After about 10-15 minutes it changes the date and time to something incorrect. I tested it on a Diecimilia 328.
Not sure what to do now if the example doesn't work.  :-?



Code:
// DateTime.pde
// example sketch for the DateTime library

#include <DateTime.h>
#include <DateTimeStrings.h>

#define TIME_MSG_LEN  11   // time sync to PC is HEADER followed by unix time_t as ten ascii digits
#define TIME_HEADER  255   // Header tag for serial time sync message

void setup(){
  Serial.begin(19200);
  pinMode(13,OUTPUT); // we flash the LED each second
}

void  loop(){
  unsigned long  prevtime;
  if( getPCtime()) {  // try to get time sync from pc
    Serial.print("Clock synced at: ");
    Serial.println(DateTime.now(),DEC);
  }
  if(DateTime.available()) { // update clocks if time has been synced
    digitalWrite(13,LOW);  // first flash the LED
    prevtime = DateTime.now();
    while( prevtime == DateTime.now() )  // wait for the second to rollover
        ;
    DateTime.available(); //refresh the Date and time properties
    digitalClockDisplay( );   // update digital clock

    // send our time to any app at the other end of the serial port
    Serial.print( TIME_HEADER,BYTE); // this is the header for the current time
    Serial.println(DateTime.now());
    digitalWrite(13,HIGH);
  }
  delay(100);
}

boolean getPCtime() {
  // if time sync available from serial port, update time and return true
  while(Serial.available() >=  TIME_MSG_LEN ){  // time message consists of a header and ten ascii digits
    if( Serial.read() == TIME_HEADER ) {        
      time_t pctime = 0;
      for(int i=0; i < TIME_MSG_LEN -1; i++){  
        char c= Serial.read();          
        if( c >= '0' && c <= '9'){  
          pctime = (10 * pctime) + (c - '0') ; // convert digits to a number    
        }
      }  
      DateTime.sync(pctime);   // Sync Arduino clock to the time received on the serial port
      return true;   // return true if time message received on the serial port
    }  
  }
  return false;  //if no message return false
}

void digitalClockDisplay(){
  // digital clock display of current date and time
  Serial.print(DateTime.Hour,DEC);
  printDigits(DateTime.Minute);
  printDigits(DateTime.Second);
  Serial.print(" ");
  Serial.print(DateTimeStrings.dayStr(DateTime.DayofWeek));
  Serial.print(" ");
  Serial.print(DateTimeStrings.monthStr(DateTime.Month));
  Serial.print(" ");
  Serial.println(DateTime.Day,DEC);
}

void printDigits(byte digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits,DEC);
}
Pages: 1 ... 34 35 [36] 37 38 39