Show Posts
Pages: 1 [2] 3 4 ... 231
16  Using Arduino / Programming Questions / Re: Strange error message on: April 13, 2014, 07:54:01 am
Does anyone know at what stage this error occured ?  Does anyone know what the program was ?  Does anyone know what board was being used ?  Someone must know.  Right ? (hint)
17  Using Arduino / Project Guidance / Re: arduino and access on: April 12, 2014, 04:58:49 am
You will need something running on the PC to accept the data.  Once you have decided what that something is then you can turn your attention to the Arduino code to send the data.  Similarly the other way.

Depending on the amount and frequency of the data transfer you might like to consider saving the data to an SD card attached to the Arduino and transferring it to and from the PC using the card.
18  Using Arduino / Programming Questions / Re: CapSense Output Low? on: April 12, 2014, 01:42:56 am
You are using pin 4 as the Send pin for both sensors so you can't "turn off" one of them.

Perhaps it would be better if you explained what you are trying to achieve rather than describing what you think is the solution.  For instance, if you want one sensor to be inactive for a period of time then either don't read it or ignore the result when you do read it.
19  Using Arduino / Programming Questions / Re: CMUCAM4 Color test in Arduino on: April 11, 2014, 10:33:38 am
Have you tried searching this form for CMUCAM4 ?

I also found this on the Web with just a few clicks
http://www.cmucam.org/docs/cmucam4/arduino_api/class_c_m_ucam4.html
20  Using Arduino / Programming Questions / Re: Read analog pin on: April 11, 2014, 08:23:19 am
Are you sure that the socket that you indicate in your picture is pin A1 ?
21  Using Arduino / Programming Questions / Re: Read analog pin on: April 11, 2014, 07:01:10 am
Have you taken note of what I wrote in reply #3 ?
22  Using Arduino / Programming Questions / Re: Read analog pin on: April 11, 2014, 06:40:13 am
In order for analogRead() to work it needs to have a voltage to measure against.  This is provided by having a common GND connection between the Arduino and the device being measured.  Your drawing does not show such a common GND connection.  Have you missed it from the drawing or does it not exist ?
23  Using Arduino / Programming Questions / Re: Parsing large strings on: April 10, 2014, 06:46:30 am
Quote
I am attempting to put in a sample string to get my parsing right.
You are not using a string you are using a String.  Not the same thing at all, but that does not seem to be the problem judging by the error message which seems to indicate that the problem lies with the underlying  Java code behind the IDE.

It looks like you are going to have to take steps to reduce the size of the string.   For instance does it need to be a full blown HTML table complete with details of background colours etc which will be irrelevant to the Arduino ?
24  Using Arduino / Programming Questions / Re: if else commands on: April 10, 2014, 04:36:33 am
Unconventional but possibly workable....

Not the solution to your problem, but why are you using digital pins to provide the 5V to the sensors ?  Why not just connect them to 5V ?

Quote
The note produced isn't in the program, but is close to the average of all of the notes
That does not make sense.  To quote from the tone() function reference page
Quote
Only one tone can be generated at a time. If a tone is already playing on a different pin, the call to tone() will have no effect. If the tone is playing on the same pin, the call will set its frequency.

Can I suggest that you add a Serial.print() just before each tone() and noTone() so that you can track which sections of the program are being activated ?

Personally I prefer to use braces to hold blocks of code in if/else even if only one line of code is to be executed, like this
Code:
  if (val_1 < threshold)     // if a value drops below the threshold
  {
    tone (speaker, Note_C);
  } // a note is played
  else
  {
    noTone (speaker);                     
  }
I find it much easier to visualise what is going on and if later I add other lines of code, such as I suggested above, there is no confusion as to which code will be executed.
25  Using Arduino / Programming Questions / Re: State variables and millis help. on: April 10, 2014, 02:52:32 am
currentMillis or an equivalent name for me too for the reasons that Robin has outlined.  Apart from anything else, using a meaningful name makes the program more readable as in
Code:
if (currentMillis - startMillis >= interval)
but as in many things it is a matter of personal preference.
26  Using Arduino / Programming Questions / Re: if else commands on: April 10, 2014, 02:38:54 am
What sort of sensors are you using and how are they wired ?
What range of values do you get from your analogRead() inputs ?

Once you have got this working investigate the use of arrays and cut the length of the program by about 80%
27  Using Arduino / Programming Questions / Re: Getting steppermotor to work with my present program. on: April 10, 2014, 12:55:37 am
Posting your code in quote tags rather than code tags has screwed it up, turned much of it into italics and put a couple of smileys in it along the way

Please repost it in code tags in order to make it readable.
28  Using Arduino / Programming Questions / Re: Simple question on arrays on: April 09, 2014, 03:55:04 pm
The stfump declared in printTemp()
Code:
  Serial.print(stemp);
  double stfump = (stemp / 2) ;
  Serial.print("\n");
is not the same variable as the stfump declared in loop()
Code:
void loop(void) {
  float reading[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  float summer = 0;
  float stfump = 0;
The latter one will not be updated by the printTemp() function so will always have a value of zero.
So
Code:
    reading[i] = stfump;
will always store zero in the array.
29  Using Arduino / Programming Questions / Re: Im not man enouh to solve a compiling error for a LCD with I2C on: April 09, 2014, 11:49:46 am
Quote
This LCD works with another very simple program
Can you please post an example of a simple program that works ?
30  Using Arduino / Programming Questions / Re: Repeating code until condition is true on: April 09, 2014, 07:35:44 am
Glad to see that you have got it working.  As you have not posted your code I can't see exactly what you have done but are 2 tests necessary ?
Code:
digitalRead(led_bottom)
is going to return either HIGH or LOW, so if it is not HIGH it must be LOW and vice versa.  Hence only one test is needed.
Pages: 1 [2] 3 4 ... 231