Show Posts
Pages: [1] 2 3 ... 250
1  Using Arduino / Programming Questions / Re: Comparing live GPS data from phone to database of coordinates on: September 20, 2014, 09:05:58 am
Since your phone has far more processing power and storage than the arduino, consider doing all this work on the phone. Just send a message over bluetooth to the arduino to tell it what to do with the LEDs.
2  Using Arduino / Project Guidance / Re: AlarmLibrary or selfbaked? on: September 20, 2014, 08:18:01 am
The time taken to calculate whether a scheduled event is due should be negligible; use a library or roll your own since that's your preference. The non-responsiveness in your system is apparently caused by the length of time it takes to "do my stuff", particularly, by the sound of it refreshing the screen.

You might consider splitting "do my stuff" up into subtasks and only do one of them on each iteration of loop. i.e. the millis checks tell you what tasks it's time to do and on each subsequent iteration of loop, pick just one of them and do it so you can respond more quickly to button presses.

It also sounds like you should consider optimizing your screen refresh routine - can you just redraw what's changed?
3  Using Arduino / Programming Questions / Re: Temperature/humidity sensor & AC Relay interaction question on: September 19, 2014, 07:50:40 am
There are plenty of threads in the forums that discuss combining sketches. Grumpy_Mike has a tutorial on the subject too: http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

For your requirement, it should be pretty trivial to do but post your code if you get stuck.
4  Using Arduino / Programming Questions / Re: Variable "A" control the state of 2 LEDs...how to ? on: September 19, 2014, 07:41:42 am
Have you considered making this data driven? Define a struct that has elements that specify the things you need to control the LEDS and make an array of them. Then you can just iterate through them and have a single if statement in the loop. The struct might look like:

Code:

typedef struct
  {
  int lowerLimit;              // low end of analog range that specifies this state
  int UpperLimit;             // High end..........
  byte pinNumber;         // Pin that this state's LED is on
  boolean setLEDOn;     // Do we turn it on in this state?
  } PinData;
5  Using Arduino / Project Guidance / Re: Geofencing on GPS for large sets of data - GUIDANCE NEEDED on: September 19, 2014, 07:27:53 am
Wikipedia says that the Nexus 4 has connectivity to GPS and GLONASS, so you shouldn't need the GPS shield.
6  Using Arduino / Programming Questions / Re: Aquarium LEDs and fading on: September 19, 2014, 07:00:51 am
Quote
i have been staring and tweeking this

Best post your most recent version.

In the latest version we can see you still have the = vs == issue already mentioned.

Also, it looks like you're assuming that those analogWrites are controlled by the if but only the first one actually is.

Code:
  if(sunRiseFading = true)
  {
      sunRise();
  }
 ////////////////////////////////////////////////////////////////////////////
if ((hour >= dayHour) && (minute >= dayMin) && (hour < sunSetHour) && (minute < sunSetMin))
    analogWrite(rLEDpin, 255);
    analogWrite(bLEDpin, 0);
    analogWrite(gLEDpin, 0);
7  Using Arduino / Project Guidance / Re: Geofencing on GPS for large sets of data - GUIDANCE NEEDED on: September 19, 2014, 06:27:51 am
You could build such a thing as a standalone app on the phone if you're prepared to give up the physical LEDs for something you see on the phone's screen - what's the driver for adding LEDs and an arduino?

8  Using Arduino / Programming Questions / Re: help with re writing a bit of code on: September 17, 2014, 09:09:42 am
Quote
Is annoying me because I've had servos doing the full 180, and I just can't think what's changed.

Have you had these servers doing 180? Different models/manufacturers vary. Widely.
9  Using Arduino / Programming Questions / Re: Define servo.attach( #, 1000, 2000); on: September 15, 2014, 11:33:37 am
It tells the servo how to interpret 0 and 180 degrees and thus the interpolation between them when using servo.write. It has no impact on write microseconds.
10  Using Arduino / Programming Questions / Re: question about 2 different water tank code! on: September 14, 2014, 08:19:23 am
Code:
  int scaledValue2 = map(constrain(distance2, highWater2, lowWater2), lowWater2, highWater2, 0, 15);
11  Using Arduino / Project Guidance / Re: Overloaded data-logger. on: September 14, 2014, 08:16:40 am
What I'm suggesting is that you can afford to give up a serial port if the second Arduino can take care of the function you were using it for and as a bonus a few others besides. For more speed & RAM, take a look at the Teensy 3.0 - cheap too  smiley
12  Using Arduino / Programming Questions / Re: question about 2 different water tank code! on: September 14, 2014, 07:23:32 am
You are most of the way there - you already have ECHO_PIN2 and TRIG_PIN2. Now you just need highWater2 and lowWater2 and use them in the code that calculates the reading for tank two.
13  Using Arduino / Project Guidance / Re: Overloaded data-logger. on: September 14, 2014, 06:46:17 am
If you really can't keep up, consider offloading some of the work to a second arduino - you can talk to it over serial (or software serial).

Alternatively, post your code.
14  Topics / Home Automation and Networked Objects / Re: Controlling Arduino connected RF transmitter from internet on: September 12, 2014, 07:32:33 am
The compiler is telling you that you have tried to declare one function inside the other here:

Code:
        char Comp(char* This) {

You either need to move the declaration outside CheckForClient and call it there or leave the body without the above line.
15  Topics / Home Automation and Networked Objects / Re: Controlling Arduino connected RF transmitter from internet on: September 11, 2014, 03:25:38 pm
I think you need to declare an array of char and accumulate what you're reading in it. Something like
Code:
char buf[VW_MAX_MESSAGE_LEN];

When your reading variable is set true, start putting the characters read into c into the array and null terminate it. When reading becomes false, send buf using

Code:
buf, strlen(buf));
Pages: [1] 2 3 ... 250