Show Posts
Pages: 1 ... 9 10 [11] 12 13 ... 235
151  Using Arduino / Programming Questions / Re: LED fade out when button pressed on: March 31, 2014, 02:54:36 am
Have you looked at any of the examples in the IDE ?
There are separate examples of how to read a button press, wait a while and fade an LED.  Put the techniques together and you will have what you want.

Is this homework by any chance ?
152  Using Arduino / Programming Questions / Re: Problem with loading "Serial Command" Library on: March 31, 2014, 02:50:44 am
Please post your program here or an example program that exhibits the problem.

The library seems to me to be installed in the wrong place.
Quote
C:\Program Files (x86)\Arduino\libraries\ArduinoSerialCommand\/SerialCommand.h
User contributed libraries are usually installed in the libraries folder in the folder where your programs are stored.
Is that forward slash really there in your installation or is that an artefact of the error ?

Quote
C:\Program Files (x86)\Arduino\libraries\ArduinoSerialCommand\Seria lCommand.cpp
Is there really a space in the .cpp filename ?
153  Using Arduino / Programming Questions / Re: Data parsing on: March 31, 2014, 02:34:55 am
Quote
I have changed buffer from a char array to a string, seems to make things a bit simpler.
I don't see that it is much simpler, particularly as you convert the String to a char array anyway. 

Use a char array and stick with it.

 
154  Using Arduino / Programming Questions / Re: Triggering loops? on: March 31, 2014, 02:28:18 am
If you use a while loop then code that is not in the loop will execute while the loop condition is true.  For instance if one of the analogue channel readings goes above its threshold then no other channels will be read until the reading goes below the threshold.  Is that acceptable ?

Using an if (it's not a loop by the way) then you can take actions if one of the analogue channel readings goes above its threshold then move on to test the next one and take action if required.  The next time the first condition is checked the same sequence will be executed.

The difference between the two approaches is that the first is 'blocking' code whilst the second is not.  Which is more appropriate to your circumstances is up to you to decide.
155  Using Arduino / Programming Questions / Re: gyro and servo on: March 31, 2014, 01:22:04 am
Yes.  Sorry not to be more helpful but you appear not to have done any research.

Basically you are describing a gimbal mechanism.  Search for the term in this forum and I would expect to find examples.
156  Using Arduino / Programming Questions / Re: 2 analog controller and a relay on: March 31, 2014, 01:16:11 am
okay, thanks. i enterely agree with this concept! is there any way i could get a 24vdc valve to open when my light sensor is enable and to close when my temp sensor reads x degrees?
Yes, but I suggest that you start by turning an LED on and off to simulate the relay.

You will need extra circuitry to drive the relay and obviously a 24V supply.
157  Using Arduino / Programming Questions / Re: Programming 2 hand anti tie down on: March 31, 2014, 01:13:36 am
Quote
my understanding is that the only way to do something else while the microcontroller is processing a delay is to use an interrupt
That depends on how you implement the delay.  If you use the obvious delay() function then an interrupt would be appropriate but that is not the only way to implement a delay.  Take a look at the BlinkWithoutDelay example in the IDE to see how to create a delay that does not stop you doing other things such as polling a switch.

Basically you save the start time of the delay then periodically check whether the required period has elapsed.  If not then go and do something else and come back and check again later.
158  Using Arduino / Programming Questions / Re: 2 analog controller and a relay on: March 30, 2014, 04:48:33 pm
Break the problem down into parts

1. Print the value returned by the light sensor when it is lit and covered.  Now you know that it works
2. Test the value returned  by the light sensor and turn the relay on and off at appropriate levels.  Now you know that works
3. Print the value returned by the temperature sensor at various temperatures.  Now you know that it works
4. Test the value returned  by the temperature sensor and turn the relay on and off as it goes past 80 degrees .  Now you know that works

You should easily be able to find examples  of each of these steps.

5.  Combine steps 2 and 4 above to turn on the relay at the right light level and wait for the temperature to reach 80 degrees and then turn off the relay.
159  Using Arduino / Programming Questions / Re: Transfer data from robotized Arduino in twitter. on: March 30, 2014, 04:36:25 am
If you are asking whether the Arduino can post twitter messages then, yes it can.

Forget the robot for now.  Get the Arduino to post twitter messages first.  Searching this forum for "twitter" would be a good way to start.
160  Using Arduino / Programming Questions / Re: Problem with Ultrasonic and LM35 sensor code. on: March 30, 2014, 02:39:23 am
What does happen when you run it ?
Nothing at all on the serial monitor ?
I see that you are only measuring the distance once in the setup() function.  Is that what you meant to do ?
The same goes for measuring the temperature.  You only do it once.

Incidentally this function
Code:
void ultrasonic()
{

  if (distance > 30)
  {
    Serial.print(distance);
    Serial.println(" cm");
    digitalWrite (13, HIGH);
  }
  else
  {
    Serial.println (distance);
    Serial.println ( "cm");
    digitalWrite (13, LOW);
  }
}
could be condensed to
Code:
void ultrasonic()
{
  byte state = LOW;
  if (distance > 30)
  {
    state = HIGH;
  }
  Serial.print(distance);
  Serial.println(" cm");
  digitalWrite (13, state);
}
161  Using Arduino / Project Guidance / Re: Display large bold font on my 16x16 led matrix "source code" help on: March 30, 2014, 02:20:51 am
I don't know how you are going to do that, but please feel free to go ahead.
162  Using Arduino / Project Guidance / Re: Question about com serial port data on: March 30, 2014, 01:41:32 am
You need a program running on the PC to transfer the data arriving at one com port out to another.  Alternatively you could communicate directly between the Arduinos using bluetooth and not involve the PC at all.
163  Using Arduino / Project Guidance / Re: RTC DS-1307 on: March 30, 2014, 01:34:57 am
When you want to know the current time you have to ask the RTC but this is as simple as using the hour() function.

You could do worse than search this forum for rtc1307  to find similar projects.
164  Products / Arduino Yún / Re: Arduino Yún REST + Servomotor on: March 30, 2014, 01:22:44 am
What was the problem ?
It is always interesting to know and it could help others.
165  Using Arduino / Programming Questions / Re: RGB LED Change color with button press help on: March 29, 2014, 05:10:33 pm
I am not sure that it is the same library but on this page https://github.com/thomasfredericks/Bounce-Arduino-Wiring/blob/master/Bounce2/examples/duration/duration.ino an instance of the bounce library is created like this
Code:
// Instantiate a Bounce object
Bounce debouncer = Bounce();
and is set up like this
Code:
// Setup the button
  pinMode(BUTTON_PIN,INPUT);
  // Activate internal pull-up
  digitalWrite(BUTTON_PIN,HIGH);
 
  // After setting up the button, setup debouncer
  debouncer.attach(BUTTON_PIN);
  debouncer.interval(5);

Your code is entirely different in respect of the bounce library.
Pages: 1 ... 9 10 [11] 12 13 ... 235