Show Posts
Pages: 1 ... 9 10 [11] 12 13 ... 295
151  Using Arduino / Programming Questions / Re: 'check' was not declared in this scope issue on: August 29, 2014, 02:24:10 am
  int check()
What is this line doing inside the loop() function ?
152  Using Arduino / Programming Questions / Re: Help: how to break this while loop in my Arduino Leonardo code on: August 27, 2014, 01:32:42 am
There is something fundamentally wrong with how you are dealing with the serial input to the Arduino.
  if(Serial1.available() > 0)
This checks whether there is serial data available but does not check how many bytes there are.
    data1[0] =;
    data1[1] =;
    data2[0] =;
    data2[1] =;
Without knowing how many bytes are available you immediately read from serial 4 times.  At best the results are going to be erratic.

If you know that you will always be receiving 4 bytes then read each of them as they become available and do not assume that because one byte is available that you can sensibly read four.
153  Using Arduino / Programming Questions / Re: Arduino send string to App inventor on: August 27, 2014, 01:19:59 am
Do you have a problem sending the String from the Arduino or dealing with it when it is received by Android ?

Sending it should be easy.  In fact you seem to be doing it already in your program
seems to me to be sending what you have received back via Bluetooth.

If you have a problem dealing with it on teh Android device then you are asking in the wrong forum.
154  Using Arduino / Programming Questions / Re: Trouble with DateTime Library on: August 26, 2014, 10:51:19 am
Please do us and yourself a favour by posting the program copied from your IDE.  When doing so please note the advice in the stickies at the top of this forum, particularly the advice to use code tags.
155  Using Arduino / Programming Questions / Re: Simple IF Statement Error on: August 26, 2014, 04:10:52 am
The serial monitor won't update.
Please post your whole program as it is now.
156  Using Arduino / Programming Questions / Re: Controlling motors with pushbuttons (2 pin) on: August 26, 2014, 04:02:13 am
if (digitalRead(10) == LOW)
  digitalWrite(13, HIGH);
  //put code here to be run if the button is not pressed
157  Using Arduino / Programming Questions / Re: Missing Ping Library Among Other Things in Code PLEASE HELP on: August 24, 2014, 02:06:16 pm
It would have helped if you posted the error.  When I try to compile your program I get
sketch_aug24a:2: error: 'Tone' does not name a type
sketch_aug24a.ino: In function 'void setup()':
sketch_aug24a:28: error: 'tone1' was not declared in this scope
sketch_aug24a.ino: In function 'void loop()':
sketch_aug24a:44: error: 'tone1' was not declared in this scope
sketch_aug24a:45: error: 'tone1' was not declared in this scope
None of the errors has anything to do with ping.

Do you have Tone.h on your system and if so where is it and what is in it ?
158  Using Arduino / Programming Questions / Re: Serial print and millis does not work as it is intended on: August 23, 2014, 01:45:57 pm
//serial print will show data
  Serial.print("pot = " );
  Serial.print("\t  led = ");
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis > interval);
 //save the last time message was printed
 previousMillis = currentMillis;

You need to move the printing into the code executed if the timing interval has passed and also fix the problem with this line
if (currentMillis - previousMillis > interval);
The semi-colon ends the code executed if the test is true so as it stands nothing will happen whether the test is true or false.
159  Using Arduino / Programming Questions / Re: Arduino IDE Literal words: PRESSED why is it blue text? on: August 23, 2014, 12:43:57 pm
In library folders you will often find a file named keywords.txt which contains a list of key words pertaining to the library.  The contents of these files cause words in the IDE to be coloured to make them stand out as keywords.  However, the mechanism is useless because the colour coding is picked up whether or not you have included the library in your program.

In your case the word PRESSED must be in a library keywords.txt file on your system.
160  Using Arduino / Programming Questions / Re: Problem retriving value from a Switch case on: August 23, 2014, 04:23:33 am
In terminal when I give " 1 " it gives me

Enter a correct value
Enter a correct value
You are seeing the ASCII value of the digit 1 followed by the ASCII value of a linefeed which is presumably how you have the serial monitor line ending set.

Now that you know what you are getting from serial you can change your switch/case to suit or subtract 48 from the incoming byte value after reading it and leave the switch/case alone.
161  Using Arduino / Programming Questions / Re: Problem retriving value from a Switch case on: August 23, 2014, 03:46:24 am
  int sv =;
What type of variable does return ?
To see what value you are actually getting, if any, try printing sv after you have read it.  Does it match any of the values that you are testing for in switch/case ?
162  Using Arduino / Programming Questions / Re: char and int issue on: August 23, 2014, 03:22:30 am
If the UID of the card is something like "CD D2 F8 FE" then thats a mixture of int's and char's,
It looks like you need to do some reading up on hexadecimal representation of numbers, because that's what each of the values in the string you quoted look like to me.
163  Using Arduino / Programming Questions / Re: How to control domotiga by database sqlite ? on: August 23, 2014, 03:17:49 am
If I have understood you correctly domotiga (whatever that is) is connected to the Pi.
If that is the case then why are you asking this question in an Arduino forum ?
If I have misunderstood then please explain in more detail how the Arduino is involved with domotiga.
164  Using Arduino / Programming Questions / Re: Efc was not declared in this scope. on: August 23, 2014, 01:15:41 am
Which board have you got selected in the IDE ?
165  Using Arduino / Programming Questions / Re: saving changes to sketches on: August 22, 2014, 12:45:04 pm
Where are you trying to save the programs ?

Mine go into C:\Users\Bob\Documents\Arduino which is set in File/Preferences
Pages: 1 ... 9 10 [11] 12 13 ... 295