New
#1671
Bussy,bussy bussy .. nice work ,as always ..
I'm not that fussy with how the jumper wires go over the top but there isn't much I can do about it. At some point I think I'm going to swap them out for shorter ones.
I had a piece of the Ninja Difusser I had cut off one I had cut down for my 3A+. It made a nice stand for the back and gave me a place to mount the BME680.
Before I mounted the LED shim that Pi just tilted back. Nothing was touching the ground that shouldn't so no big deal. The LED Shim once mounted was touching though. so I had to prop the back up to level it out.
Other wise it was all tilted sideways and crooked. It just didn't sit nice and level horizontally. The existing holes in the piece of difusser lined up perfectly with the mounting holes in the Pi A+. Just had to trim the bottom a bit with my dremel to make it the right height.
The python code is the next part. I have that same LED Shim mounted in the same position in my portable weather clock. It's currently showing the temperature. Basically a colored thermometer. This time of year doing that on my indoor one would be a bit of a waist. It will just sit at 22c all day. Thats why I decided to show the barometric pressure on it. A quick glance indicator as to is it stormy out etc. Haven't decided exactly how I want to do it yet though. The color of the LED's will be the main indicator, then maybe a secondary marker to show how much it is that range. Something like that. It will be trial and error. Code it and see if I like it and its understandable.
I tinker a bit every day,not getting much done ...
Off and on for me. Some days I can spend most of the day working on something. Other days not so much. I like to spend a day doing fabrication. Then the next (two or three ) just doing the software part.
The big satisfaction for me is having something nobody else has. Or being the first to build it etc. Like my weather clocks. Thats been a never ending project. I just keep adding to it and changing how it works.
It started out pretty simple, Pi A+ and Sense Hat. Its way beyond that now. Lots and lots of fun though, with a mix of frustration if I'm honest lol.
Anyway, I'll hook my indoor weather clock up to a monitor and keyboard some time today and have at it. I have a few errands to run after the morning walk but the rest of the day is pretty well free.
I want to get back to tinkering with my Unicorn Hat HD too. I need to hunt up a power supply though. Really need to order one or two more. I may gear something up so I can use one of the ones I have with the barrel jacks, they are 3A. I think I have a spare pigtail kicking around. I'll solder on a couple of female jumpers and just plug it into the male header on the Black hat hacker board.
Well, the math gets interesting again, lol. Basically I have 5 bands or ranges
X to 981mb Very low
982 - 1003 Low - 1003 - 982 = 21
1004 - 1025 Mid Range - 1025 - 1004 = 21
1026 - 1047 High - 1047 - 1026 = 21
1048 - X Very high
Thats 21 mb per range and my LED shim is 28 LEDs. Thats an easy conversion though right? Divide by 3 and then multiply by 4.
Then round off for a number between 1 and 28. Then subtract 1 to get it so its 0 to 27. The first LED is addressed as 0.
The other wrinkle is my LED shim is basically upside down, 0 at the top and 27 on the bottom. This time its not an issue though.
I'll take my max number for that range and subtract the actual pressure from it. That gets me a number between 1 and 21. And as a bonus, the lower the actual pressure is, the "higher" that number is. Just what I want.
That puts my marker lower down the scale. As an example
elif p >= 982 and p < 1004: # Low
ledshim.set_all(255, 255, 0) # Yellow
M = ((1003 - p) / 3) *4
M = M - 1
M = round(M)
ledshim.set_pixel(M, 255, 255, 255)
Somethings not right with the math though? If the pressure is 1003mb its 1003 - 1003 = 0, 0 / 3 x 4 = 0, round off and subtract 1 = -1. << Ops?
If the pressure is 982mb its 1003 - 982 = 21, 21 /3 x 4 = 28, round off and subtract 1 = 27. My marker will be at the very bottom of my scale where I want it.
If I don't subtract the 1 the first calculation works out to 0, but the 27 becomes 28? That will throw up an out of range error, same as the -1 will.
I think what I'm going to do is just add an If M < 0 M = 0. I think what's going on is my range is actually 22 mb not 21. I'm sticking with 21 though as it makes the math easier.
Haven't actually run my code yet, just sketching it out. I have errands to run so it will have to wait until latter on today.
Last edited by alphanumeric; 04 Jan 2019 at 12:23.
It was even more fun when I did it with temperature for my portable. My LED shim being basically upside down really complicated my calculations. And no easy way to mount it the other way round. I already had it all soldered anyway and wasn't changing it unless I really had to. I wanted my marker to go up as temp increased, that meant reversing my marker calculations. Multiplying by -1 to get + numbers. And make it count backwards lol.
I'll likely test my new code after supper tonight. Backs a bit sore so I'm just going to relax a bit for now.