Show Posts
Pages: 1 2 3 [4] 5 6 ... 273
46  Using Arduino / Programming Questions / Re: how to simplify createChar() custom character written to 2X16 lcd? on: July 26, 2014, 11:17:20 am
Quote
is so, is it possible to use words instead of this 0x02?
Yes.  Use #defines as suggested in an earlier reply or use an enum data type.  Either will allow you to use meaningful names that will be translated into numbers to access the corresponding user defined symbol.
47  Using Arduino / Programming Questions / Re: LCDs and Strings and Substrings Oh My - Need help with my C++ on: July 26, 2014, 11:07:21 am
What do you see if you Serial.println() newString in the last else ?  Print a character such as > before it and < after it so that you can see how long it is.
48  Using Arduino / Programming Questions / Re: SmartGPU2 Software Serial on: July 26, 2014, 09:12:39 am
What that #define does is to cause all instances of SERIALPORT in the source code to be replaced with (Serial) so it would be worth a try to create an instance of SoftwareSerial called mySerial and change the #define to
Code:
#define SERIALPORT mySerial

Note that I have left the brackets off as I believe that they are not necessary but try it for yourself as you have nothing to lose.
49  Using Arduino / Programming Questions / Re: LCDs and Strings and Substrings Oh My - Need help with my C++ on: July 26, 2014, 08:34:54 am
Firstly let's give the normal advice and suggest that you use C style strings instead of Strings, particularly with all that String manipulation which tends to fragment memory.
50  Using Arduino / Programming Questions / Re: Why My Program Does Not Exit from If statements on: July 26, 2014, 08:29:38 am
Is it any better than Auto Format in the IDE though ?

Beauty is, after all, in the eye of the beholder, hence my tongue in cheek suggestions in my previous post.  Just because I prefer to format code that way does not make it better, although I do believe that my suggestions make code easier to read and understand.
51  Using Arduino / Programming Questions / Re: Why My Program Does Not Exit from If statements on: July 26, 2014, 07:37:02 am
Quote
Now is much more well looking. But you must delete 2 spaces at the beginning of this line:
Code:
    if (programMode) {

The level must be the same of:
Code:
  while (!successRead); //the program will not go further while you not get a successful read

and not the same of:
Code:
    programMode = false; // next time will enter in normal mode
    if ( findID(readCard) )

If you are going to insist on changes that must be made when they don't strictly need to be and would be dealt with by Auto Format, then can I suggest some more ?
All braces must be on a line on their own. 
All if, while and do statements must have the associated code block enclosed in braces even if nothing is actually to be executed.

52  Using Arduino / General Electronics / Re: Where to find pluggable 2.54mm terminal blocks? on: July 26, 2014, 05:12:54 am
Yes, thanks.
53  Using Arduino / General Electronics / Re: Where to find pluggable 2.54mm terminal blocks? on: July 26, 2014, 05:01:23 am
I am surprised that you can find 2.54mm pitch blocks with pins as that would mean that the screw terminals are very close together.  Are you sure that the pins are spaced 2.54mm apart and not a multiple of that ?  Can you please give a link to an example product ?

I may have misunderstood what you are looking for but is it something like this ?
http://uk.rs-online.com/web/p/pcb-terminal-blocks/8029040/ but with a smaller pin pitch ?
54  Using Arduino / Programming Questions / Re: Displaying random char string on: July 26, 2014, 01:41:20 am
Try this then expand or change it to do what you want
Code:
char bb[] = {"QWERTYUIOPASDFGHJKLZXCVBNM"};

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  Serial.println(bb[random(0, 25)]);
  delay(1000);
}
Note that as it stands, each time that the program is run it will produce the same sequence of letters.
55  Using Arduino / Programming Questions / Re: switches within a counter sketch on: July 25, 2014, 03:24:02 pm
Quote
the other 2 switches do not change the direction, which makes me think it is not recognising my if statements.
Put some Serial.prints in to see which parts of the code are being run and the value of variables at critical points such as just before they are tested by the if statements.
56  Using Arduino / Programming Questions / Re: NewSoftSerial.h errors on: July 25, 2014, 03:17:15 pm
Looks like yet more problems caused by using an old library,
Replace
Code:
_sSerial.println(26, BYTE);
with
Code:
_sSerial.write(26);
_sSerial.println();

and replace
Code:
#include "Arduino.h"
with
Code:
#include <Arduino.h>
57  Using Arduino / Programming Questions / Re: NewSoftSerial.h errors on: July 25, 2014, 12:35:43 pm
Where did you get the library from ?

Try using the SoftwareSerial library that is installed with the Arduino IDE.  The code that you posted is 5 years old and things have moved on since then.
58  Using Arduino / Programming Questions / Re: how to simplify createChar() custom character written to 2X16 lcd? on: July 25, 2014, 11:50:34 am
Sorry, but I don't understand the problem.  What is it that you have to count every time ?
59  Using Arduino / Programming Questions / Re: [Solved]simple math went wrong!!! help on: July 25, 2014, 05:55:06 am
Quote
float is not supported for LCD
Is that right ?
60  Using Arduino / Programming Questions / Re: #define - compiler-linker precedence on: July 25, 2014, 05:51:02 am
Quote
Can I  #define the pins in the .ino file and expect it to ovreride the definitions in the  library ?
Why not try it yourself ?  Put the #defines in a sample sketch that includes the library then print the values.  What do you get, the values from the library or the values from the .ino ?
Pages: 1 2 3 [4] 5 6 ... 273