Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / One Wire Weather Station project (open source)

Author
Message
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 4th Mar 2008 13:10 Edited at: 4th Mar 2008 13:15
Free time is all I have right now. (What I need is the paid time!)

I really miss my printer, oh how I miss my printer!

Yes, lets get that working.

I like your idea of a cube for display. I would think that you could make 6 plains, and draw to bitmaps...then use put image. It would be a bit of a bear at first, but definitely worth the effort.

EDIT: Also, I should be getting my tax refund before the 11th. I am getting that accelerometer. One really cool use is a seismograph, but I want to make a lightsaber/rifle/sword out of it. I posted a bit of the other code in Music & Sound FX, but you need to use an XBox360 controller for it...and noone has tried it yet. The plug-in allows you to play a wave file multiple times. (i.e. While it is already playing.)
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Mar 2008 14:48
Free time Yes soon to be doing that come Thursday, hope the agency can find something before then.

I think the cube might work as there are 2 plains all ready on the screen doing there task, so its just a matter of joining six plain together and make it rotate, dead easy to write in words why it take so b long in code.

if I had longer at work could have borrowed someones 360 controller and then seen what would have happpen, here why does the 360 downloaded code that I have instaled keep going out to check hardware on line, and how you stop it?


here's the other one I got going but the figures did not come back as the guy said they should.



Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Mar 2008 22:25 Edited at: 11th Mar 2008 22:27
tie me down its a bit windy here today have a look at this picture when I've loaded up 51kts or 59mph.



Dark Physics makes any hot drink go cold.

Attachments

Login to view attachments
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th Mar 2008 22:32
How did you make the image appear in the message AND have it as a download?

I Suspect you uploaded it, but how did you make it appear in the message body? Did you make a link to itself or something?

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Mar 2008 22:38
Open the image with the view button then copy the http address info from the browers.

Press the image button in the posting box and paste the info in the image box that pops up.

To get the image up there first use the attachment box at the bottom of the posting box.

hope that helps you.

Dark Physics makes any hot drink go cold.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Mar 2008 22:46 Edited at: 11th Mar 2008 22:50
jinzai if you are about is there anyway of stopping the wind counter from coming up with speeds that a bit two high 21000kts

so that will max out at say 190 kts which if did that it be bye bye roof house and anything not screwed down.

cheers.

Dark Physics makes any hot drink go cold.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th Mar 2008 23:44 Edited at: 11th Mar 2008 23:47
I know you're not asking me, but I use a MPH gauge for my camera... sounds non-related but what I do IS!

First you need a Rule like this:
if WIND > WINDMAX then WIND = WINDMAX

Perhaps a Dampener:

WINDOLD = WINDNEW
WINDNEW = WindSpeedFromDevice
WINDDIFSIGNED=WINDNEW-WINDOLD
WINDDIF = ABS(WINDDIFSIGNED)
IF(WINDDIF>50)THEN
IF WINDDIFFSIGNED>0
WINDNEW = WINDOLD + 50
ELSE
WINDNEW = WINDOLD - 50
ENDIF
ENDIF


Now back to my MPH Gauge for my camera, I have an array ... as long as I want... and EACH FRAME, I LOSE the OLDEST MPH, and Add one NEW MPH to the List. The LIST is always the LAST n NUMBER of MPH I calculated per frame. I Simply Average the LIST and Display the average.

Hope this helps. (Back at ya)
[editted a code variable name error - WINDNEW to WINOLD in the Last Example for dampening.]
[edt3 few more touch ups to logic]

jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 11th Mar 2008 23:57
I have been wondering when that would become an issue for you. I knew that gusts would completely confuse it. I am happy to hear that it does 51k anyway. One solution is to average it out. The place is in the storage of it. This is starting to look alot like my last job in the industry. (You will likely want to store the value, and the instantaneous average.) I will have to calculate what the maximum gust value is, and then it will just be that value when it clips. It has something to do with the distance of the cup from the center of the spindle, iirc.

About the other code, I have been working with model formats lately, and I have no printer at this time. There is some code already there for calculating dates and such. I noticed that the code you have uses floats. That is far too bothersome for me, and I will expand the code you already have. It is better to use integral seconds. You already have some constants for that, and I can tell you that the errors in some of the calculations are the result of leap years and rounding. Some time ago, I wrote a converter that helped such code translate times and it keeps the code working with integers, which makes it consistently accurate. I have a nice 64 bit C version nearly ready, which I will post up later tonight, I think.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th Mar 2008 00:16 Edited at: 12th Mar 2008 00:17
Yes the Issue, If remember right the original code did and average of samples then gave you what that was at the moment I have mod ed this line ;


I let you know if this works when it get very wind again but apart from that all is going fine, the date program I think I all ready have the answer in the code for working out the moon cycle date that find the Julian year.



only thing it does not do is hours.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Jun 2008 13:44
hi jinzai,

Now if your memory is good then you might be able to solve this, the code


ever now and then get a bit confused it start oout ok and using the time start and finished it come out at 834 to 835 ms exsect when it going worng the it does the job in 52ms have tired changing the sleepfor value up or down a bit but that still did not let it work 100%.
Althoe this happens it seem to be if it was cold at night like dew on the pcb.

for most part it has work great it is just anoing when it 60f out side its showing 32f.

if I can find that bit I read about it beging able to send a signal when ready I will post it.

Also now have physic flag flying in it now but when it sometimes clocks 72,000 knots it streaches the flag some what.

looks good only need some good wind days (oh summer nearly here )

well that is so far see you be on a bit more lately that good.

cheers for now.

Dark Physics makes any hot drink go cold.
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 5th Jun 2008 14:10 Edited at: 5th Jun 2008 14:13
Now, you've gone and beaten me to it again. I was going to dredge this thread up again after I got my Wiimote DLL fleshed out a little more so I can start taking seismic data from a Wiimote. I have done some of the stuff I promised above, but...things are an enormous struggle right now. Did you get your webcam working with this yet? I've noticed that cameras can use the same HID interface that the Wiimote, keyboard and joysticks use in DX. (There exists a real possibility of having generic I/O paths for keyboard, or any other form of device that adheres to the HID standard.)

I don't know if I've said it before, but...I found one of those GPS modules that output text data for about $70...I just don't have the income for that sort of thing now. Also, someone else had posted a request about that a few weeks ago.

I apologize for not getting on your shopping list code, I still have no printer, and been having some troubles with my system, trying to get work, move back to Illinois, etc. I will say that getting the font metrics will help alot with sizing controls that use text. Perhaps I will get around to it here soon. Every few weeks there are a flurry of requests about fonts, and sizing controls that use text.

I am anxious to get this working more smoothly, too. The code is there in the DLL to allow the application to understand that the conversion is still in progress, and also the wind speed and temperature issues can be handled, too.

I'll have a look at the code more this evening, but I will say for now that I am going to use those flags I created to drive the state of the data collection so that you won't need the sleep at all. Then, we will look into modifying the wind sample rate to increase its accuracy over a broader range of wind speeds. I will also eventually find the correct bounds on the temperature code, too.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Jun 2008 14:24 Edited at: 5th Jun 2008 16:30
Thanks for your response if you think you might need the code I have at this moment give a Shout and Will email it to you, all those there's only so many bits on there that you can see working.

Plus the Ide had some fun the other week and said let see if you can rebuild it now I've killed a few function by wiping them clean of data, cheers ide, manage to do it plus it help clean up some of the file names to something a bit more mean full.

looking forward to this Dll, as they say good thing comes to those who wait and wait and wait, (meaning things like a good paying job cause playing cost money).

cheers.

ps. look at the start date not bad going for a two person thread

edit
worked how to show possible energy from wind but how would I show amount made in an hour.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Jun 2008 13:26
Hi jinzai,

How would I make your clock, code give me a run timer, meaning when I fire up the programme it will show how long its been running,

run time = 00:01:34, been looking but can see which bit would do it.

what its for so I can guesstamate how many kw hours I could make if I made or brought a wind generator.

Dark Physics makes any hot drink go cold.
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 25th Jun 2008 17:43
I have three variables that get incremented every second, and also there are fractional seconds and the time difference per sync period. They are all in the same place, and already running. They are:
synchronizer.elapsed
synchronizer.GMT
synchronizer.localTOD

They are all integral seconds, but you can also use the accumulated_fraction and period members to calculate the fractional component. (i.e. accumulated_fraction * period = fractional seconds.) The only downside is that I fudge the first second to force the alignment to occur when the counter naturally rolls over anyway, which simplifies things.

If you want both the total elapsed time, the runtime member is available, and its a float.



That synchronizer is probably a little different from the one that you have...I've added some members to help me record timestamps with data, which is great for what we are doing.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Jun 2008 18:35
I see, will look for them and see if I can get it output how I want.

cheers.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Jun 2008 21:08 Edited at: 25th Jun 2008 23:17
I am think I should be able to do this but its driving nuts, where I am I going wrong?



Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Oct 2008 11:48
just putting a few functions I add here to find later.
rem just some coe I have made and putting them somer I hope I can find again when I need it.



Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2024-05-18 10:19:51
Your offset time is: 2024-05-18 10:19:51