Show Posts
Pages: [1] 2 3 ... 225
1  Using Arduino / Programming Questions / Re: problem with string compare on: July 29, 2014, 06:48:28 pm
What are you mixing Strings and strings? Pick one, and stick with it.
2  Using Arduino / Programming Questions / Re: problem with string compare on: July 29, 2014, 06:44:20 pm
You can edit your post, you don't have to post a new reply if you need to fix something.
3  Using Arduino / Programming Questions / Re: Push Button Millis Timer Delay on: July 29, 2014, 06:43:38 pm
I feel like I just answered this question:

http://forum.arduino.cc/index.php?topic=257861.msg1822683#msg1822683
4  Using Arduino / Programming Questions / Re: How to set output pin to high for set time??? on: July 29, 2014, 03:22:47 pm
I can get the led on board to blink every 5 secs, but when I activate sensor the motor only works
while the sensor is activated. ie breaking the light beam.  I am trying to break the light beam with an object
and cut the dc motor on for 5 secs then everything reset.  This is what I have for code and I cant get it to work correctly.

See reply #1.
5  Using Arduino / Programming Questions / Re: How to set output pin to high for set time??? on: July 29, 2014, 11:27:09 am
I am trying to understand how the millis function works, but hitting a wall so far.

Then you're overthinking it. All the millis function does is return the number of milliseconds since the Arduino was last powered on or reset. It's a stopwatch that can't be paused or stopped, only reset. That's it.
6  Using Arduino / Programming Questions / Re: Fade sequence X times when button pressed on: July 29, 2014, 11:03:59 am
Step 1 is to define what you mean by "loop a certain number of times"  as your current code doesn't define a start or end point for what you consider to be a cycle. Based on your current code, It will likely have to do with time.

Step 2 is to figure out how to perform an action when a switch is pressed down. The StateChangeDetection example shows you how to accomplish this. Start by getting your switch to simply print something like "Hello" when this occurs.

Once you got that working, Step 3 it's time to figure out how to "record the time". Blink Without Delay example demonstrates using millis() for timing related concepts. Combined with step two, you can identify the time at which the button was pressed down. Combining that with step 1, you can figure out the time at which X number of cycles should stop.

At this point it's just a matter of if statements.

7  Using Arduino / Programming Questions / Re: How to set output pin to high for set time??? on: July 29, 2014, 10:55:20 am
Create a variable named lastTimeTheMotorWasOff and set its value to millis() whenever you turn the motor off.

Outside of any other conditions, check to see if millis() - lastTimeTheMotorWasOff is greater than 5 seconds. If it is, turn it off.

See the Blink Without Delay example for information on using millis()
8  Using Arduino / Programming Questions / Re: if (time passed and nothing received) on: July 29, 2014, 10:52:43 am
Every time you receive a message, set a variable named lastTimeAMessageWasReceived to millis().

Then you can check if millis - lastTimeAMessageWasReceived is greater than a certain value.
9  Using Arduino / Programming Questions / Re: LCD & button to change lcd.write on: July 28, 2014, 11:05:59 am
Code:
  if button 1 is pressed increment the counter variable

To expand on this bit of pseudo code, you'll want to take a look at the state change detection example, as it demonstrates how to act on the transition of a switch being not pressed to pressed, rather than just seeing if it is pressed down.
10  Community / Gigs and Collaborations / Re: Quick $5 for the first working response on: July 27, 2014, 02:55:35 pm
I was looking for the pinMode for that.
Pins are Inputs by default, I know, but since there was a pinMode for button I was caught up looking for one for "pot" (nonesuch).

When are there ever pinMode calls for analog pins?
When you want to use an analogPin as digital output...

Fair enough. Let's append that statement:

When are there ever pinMode calls for analog input pins?
11  Community / Gigs and Collaborations / Re: Quick $5 for the first working response on: July 27, 2014, 01:35:50 pm
I was looking for the pinMode for that.
Pins are Inputs by default, I know, but since there was a pinMode for button I was caught up looking for one for "pot" (nonesuch).

When are there ever pinMode calls for analog pins?
12  Using Arduino / Programming Questions / Re: switches within a counter sketch on: July 25, 2014, 04:53:04 pm
MSlastButton is only ever read, it is never written. That's at least one problem, because the name doesn't suggest that it should be constant.
13  Using Arduino / Programming Questions / Re: Can't make my new RF Links work? on: July 25, 2014, 12:07:13 pm
Code:
    for (int i = 0; i < buflen; i++)
    Serial.println(buf[i]);

    {
     ...
    }

Code that should be executed within the for loop needs to be between the curly braces. There should never be anything between a loop/if/function statement and its opening curly brace.
14  Using Arduino / Programming Questions / Re: Can't make my new RF Links work? on: July 25, 2014, 11:38:14 am
So print out what you are receiving.
15  Using Arduino / Programming Questions / Re: problem with serial communication on: July 24, 2014, 05:28:52 pm
Post all of your code. Considering inString isn't declared anywhere in your code, that code won't compile. Ergo, that's not the code you are using.
Pages: [1] 2 3 ... 225