Show Posts
Pages: 1 ... 33 34 [35] 36 37 ... 233
511  Using Arduino / Programming Questions / Re: ARDUINO time library example not working on: February 14, 2014, 12:36:06 pm
We seem to be going round in circles. 

SyncArduinoClock is a program that runs on the PC using Processing, which is a programming environment like the Arduino IDE.
TimeSerial  is an Arduino program.
In order to synchronise the time on the Arduino with the PC both of them must be running.
512  Using Arduino / Programming Questions / Re: ARDUINO time library example not working on: February 14, 2014, 08:26:16 am
Quote
What do i need to do to send it a sync time?
Processing running the program that you posted in your original message looks a likely candidate.
513  Using Arduino / Programming Questions / Re: Can't post twice to twitter, but the posts are not duplicate on: February 14, 2014, 05:50:31 am
I assume that is not your real Twitter token in the code.  The code as posted will not Auto Format because of too many right curly braces.

Quote
I can tweet once, with a message that changes everytime using millis().
You only call millis() in setup so the message will be the same each time until you reset the Arduino and even then millis() could return the same value as it the number of milliseconds since the last reset which will be consistent.
514  Using Arduino / Programming Questions / Re: Arduino 1.0.5-r2 Issue on: February 14, 2014, 05:38:56 am
What are the exact error messages, all of them, you get when you verify the code ?
515  Using Arduino / Programming Questions / Re: ARDUINO time library example not working on: February 14, 2014, 05:27:41 am
Quote
I did not know arduino tells you how to fix errors.
For most errors it can't, but in this case you were lucky because the program writers had anticipated a problem when they changed the IDE so were able to provide a specific message. 

You only need to change
Code:
Serial.print(TIME_REQUEST,BYTE);
to
Code:
Serial.write(TIME_REQUEST);
There is no need to cast the variable to a byte.  Serial.write() sends bytes anyway.

As to your current problem, what is running on the PC to provide the time synchronisation that the Arduino is looking for ?
516  Using Arduino / Programming Questions / Re: First pressed button on: February 14, 2014, 04:00:20 am
Brute force using the Arduino reset button to restart
Code:
if (digitalRead(INPIN1) == LOW)  //read the input
{
  digitalWrite(LEDPIN1, HIGH);  //turn on the corresponding LED
  while(1)  //wait for Arduino to be reset
  {
    //do nothing
  }
}

Using a fifth button to do the reset
Code:
if (digitalRead(INPIN1) == LOW)  //read the input
{
  digitalWrite(LEDPIN1, HIGH);  //turn on the corresponding LED
  while(digitalRead(buttonFive) == HIGH)  //wait for button 5 to be pressed
  {
    //do nothing
  }
  digitalWrite(LEDPIN1, LOW);  //button 5 pressed, turn off the corresponding LED
  break;
}

In practice the wait for button 5 and turning off all LEDS would be in a function rather than repeating the code for each of 4 buttons, or better still do the button reading in a for loop with the button and LED pin numbers in arrays.
517  Using Arduino / Programming Questions / Re: Error code on Arduino UNO. on: February 14, 2014, 02:53:06 am
Quote
Physically pin 0 and 1 serial port RS232 or physical used.
Can you explain what you mean by this ?  What do you have connected to pins 0 and 1 ?
518  Using Arduino / Programming Questions / Re: (5) LM35dz temp sensors to analog pin(s) - uno sketch on: February 14, 2014, 02:48:12 am
Quote
let me have some feedback.
Use Tools + Auto Format!
Guilty as charged.  Although I have to say that I don't like what Auto Format does to array declarations, but in this case it was forgetfulness on my part.
519  Using Arduino / Programming Questions / Re: Reading the first 3 characters of incoming string on: February 14, 2014, 02:38:27 am
Quote
process_data() function is not printing anything . what am I missing
You are missing a string in data ! 

Add a serial print of inByte at the start of processIncomingByte.  Are you getting any bytes to add to the string ?  Print delimiters, such as "<" and ">" around the print of data in process_data.  Does the program ever get to that function and is there anything between the delimiters ?
520  Using Arduino / Programming Questions / Re: Converting Array into a string on: February 14, 2014, 02:21:52 am
Code:
int RFID_Tag_Card1 = 2232211347000
Have you really done that ?  I assume that the missing semi-colon at the end is a typo but that aside, that number will not fit in an int.
521  Using Arduino / Programming Questions / Re: How to compare float variable? on: February 13, 2014, 05:58:03 pm
Quote
I can see on Serial monitor the value passing by 2.0 and doesn't work at all.
Try printing more decimal places before the comparison
Code:
Serial.println(myvar, 8);
does myval ever equal 2.0 ?
522  Using Arduino / Programming Questions / Re: ARDUINO time library example not working on: February 13, 2014, 05:40:40 pm
What does the full error message say ?  Does it give you any indication of how to solve the problem ?
It does here using 1.0.5
523  Using Arduino / Programming Questions / Re: (5) LM35dz temp sensors to analog pin(s) - uno sketch on: February 13, 2014, 01:00:19 pm
You could certainly add a 'fudge factor' to the calculations by using (yet) another array to hold the FF to be applied to each sensor.

The display could then be made to display the same temperature for each sensor but that would only be the case at one, or at best a small range of temperatures, and it is probable that none of them would actually be correct anyway.

Having said that, I would have expected the outputs to be more consistent than those you quote.
524  Using Arduino / Programming Questions / Re: How to make simply lcd menu with 2 buttons ? on: February 13, 2014, 12:50:58 pm
Quote
My favorite is to use two double throw, spring return to center off switches
Strictly that is cheating because although it uses 2 physical devices  in practice I would regard it as 4 switches, but I would not argue over the semantics as long as it meets the OP's needs.  What we don't know us why he wants to use only 2 switches.  4, or 5 buttons in a star configuration would be more natural to use I think.
525  Using Arduino / Programming Questions / Re: Reading the first 3 characters of incoming string on: February 13, 2014, 12:42:26 pm
A step in the right direction for you.

Assuming that the process_data() function prints the whole of the data string correctly, try putting '\0' in data[3] and print it again.  What do you get ?
Pages: 1 ... 33 34 [35] 36 37 ... 233