| Arduino Forum ::  Members :: Frisky
 Show Posts Pages: 1 2 3 [4] 5 6 ... 8
 46 Using Arduino / Project Guidance / Re: converting 2 variables into character array variable on: January 27, 2013, 11:03:08 am WildbillI appreciate your feedback, I will follow the convention as I move forward. Thank you everyone who responded to the topicI always learn something new with every topic I post in the forum. You all are respected!Don
 47 Using Arduino / Project Guidance / Re: converting 2 variables into character array variable on: January 26, 2013, 07:25:19 pm Peter and MarkThanks I have a hard time coming up with simple solutions to my problems... I hope this gets better with time. Mark I understand that code in setup runs once but is there a reason why putting that for loop in Loop() is a bad idea? I want to learn do's and don't of Arduino. I've use the for loop in WinAvr. Can you recommend books, or web sites to help learn the best approach solving the task needed?I knew of modus arithmetic but wasn't sure how to use it.Don
 48 Using Arduino / Project Guidance / Re: converting 2 variables into character array variable on: January 26, 2013, 06:12:37 pm Ill give it a try much simpler that what I had lol thanks guys
 49 Using Arduino / Project Guidance / converting 2 variables into character array variable on: January 26, 2013, 05:00:32 pm HiI have written some code that takes the amount on minutes called durationInMins.durationInMins is converted to 2 byte variables named hours, and mins.I don't know how to convert the byte variables hours, mins to a char array.I'm trying to fill the character array with the data as follows "hh:mm" format.Here is what I have so far I have it running on my Uno board.Thank youDonCode:#include void setup() {  Serial.begin(115200);}void loop(){  char duration[] = {"  :  "};  int durationInMins = 490;  byte hours = 0;  byte mins = 0;  double i, r;  r = durationInMins * .01666;  Serial.print("Durationin mins: ");  Serial.println(durationInMins);  r = modf(r, &i);  r = r * 60;  mins = byte(round(r));  hours = byte(i);  Serial.print("Hours: ");  Serial.println(hours);  Serial.print("Mins: ");  Serial.println(mins);  Serial.println();    /*    I now want to convert     variable hours to a character array;    and variable mins to a character array    then put them in char array duration    char duaration[] = {"hh:mm"};   */ Serial.println(duration); Serial.println();    for(;;){}  }
 50 Using Arduino / Networking, Protocols, and Devices / Re: Client / Server connection on: January 26, 2013, 01:33:06 pm Hi Paul Does client.stop() provide a graceful disconnection from the server it was connected to? I've been using the Twitter library and a function to send and email out. I notice that neither of these use client.stop(). I added it to the email function. I haven't tried to add it to Twitter Library wanted to ask you about it's use. When I'm done communicating with the smtp server I have the command client.println("QUIT"); So I'm telling the server I'm done should I just let the server drop the connection to the client? I appreciate your input here.ThanksDon Code:bool Twitter::post(const char *msg){#if defined(ARDUINO) && ARDUINO < 100 //if earliar than Ardunio 1.0 DNSError err = EthernetDNS.resolveHostName(LIB_DOMAIN, server); if (err != DNSSuccess) { return false; }#endif parseStatus = 0; statusCode = 0;#if defined(ARDUINO) && ARDUINO < 100 //if eariler than Ardunio 1.0 if (client.connect()) {#else if (client.connect(LIB_DOMAIN, 80)) {#endif client.println("POST http://" LIB_DOMAIN "/update HTTP/1.0"); client.print("Content-Length: "); client.println(strlen(msg)+strlen(token)+14); client.println(); client.print("token="); client.print(token); client.print("&status="); client.println(msg);                            client.stop() //? should I use it?? ***************** } else { return false; } return true;}byte postEmail(){  digitalWrite(ledPost,ON);  EthernetClient client;  if (client.connect("smtp.mail.wowway.com", 25))     {       delay(500);        client.println("HELO MYSERVER");       client.println("MAIL FROM:");       client.println("RCPT TO:");       client.println("DATA");       client.println("From: User ");       client.println("To: Person at ");                     client.println("SUBJECT: my subject here");       client.println();       client.println("Body of message");       client.println();       client.println(".");  //tell server we are done       delay(500);       client.println("QUIT");       client.stop();  // seems to work fine should I use it?? *********************       delay(2000);       digitalWrite(ledPost,OFF);       return true;    }  else    {       digitalWrite(ledError,ON);        return false;    }  }
 51 Using Arduino / Microcontrollers / Re: atmega1284 programming from a 328 chip on: January 25, 2013, 05:30:03 pm Hi Crossroads  Could I use my JTAGICE that has a ISP 6pin connector to program a bootloader into a ATMega1284p?Would I use the Aduino IDE or AVR Studio 4.18?  How does this chip fair as an Arduino say with the SPI system for the W5100 ethernet controller. I ordered a few of these from Mouser. I also have a STK500 also I could use with a 16Mhz crystal too.Don
 52 Using Arduino / Programming Questions / Re: Twittering with Arduino+Ethernet Shield on: January 23, 2013, 09:10:21 pm PeterI think that after the Ardunio programs it resets and runs his code. Then he is watching it via serial monitor to debug and that is why he is double posting or tweeting that will give you a 403 since he is sending the same message. He will need to change his tweet some too since he can't keep sending the same thing.Maybe read millisCode:unsigned long time; time = millis();  //prints time since program started client.println(time);
 53 Using Arduino / Programming Questions / Re: Twittering with Arduino+Ethernet Shield on: January 23, 2013, 08:57:44 pm I bet the after the Arduino is completed programing it resets runs your setup code posting the message.Then you fire up the serial monitor and the board resets again, you double tweeted.If you remove the posting of the tweet from setup() function and do something like this in loop() you can control it yourself using the serial monitor put a "t" in the line and press send.... Code:void loop(){   byte inChar;      inChar = Serial.read();   delay(100);   if(inChar == 't')   {        Serial.println("connecting ...");       if (twitter.post(msg))         {           // Specify &Serial to output received response to Serial.          // If no output is required, you can just omit the argument, e.g.          // int status = twitter.wait();          int status = twitter.wait();          if (status == 200) {          Serial.println("OK.");        }      else        {           Serial.print("failed : code ");           Serial.println(status);        }         inChar = 0;     }}
 54 Using Arduino / Programming Questions / Re: Twittering with Arduino+Ethernet Shield on: January 23, 2013, 08:37:36 pm did anything post to twitter? if you use those setting in your computer can you get on the internet get to twitter or google, yahoo? to see if they really would maybe ping, traceroute403 means you are trying to send a duplicate tweet...Don