Show Posts
Pages: [1] 2 3 ... 252
1  Using Arduino / Programming Questions / Re: ASCII input to floating point value on: Today at 08:48:25 am
I'll move code into a function even if it's only called from one place just to make the calling function simpler. Getting a decent name for the new function is a bonus too.
2  Using Arduino / Programming Questions / Re: 2 small sketches using an identical function to read serial react differently... on: Today at 07:58:29 am
It does work, and probably always will. HIGH is defined as 1, LOW as 0. However, because those are arbitrary constants that could change at the whim of the Arduino team in a future release, experienced developers usually suggest that you should stick to:


In practice, if you use the shortened form, you'll be fine - just don't tell anyone  smiley-wink
3  Using Arduino / Programming Questions / Re: Where does 93 bytes of RAM go? on: Today at 06:58:35 am
Interesting detective work.

Minor point - shouldn't this:

That is 4 x 4 byte strings that should really be printed with the F macro, so that accounts for 16 bytes.


That is 3 x 4 byte strings that should really be printed with the F macro, so that accounts for 16 bytes.

I wouldn't expect the two uses of "ovf" to result in distinct strings.
4  Using Arduino / Project Guidance / Re: Two-factor authentication key fob on: Today at 06:31:55 am
I work with a volunteer ambulance service, and I designed all of our computer systems.  I'm trying to add security so that we can ensure that our patient records are kept as secure as possible when accessed over the web.

This may indeed be true. But it would also be a very good reply from a fraudster.

Robin, I'm not seeing the opportunity for fraud here - you could certainly build something that would function like RSA's securID or other vendors products, but without the proprietary detail of their encryption method (which would not be forthcoming), such a device would not help you crack systems defended by it.
5  Using Arduino / Programming Questions / Re: Serial interface parameters on: September 29, 2014, 11:08:03 am
Check this page: there are options to set the config to whatever you like. Note they the default is 8N1, so you likely don't need to mess with it.
6  Using Arduino / Project Guidance / Re: reef led light project on: September 29, 2014, 11:04:19 am
Search the forum - there have been quite a few people doing similar projects.
7  Using Arduino / Project Guidance / Re: Can anyone help me please? on: September 29, 2014, 11:00:49 am
Here is the problem:
if (myRTC.hours >= 6 || myRTC.hours < 9)                               
else if (myRTC.hours == 9)                     //I can't work on this one.. my relay is active LOW.. but it shows no response or
If hour is 9, it's greater than six, so it will execute PH_Regulate - your else clause will never be executed.

Try using && instead of ||
8  Using Arduino / Project Guidance / Re: Refining and expanding home auto project on: September 29, 2014, 07:50:57 am
I'd be inclined to offload the database and web site to a platform that can handle them well. You can do it on an arduino, but it makes a pretty feeble web server. Given your expertise, you could make yourself a nicer web interface on something with a bit more power and just have the arduino manage the hardware. If you don't already have a web server you can use, take a look at the Pi.
9  Using Arduino / Programming Questions / Re: problem when use the GPS and Pulse Sensor in same time on: September 29, 2014, 07:00:06 am
It doesn't seem likely that you need to read the time from the GPS continuously - once at startup ought to do and you can keep track with the DateTime library or roll your own with millis. You might choose to sync up again daily or whatever frequency suits you. Then you can spend your time on the pulsin and perhaps avoid the need to purchase a Mega.
10  Using Arduino / Programming Questions / Re: XBee communication: snippet for when the signal is lost on: September 27, 2014, 08:21:49 am
What wattage are these Xbees? the 2mW ones don't have much range even under ideal conditions - 10m sounds low though.
11  Using Arduino / Programming Questions / Re: pow function gives false results on: September 27, 2014, 07:33:55 am
The compiler optimizes pow(2,4) away to the correct answer. When you use a variable it actually has to do the calc. It's working with float and so the answer you get is something like 15.999. When you put that into an int it gets truncated to 15.
12  Using Arduino / Project Guidance / Re: Mobile App Controlled Drone on: September 27, 2014, 06:38:39 am
Take a look at, It doesn't have anything on a mobile as far as I can see, but it might help you get started.
13  Using Arduino / Programming Questions / Re: Maze Solving Problem on: September 26, 2014, 06:57:33 am
I wonder if you have misunderstood your instructions or if they are confusingly stated. Unless you've previously got so good at Arduino coding using the standard functions (digitalWrite et al) that your teacher wants to give you a better appreciation of what's under the hood, this seems like a very odd restriction. It doesn't sound as if you & your classmates are at this point.

I can see perhaps that if you've been using a Robot library perhaps that now you're being asked to work without it.

In any event, if I had to do this assignment, I'd write a bunch of functions called MyDigitalWrite etc to replace the ones that are off limits. Given that I (and you) have access to the source code, it's quite likely that my replacement functions would look very similar, though not identical, to the core functions they mimic  smiley-wink
14  Using Arduino / Programming Questions / Re: New to arduino programming, need help please on: September 24, 2014, 04:57:03 pm
  delay(60 * 60 * 1000);
would be better as:
  delay(60UL * 60UL * 1000UL);
To avoid overflow issues, although actually one of the numbers having a UL suffix would do.

Then swap out one of the 60s for 1 and test it! Unless you want to watch it for an hour of course.
15  Using Arduino / Programming Questions / Re: Trouble with PID library and fan control on: September 23, 2014, 02:33:52 pm
The reason for the outputs in the 0-255 range is that that is the range that analogWrite gives you to vary the power on the PMW'd device between zero and max.

There is no need to transform the temperature reading into the same range; you can continue to work in Celsius. The PID simply looks at the difference between set point and current temp to help calculate how much power it needs to give to the fan. The units don't matter.

You may get better insight by serial.printing the set point, input  and output values each time the PID computes.

Also, are you sure your fan is having a cooling effect? If you're just blowing ambient temperature air around, it may feel cooler to you due to evaporative effects on your skin, but the DS18B20 won't see any difference.
Pages: [1] 2 3 ... 252