Show Posts
Pages: 1 ... 78 79 [80] 81 82 ... 269
1186  Using Arduino / Programming Questions / Re: Servo rotation help on: February 05, 2014, 02:26:28 am
Your program is close to working but is not quite there.  The reason that it won't work is quite subtle.  Try printing the value of the pos variable after the for loops have ended and you will see why it doesn't work as written.

The IDE does not need the Arduino connected in order to verify the code so you will have seen any errors in the construction of the code when you verified it but, of course, the IDE cannot report on flaws in the logic of the program.
1187  Using Arduino / Programming Questions / Re: Weird Serial Port Behavoir on: February 05, 2014, 02:11:45 am
That's what I was talking about with the header/checksum to wrap the message up, but as I mentioned, this seems like a lot of overhead added in just to work around 4 bytes at the very beginning of the program.  Plus using work-arounds instead of solutions always feel like a splinter that I can't get out smiley-razz
I would not regard it as a work-around, more an essential part of a robust serial communication system.  It is not that difficult to implement and would make the communications more bullet-proof all round.
1188  Using Arduino / Programming Questions / Re: How to find out what is to big (for both data and program) on: February 04, 2014, 06:03:47 pm
Arrays can gobble up space very easily.  How are your char arrays declared ?
1189  Using Arduino / Programming Questions / Re: IRremote proplem on: February 04, 2014, 05:42:53 pm
You can copy the error messages by selecting them with the mouse then copy them to the clipboard using Ctrl/C.  This lets you paste them into a post here which makes them easier to read.  For completeness you should also copy and paste the whole program too.
1190  Using Arduino / Programming Questions / Re: If/Else Problem on: February 04, 2014, 05:36:50 pm
As you have not posted your latest code it is difficult to help.....

When you post it please use code tags (#) instead of quote tags and it will be even easier to read.
1191  Using Arduino / Programming Questions / Re: delay a while statement? on: February 04, 2014, 04:43:30 pm
You need to take a look at blink without delay.
I was saving that for later as I am not sure that I actually understood the question in the first place
1192  Using Arduino / Programming Questions / Re: If/Else Problem on: February 04, 2014, 04:41:53 pm
Picky, picky, picky (and right)  smiley
1193  Using Arduino / Programming Questions / Re: Weird Serial Port Behavoir on: February 04, 2014, 04:39:56 pm
It sounds to me as though  you need start and end of message markers and to change the way that you read the incoming data so that you always get a complete message that was positioned between the markers.
1194  Using Arduino / Programming Questions / Re: If/Else Problem on: February 04, 2014, 04:34:53 pm
Quote
Close enough for now
But no cigar !
1195  Using Arduino / Programming Questions / Re: If/Else Problem on: February 04, 2014, 04:33:23 pm
You will not fix your problem by just putting a closing brace at the end of your program.  If a missing brace is the problem you need to find out where it belongs, but that may not be the problem.

As to the setup() and loop() functions, yes, you can only have one of each.  The setup() function is executed once at startup and the loop() function does what its name suggests and continually loops back to the start and runs again.  Actually it doesn't do that but the Arduino environment makes it seem like it does.  As a matter of information you cannot have 2 functions of the same name (any name) in a program.  Think about it, how would the program know which one to call ?
1196  Using Arduino / Programming Questions / Re: How hard to convert this sketch to be used with a different sensor on: February 04, 2014, 04:25:43 pm
eTape looks a good bet then, provided that it is available in the right length for your application.
1197  Using Arduino / Programming Questions / Re: delay a while statement? on: February 04, 2014, 04:18:48 pm
A program will stay in a  while loop while its controlling condition is true.  If you want to introduce a delay once the condition becomes false then you can do it but it must be outside (after) the while loop so that the delay occurs before the program moves on to the next statement.
1198  Using Arduino / Programming Questions / Re: If/Else Problem on: February 04, 2014, 04:13:14 pm
Quote
My code is below and I think for better viewing purposes it would be copied and pasted into the actual Arduino sketchbook.
It would be easier to see here if you used code tags around code as requested in the stickies at the top of this forum.

Even without looking at your code I would guess that you have left out or misplaced a brace somewhere at the end of a function but with the code as currently presented I don't want to look at it in detail, but I did see 2 loop() functions and 2 setup() functions, which is wrong.. 

Please post it in code tags after having used Auto Format in the IDE.
1199  Using Arduino / Programming Questions / Re: Newb old guy trying to set time on LED with button on: February 04, 2014, 04:05:30 pm
If you want the blinking to be asymmetrical, more on than off or vice versa, then set the required interval each time you change the LED state.
1200  Using Arduino / Programming Questions / Re: Need help with sketch to control 2 cooling fans on: February 04, 2014, 03:59:40 pm
Quote
the uploaded sketch
What sketch would that be ?

Quote
Void Loop
You mean the function whose name is loop that is declared void because it does not return a value, I imagine.

Say out loud 100 times "There is no such thing in C++ as 'a void' but there are functions that return no value which is indicated by preceding the function name with the keyword 'void'"
Pages: 1 ... 78 79 [80] 81 82 ... 269