Show Posts
Pages: 1 ... 89 90 [91] 92 93 ... 209
1351  Using Arduino / Programming Questions / Re: "Hourglass" without delay - understanding if, while, & for loops on: May 06, 2013, 11:08:02 am
 if(done = false)

if(pinOff = 10) {
= and == are two different operators (assignment versus equality).

nextOffTime = currentMillis + offTimer

Addition can cause issues with overflow, you're much better off using subtraction:

if (millis() - lastTickTime > interval)
  lastTickTime = millis();
  // turn off an LED
  // set the next LED to turn off

  // If you're done turning off leds
    // turn on all LEDs
1352  Using Arduino / Programming Questions / Re: integer to char on: May 05, 2013, 10:12:54 am
It sounds like both issues you're having can be solved with a simple call to sprintf().
1353  Using Arduino / Sensors / Re: 2 pin temp censor on: May 04, 2013, 02:24:44 pm
You don't need a library, you simply need to put the device in a voltage division circuit and use analogRead().
1354  Using Arduino / Programming Questions / Re: Counter program on: May 03, 2013, 05:21:39 pm
You have our permission.

... or what there a programming question there?
1355  Using Arduino / Project Guidance / Re: RFID SERIAL READ PROBLEM on: May 03, 2013, 05:08:29 pm
If you can, please try to help with code.

How can we do that when you didn't post it?
1356  Using Arduino / Programming Questions / Re: Carpark entry counter on: May 03, 2013, 04:55:30 pm
I've moved the diag LED to pin 10, or do you suggest moving it to analog pins?

On both boards, pin 10 is used to select the W5100 and pin 4 for the SD card.
1357  Using Arduino / Programming Questions / Re: Carpark entry counter on: May 03, 2013, 03:07:39 pm
Assuming you're using an SPI-based Ethernet shileld...

Arduino communicates with both the W5100 and SD card using the SPI bus (through the ICSP header). This is on digital pins 11, 12, and 13 on the Duemilanove Uno.

const int CounterChange =  13;      // the number of the LED pin
1358  Using Arduino / Programming Questions / Re: Using sizeof() to calculate array size. on: May 03, 2013, 01:33:54 pm
sizeof is a compile-time operator, it acts on the types of variables, not the runtime values.

[ to clarify, a is 2 because a pointer is 2 bytes on the Arduino.  A formal parameter declared as an array
like this is actually a pointer type (because the size is unknowable at compile time).
b is 1 because a byte is one byte of course. ]

To expand upon this, you can't use sizeof() for dynamic variables, such as arguments passed to a function. Instead, you should pass the size of the array to the function.

int myArray[6]; // declare array
someFunction(myArray, sizeof(myArray)/sizeof(myArray[0])); // call function
void someFunction(int *someArray, int someLength); // function prototype
1359  Using Arduino / Programming Questions / Re: Timer1 interrupit problem on: May 03, 2013, 10:31:22 am
but don't work.

That's a piss poor way of describing an issue. Do you drop your car off at the mechanic with a note that says "it doesn't work, fix it please"?

The code does something. You want it to do something else. The difference is a mystery to us. Also, use CODE tags when posting code.
1360  Using Arduino / Project Guidance / Re: Programming code for a roulette wheel ? on: May 03, 2013, 12:27:44 am
What have you tried?
1361  Using Arduino / Programming Questions / Re: invalid conversion from 'int' to 'void' on: May 03, 2013, 12:25:43 am do i fix this error?

See my previous post.
1362  Using Arduino / Programming Questions / Re: invalid conversion from 'int' to 'void' on: May 03, 2013, 12:02:13 am
sketch_may03a.ino: In function 'void setup()':
sketch_may03a:19: error: invalid conversion from 'int' to 'void (*)()'
sketch_may03a:19: error: initializing argument 2 of 'void attachInterrupt(uint8_t, void (*)(), int)'
sketch_may03a:22: error: a function-definition is not allowed here before '{' token
sketch_may03a:39: error: expected `}' at end of input

These messages show my error..really dont know how to edit the code..

Each left curly brace should have a corresponding right curly brace.
1363  Using Arduino / Programming Questions / Re: Casting Confusion on: May 02, 2013, 11:55:23 pm
char twt = "This is my test tweet. The air pressure is" + pres_c + " mb"

First, that giant string can't fit into a single character.

Second, You can't concatanate with c-strings using +. You need to use strcat() or sprintf().

Lastly, char() doesn't convert a float/int to a string. You need to use itoa() for ints or dtostrf() for floats.
1364  Using Arduino / Programming Questions / Re: invalid conversion from 'int' to 'void' on: May 02, 2013, 11:52:01 pm
sorry Markt.. can you show me where the code I need to indent? sorry..still learning..

In the Arduino IDE, press Ctrl+T
1365  Using Arduino / Programming Questions / Re: array size limit on: May 02, 2013, 10:01:59 pm
So currently it works with an array size of 800 but if I use more memory by declaring more variables will that reduce my maximum array size even further?

Pages: 1 ... 89 90 [91] 92 93 ... 209