Show Posts
Pages: [1] 2 3 ... 106
1  Using Arduino / Sensors / Re: ADC Value Problem on: Today at 09:03:15 pm
You don't need to do all the malloc/free of 19 bytes and you'd be a lot better off if you didn't too. Just declare dateANDtime to be a 20 byte character array.

Code:
if (sensorValueA2 == 5)
This is a rather strange value to look for. Do you actually mean to check that the ADC value is 5 or did you intend to check for an ADC voltage of 5V (sensorValueA2 == 1023 or Niederschlag == 5.0)?

Pete
2  Using Arduino / Programming Questions / Re: Cyclic Redundancy Check(CRC) code in arduino on: Today at 10:48:09 am
If the CRCs differ, it only means that there was at least one bit in error. It doesn't tell you how many bits were bad. To do that you would have to compare the received message against the original, in which case the CRC is redundant.

Pete
3  Using Arduino / Programming Questions / Re: Cyclic Redundancy Check(CRC) code in arduino on: July 30, 2014, 10:11:21 pm
The code in the client will be the same as that in the server. There are two ways to check the CRC. One is for the client to generate the CRC of the received data and compare the result with that generated by the server. The other is to append the CRC generated by the server to the data and then the client generates a new CRC of all the data and the server CRC. The result should be zero.

Pete
4  Using Arduino / Project Guidance / Re: Mean value for wind direction on: July 28, 2014, 04:28:04 pm
I didn't miss your point. You missed mine, which is that in the real world the kind of pathological readings you posit would rarely occur, if ever. Furthermore, even if they do occur, who cares if a couple of reported values per month, or however often, are wrong?

Quote
And I did say that I see little point in sampling the direction so frequently.
And I wholeheartedly agree.

Perhaps the OP could tell us just how accurate the results should be and what use is going to be made of them.

Pete
5  Using Arduino / Project Guidance / Re: Mean value for wind direction on: July 28, 2014, 02:55:10 pm
Quote
Suppose you have this data   wsw w n w n w n w n w.   How would you intepret it?.
I'd say that it is either totally unrealistic that the wind would shift through about 90 degrees every 5 seconds, or the vane is not up in the open. And BTW, wsw would not be valid since the OP has indicated using only eight directions.

Quote
And what about this wsw w w w w w n n n n  ?
The result would be "w" or "n" depending upon whether you code it to pick the first most frequent reading or the last. Re-read what I posted.

Quote
You need to be careful not to adopt an interesting algorithm that gives useless results.
That process (but sampling every minute and reporting every half-hour) has been implemented in a system that has been running in the real world for the last two years. The results aren't useless.

Pete
6  Using Arduino / Project Guidance / Re: Mean value for wind direction on: July 28, 2014, 02:21:39 pm
If you don't mind using the mode instead of the mean, you can just generate a histogram of values over the last minute and pick the one with the highest value. To do this you map the raw wind value into one of eight directions (or however many you want). At the beginning of the minute you zero the histogram array and then with each reading, increment the appropriate element of the array. When you have read and processed the last reading in the minute, find which index in the array contains the highest number of readings and use that as the direction.
There is still the possibility that two or more directions will have the same number of values. In this case the correct statistical procedure is to average the readings, but it will probably occur so infrequently that you can safely use whichever one is found first (or last).

Pete
7  Using Arduino / Project Guidance / Re: Real Time Clock on: July 26, 2014, 06:59:53 pm
If it's the DS1307 you are using, it is not a particularly accurate clock and buying 2 more from a different source probably won't help. The DS3231 is considerably more accurate.

Pete
8  General Category / General Discussion / Re: don't understand the meaning of a warning in a motor driver board user guide on: July 25, 2014, 10:32:55 am
I also don't understand "impending" in that context.
I think the "can't long time use high level" is related to their spec that "This driver can operate at 0% -99% PWM modulation duty ratio". It is saying you should not drive the motors at 100% (high level) for too long, although they don't specify what a "long time" is.

Pete
9  Community / Website and Forum / Re: He's back! on: July 23, 2014, 10:19:26 am
Well, duh!

Pete
10  Using Arduino / Programming Questions / Re: Help with boolean query, 'const char*' to 'const unsigned char*' on: July 22, 2014, 07:18:02 pm
P.S. where is the crcverify function? I can't find it in the crc16 library.

Pete
11  Using Arduino / Programming Questions / Re: Help with boolean query, 'const char*' to 'const unsigned char*' on: July 22, 2014, 07:09:10 pm
A CRC can be calculated on arbitrary binary values - not just ASCII strings - so the definition uses unsigned char*.

Pete
12  Using Arduino / Displays / Re: black bars on new esplora tft screen on: July 22, 2014, 12:27:41 pm
The diagram here shows a pin labelled BL. Just wondering if it is BackLight. If not, I'm outta ideas.

Pete
13  Using Arduino / Displays / Re: black bars on new esplora tft screen on: July 22, 2014, 12:16:29 pm
Is there an adjustment for the backlight? It is probably not set properly.

Pete
14  Community / Website and Forum / Re: He's back! on: July 22, 2014, 11:14:17 am
I meant that he's not posting as "just" a user, but as a mod.

Pete
15  Using Arduino / Networking, Protocols, and Devices / Re: Anlog transmission over long distance on: July 22, 2014, 11:06:58 am
Presumably you want your computer to either display the number, or add the value to a graph. Either way, you don't need a DAC - the number itself is sufficient.

Pete
Pages: [1] 2 3 ... 106