Show Posts
Pages: 1 [2] 3 4 ... 209
16  Using Arduino / Programming Questions / Re: variable inside the name of a variable on: October 26, 2013, 10:29:47 am
So then does the name of the variable add to the size of the sketch since it is replaced?

No.
17  Using Arduino / Programming Questions / Re: I need help with my project =) on: October 25, 2013, 11:39:05 am
If you simply want to know when an analog pin is under/over a certain voltage, you're better off using simple algebra to determine what 4V maps to for analogRead(). These devices don't have an FPU, so they have to emulate it in software.
18  Using Arduino / Programming Questions / Re: Serial Read reliability on: October 25, 2013, 10:09:37 am
Don't you think it would be a Good Idea to check first?

Sure, um... but how ?

You could check just about any of the Serial examples and noticed a certain method by the name available.
19  Using Arduino / Programming Questions / Re: could anyone verifies this sketch on: October 24, 2013, 11:09:49 am
If you want a "binary representation of the analog signal" you're going to need more than 1  digital output pins; The ADC is 10-bits, so you would need up to 10 pins to represent it.
20  Using Arduino / Programming Questions / Re: I need help with my project =) on: October 24, 2013, 11:02:52 am
Well thanks a lot, but now it doesn't display anything anymore when it displayed a bigillion of numbers before: i don't get it.

Neither do we without seeing the updated code.
21  Using Arduino / Project Guidance / Re: How to measure the frequency of a AC sine wave signal? on: October 23, 2013, 11:25:31 am
http://lmgtfy.com/?q=measure+frenquency+arduino
22  Using Arduino / Project Guidance / Re: Use of Breadboards in Final Product on: October 21, 2013, 12:15:59 pm
Depends on what you mean by "final product"

Is this a one-off project for your home? Are you planning to build a handful for friends, or thousands for customers? Will this device be in an environment that might cause the jumpers on the breadboards to come loose?

I think most people around here would use strip boards or have PCBs manufactured.
23  Using Arduino / Programming Questions / Re: Programming steps using millis() on: October 01, 2013, 11:10:51 am
Is my thinking correct or?

You're setting startTime microseconds before you check its value against the currentTime (assuming relayOn() doesn't take a long time to run), which means it's not likely to be greater than 0, let along greater than 30 seconds. You're also setting currentTime after you check it's value in your if statement, how is that supposed to work?

startTime should be set only when a condition is met to turn the relay on, and it shouldn't be set again unless you are intending to reset the 30 second count down.
24  Using Arduino / Programming Questions / Re: What is going wrong?! on: September 30, 2013, 10:13:46 pm
Code:
//Read color and change state: 
  if (redState == HIGH)
  {
    int buttonState = 1;
  }
  else if (blackState == HIGH)
  {
    int buttonState = 0;
  }   
  else if (blueState == HIGH)
  {
    int buttonState = 2;
  }   

By preceeding the buttonStates with "int", you're telling your code that it isn't the same one as you previously declared, and won't be the same one used in this if statement (due to scope):

Code:
if(buttonState == 0)

and the subsequent ones. Perhaps your should read up on the differences between declaration, initialization and assignment.
25  Using Arduino / Programming Questions / Re: integer or array? on: September 25, 2013, 11:49:15 am
Faster?

Depends on what you're doing with it.

Less memory?

Code:
int test1; //setting and reading bits per bit operations
bool test2[16];//setting and reading bits per array element access
Serial.println(sizeof(test1));
Serial.println(sizeof(test2));

You tell us.
26  Using Arduino / Programming Questions / Re: Problem with sizeof in a function on: September 22, 2013, 11:33:26 pm
Sorry fellas, but it's not bullshit. Try it yourself. See if you don't get the error I got. It's a type cast issue. And why I never liked C in the first place.

You realize the code you posted fits PaulS's description of what you're doing wrong perfectly, right? String and string aren't the same thing and determining the length is done differently.

Obviously not. Perhaps rather than being condescending you might try being helpful. Explain why:

String getstring;
and
int parseget(String findme)

Are String and string. Both are typed as String are they not?

I'm not sure how I can explain this any better.

You are using String objects in your code. There are no strings in your code. You're trying to use a function that accepts a string as an argument, but you are trying to send it a String object as the argument.
27  Using Arduino / Programming Questions / Re: Problem with sizeof in a function on: September 22, 2013, 07:14:57 pm
Sorry fellas, but it's not bullshit. Try it yourself. See if you don't get the error I got. It's a type cast issue. And why I never liked C in the first place.

You realize the code you posted fits PaulS's description of what you're doing wrong perfectly, right? String and string aren't the same thing and determining the length is done differently.
28  Using Arduino / Project Guidance / Re: LED Timer w/ Delays Inbetween on: September 22, 2013, 05:56:52 pm
Your standard Uno will do fine. Then you'll need the switches, LEDs and current limiting resistors.

Programming is dead simple if you don't need to stop the sequence at all; start with the basic tutorials and go from there.
29  Using Arduino / Programming Questions / Re: Problem with sizeof in a function on: September 22, 2013, 12:31:56 pm
So now that the problem has been correctly identified the question is. In C how do I find the length of the array of chars that the pointer references? I have been looking on the web, but not being a C programmer has been a hindrance in my key word searches.

See reply #1 and reply #2.
30  Using Arduino / Programming Questions / Re: How to program a LED With Melody on PushButtonOn/Off on: September 19, 2013, 12:24:52 pm
First step is to see if song() is working.

If your loop() is just:

Code:
void loop()
{
  song();
}

does it play the music?
Pages: 1 [2] 3 4 ... 209