Loading...
  Show Posts
Pages: 1 ... 1067 1068 [1069] 1070 1071 ... 1318
16021  Forum 2005-2010 (read only) / Syntax & Programs / Re: Array Segments - wrap around on: June 20, 2009, 10:47:00 am
I think you're making this too difficult for yourself - what's wrong with modulo arithmetic?
16022  Forum 2005-2010 (read only) / Syntax & Programs / Re: Array Segments - wrap around on: June 20, 2009, 06:53:08 am
Quote
*(rainDuringHour210 + hourToday( *TZ300 - 1)) = mmB;

Any particular reason for this?

Why not the shorter, and more intuitive
Quote
rainDuringHour210 [hourToday( *TZ300 - 1)] = mmB;
?
16023  Forum 2005-2010 (read only) / Syntax & Programs / Re: Problem with scrolling 8x8 matrix + serial input on: October 06, 2010, 04:29:53 pm
You need to look at the scope and your handling of "buffer" - it is kind-of chaotic, particularly this bit:
Code:
    for (int x=0; x<bufferCount ; x++) {
      buffer[x]='\0';
      }

Hint: at this point, buffer is only one character big.
16024  Forum 2005-2010 (read only) / Syntax & Programs / Re: How can 256 be greater than 500? on: October 06, 2010, 03:36:06 pm
Quote
THE CODE:
At this point, you're supposed to hit the "#" button on the editor''s toolbar, between the printer icon and the "insert quote" icon-thingy.

Nothing calls "readToneData"

Quote
// PROBLEM APPEARS [glow]TO HAPPEN[/glow] HERE            
16025  Forum 2005-2010 (read only) / Syntax & Programs / Re: How can 256 be greater than 500? on: October 06, 2010, 02:58:47 pm
Yet you're still not posting the code. :o
16026  Forum 2005-2010 (read only) / Syntax & Programs / Re: How can 256 be greater than 500? on: October 06, 2010, 02:37:02 pm
Quote
Any explanation for this mystery?
Tell us what "sampleCount" is, post your code.
16027  Forum 2005-2010 (read only) / Syntax & Programs / Re: C language - Simultaneous button push & Switch on: October 02, 2010, 04:44:33 pm
You don't say how you've got your buttons wired or what sort of buttons they are, but I notice you're not using the built-in pullups.
This may cause you problems.
16028  Forum 2005-2010 (read only) / Syntax & Programs / Re: Sensor readings appear as strange characters on: October 07, 2010, 08:57:10 am
Use "print", instead of "write"
16029  Forum 2005-2010 (read only) / Syntax & Programs / Re: Band pass filter? on: October 07, 2010, 02:22:23 am
It definitely wasn't as slow as 16[glow]m[/glow]Hz though !   smiley-wink
16030  Forum 2005-2010 (read only) / Syntax & Programs / Re: Converting Int's to Big Endian on: September 26, 2010, 10:49:39 am
Quote
I only posted part of the code
Well, thanks for wasting my time.
16031  Forum 2005-2010 (read only) / Syntax & Programs / Re: Converting Int's to Big Endian on: September 26, 2010, 10:30:59 am
Code:
while (Serial.available() >0)
{
 for(int i=0; i < 4; i++) {
This isn't going to work.
1 is > 0, so what happens after one iteration of this loop?
16032  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interupt handler seems to ignore conditions on: October 06, 2010, 09:58:51 am
Quote
Can anyone see anything terribly wrong with my code?
You mean apart from that fact that you haven't posted all of it?

What does "setup" do?
Where is the code for "read_adc"?
16033  Forum 2005-2010 (read only) / Syntax & Programs / Re: Counter back to zero upon closing serial monitor on: October 06, 2010, 11:47:30 am
Disable the Arduino's autoreset feature.
http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection
16034  Forum 2005-2010 (read only) / Syntax & Programs / Re: pitch and roll from 3-axis accelerometer on: September 26, 2010, 09:47:30 am
Quote
You wait 32 microseconds for all the data to arrive
Not even close
16035  Forum 2005-2010 (read only) / Syntax & Programs / Re: pitch and roll from 3-axis accelerometer on: September 26, 2010, 09:13:45 am
No mystery, but not recommended.
It causes a delay of 32 milliseconds (and therefore limits your update rate to about 30Hz).
In those 32 milliseconds, you could have transmitted over 350 characters at 115200 bits per second
Pages: 1 ... 1067 1068 [1069] 1070 1071 ... 1318