Show Posts
Pages: [1] 2 3 ... 230
1  Using Arduino / Programming Questions / Re: I need a little help for a club project on: September 17, 2014, 04:43:16 pm
Could you now figure out what i mean??

You may have better luck on the international forums.
2  Using Arduino / Programming Questions / Re: I need a little help for a club project on: September 17, 2014, 12:38:46 pm
have no one an Idea?


I couldn't figure out what you're asking with this sentence:

Quote
I have no idea how I can spend time on the timer Shiftout and to be the times displayed in the change.
3  Using Arduino / Programming Questions / Re: arduino strucks on Serial.println(); SRAM or other fault on: September 17, 2014, 11:26:11 am
Post code, not screenshots.
Use code tags.
4  Using Arduino / Programming Questions / Re: I need a little help for a club project on: September 17, 2014, 10:21:07 am
So what problem are you having?
5  Using Arduino / Programming Questions / Re: Sub Routine on: September 17, 2014, 10:17:12 am
Right now it's in the loop "sub routine". So create one that looks like loop, but has a different name and copy the code into it. That's the easy answer, but I get the feeling you're going to run into issues with trying to do other things in the loop because that code is blocking. If that's a problem, you'll need to learn about writing non blocking code using millis() and state machines. The former of which is demonstrated in the blink without delay example.
6  Using Arduino / Programming Questions / Re: do this to any variable that equals y, do that to any variable that equals x on: September 16, 2014, 07:02:39 pm
That would print true, correct?

It wouldn't even compile.
7  Using Arduino / Programming Questions / Re: can I call one function from within another? on: September 16, 2014, 05:58:13 pm
do you agree that my problem is due to the variable 'a' being assign within the function and it is not recognised outside the function?


You can't assign multiple values to elements of the array using the curly brace notation outside of it's declaration. If you want to change it's values, you must assign the values to the elements individually.
8  Using Arduino / Programming Questions / Re: can I call one function from within another? on: September 16, 2014, 05:53:03 pm
I think my problem is that I am assigning the variable 'a' as a byte within the function so it is not recognised outside it but how can I get round this?
Either pass it as a parameter or make it global.
Quote
If I assign 'a' globally and remove 'byte' from the function it tells me it expects a primary expression before the { token.
Probably because you did something wrong.
9  Using Arduino / Programming Questions / Re: Problem with string comparsion on: September 16, 2014, 09:51:23 am
Code:
char msg[] = "";  //Speicher für die eingehende Nachricht

msg now only has one allocated byte

Code:
for (i = 0; i < buflen; i++)
{
            msg[i] = buf[i];
}

... but you put what will likely be more than one byte in it.

Code:
       if  (msg == comp)

That's not how you compare strings. You can either use strcmp() with a null-terminated string (You'll have to explicitly null terminate it), or use memcmp() and compare the comp variable directly to buf.

Code:
char msg[8] = "";

That's not how you empty a string. If you're using the strcmp() method, you need to set the first element to null:

Code:
msg[0] = '\0';

If you're using the memcmp method, you have no need to reset it.
10  Using Arduino / Programming Questions / Re: do this to any variable that equals y, do that to any variable that equals x on: September 15, 2014, 09:23:44 pm

Would using the OR operator be preferable to using an array variable?

With two variables, the OR operator is preferable. As the number increases, arrays start to become more preferable.

Is there something equivalent to the following psuedo code:

No
11  Using Arduino / Programming Questions / Re: Loading a long int into an array on: September 15, 2014, 09:19:58 pm
Use modulus division and a for loop to extract the actual bytes. Take 3512, for example:

Code:
3512 % 10 = 2
3512  / 10 % 10 = 1
3512 / 10 / 10 % 10= 5
3512 / 10 / 10 / 10 % 10 = 3

Once a divide by 10 results in a 0, you can start printing blanks.
12  Using Arduino / Programming Questions / Re: do this to any variable that equals y, do that to any variable that equals x on: September 15, 2014, 09:11:30 pm
hmm. I guess i need to be more specfic. Ill update my original post.

No need, the proper answer has already been posted. You have to check if each of them equal the specified value, using the or operator.
13  Using Arduino / Programming Questions / Re: Unable to get the results in Serial monitor on: September 15, 2014, 06:57:36 pm
Code:
  int fs = 400;
  float Ts = 1/fs;

1 / 400 equals 0 according to integer math. If you don't want it to do integer math, force it to do floating point math:

Code:
  int fs = 400;
  float Ts = 1.0/fs;
14  Using Arduino / Programming Questions / Re: Calculations returning float on: September 15, 2014, 06:54:32 pm
Still returns a float. Waste of resources

What? It's going to return a float regardless of what you assign it to. If you don't want it to return a float, don't divide it by a float.
15  Using Arduino / Programming Questions / Re: Calculations returning float on: September 15, 2014, 06:41:06 pm
Whats the difference to a int or uint as you suggested!?
Again, one is signed, and one isn't signed.

Quote
I don't need the sign, so what does that change the float to a non float!?

No, it changes it to a signed int. If you want to change it to an unsigned int, then make result of type unsigned int.

If you're asking what the difference between something like uint16_t and unsigned int is, there isn't a difference on the Arduino.
Pages: [1] 2 3 ... 230