sparkfun / pxt-weather-bit

MakeCode package for the SparkFun weather:bit board - beta
https://makecode.microbit.org/pkg/sparkfun/pxt-weather-bit
12 stars 22 forks source link

Add working weather bit code for the following: #2

Closed ADataDate closed 7 years ago

ADataDate commented 7 years ago

BEARS MERGE MY PULL REQUEST!!!!

pelikhan commented 7 years ago

Other comments: users may likely forget to call "start polling....". You should always check that it has been called and call it as needed.

ryanjmortenson commented 7 years ago

In regards to your statement about starting the monitoring, if monitoring hasn't started and we start if when the user tries to read the the value it will always be zero because no data has been collected. I think it may be better to return/print an error saying the monitoring isn't started.

pelikhan commented 7 years ago

In such case, you could sleep long enough or wait for the sensor event to trigger. Kids will forget to initialize things.

From: ryanjmortenson [mailto:notifications@github.com] Sent: Monday, May 15, 2017 9:56 PM To: sparkfun/pxt-weather-bit pxt-weather-bit@noreply.github.com Cc: Peli de Halleux jhalleux@microsoft.com; Comment comment@noreply.github.com Subject: Re: [sparkfun/pxt-weather-bit] Add working weather bit code for the following: (#2)

In regards to your statement about starting the monitoring, if monitoring hasn't started and we start if when the user tries to read the the value it will always be zero because no data has been collected. I think it may be better to return/print an error saying the monitoring isn't started.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsparkfun%2Fpxt-weather-bit%2Fpull%2F2%23issuecomment-301675316&data=02%7C01%7Cjhalleux%40microsoft.com%7Cec9b8eb73d9d484a503d08d49c17c995%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636305073357978489&sdata=MhQ58WH%2BfYVUIycRV%2ByfAJYyCFsNzZ%2B1IkmXrlZDsyc%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD-4KRwWXttKSc8Tj0hayvTW2VDqinAOks5r6SxEgaJpZM4NaQQc&data=02%7C01%7Cjhalleux%40microsoft.com%7Cec9b8eb73d9d484a503d08d49c17c995%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636305073357978489&sdata=Iu9uSW541qJZ10A1saxosq7KXbZ9M2s6fJT9YfctM4I%3D&reserved=0.

ryanjmortenson commented 7 years ago

That works for wind because of it's short sampling duration, but for the rain gauge the sample time will have to be a lot longer to get anything of value (1 event is .011 inches).