|
1921
|
Using Arduino / Programming Questions / Re: count every bit
|
on: March 29, 2012, 06:33:15 pm
|
|
untested:
byte B = 'Z'; byte count = 0; while ( B ) { count += B & 1; B = B >> 1; // right shift of unsigned integers does not do sign extension, as a char value would }
I leave the rest up to the bunny..........
|
|
|
|
|
1925
|
Using Arduino / Project Guidance / Re: Removing the pot setting LCD contrast?
|
on: March 29, 2012, 12:00:54 pm
|
To that end it is good to be able to adjust the brightness of the display for viewer comfort. According to the original post and according to the topic heading this thread is about the contrast and not about the brightness.
You have an unattributed quote in your previous post which has nothing to do with this thread.Don EDIT: I found it - your quote is from one of your unexplained and irrelevant links in Reply # 12. In Your Rather Pedantic Opinion.
|
|
|
|
|
1926
|
Using Arduino / Project Guidance / Re: Looking for custom enclosure for my project
|
on: March 29, 2012, 11:31:15 am
|
|
I've potted with hot glue. Yes, you need to mask off everything you don't want the potting mix to get in. Tape works well enough, give it a try. You'd need some kind of containment to flow the glue into but cardboard or card stock works just fine, you can print on that and cut it and glue however you wish or find something already made and punch your holes in that.
If you can put your circuit so that anything that makes heat (like a regulator or chip-top) is pressed against a piece of flat metal then set that on the bottom so that the glue wont get under it, you will have a heat sink that can be attached to a bigger heat sink if desired. You don't have to fill to cover everything either. Do you want the led to be replaceable or not? Of course if it's potted to the base then it's not going to fall out either, it's your call.
The first potted circuits I saw were black blocks made of, IIRC, acrylic (same stuff those paperweights with an object inside are/were made of, Edmund Scientific sold a lot of it) with carbon black mixed in meant to keep what was inside a bit of a secret.
|
|
|
|
|
1927
|
Using Arduino / Project Guidance / Re: Solar Tracker Project
|
on: March 29, 2012, 11:12:46 am
|
|
If I put a hole in a piece of opaque material then sunlight shining through will make a dot on a surface below. If I put a ring of sensors around that then when the sun moves the dot would strike a sensor. My accuracy goes up with the distance between the material with the hole and the surface below and the number of sensors in the ring.
For me, something like that might be used to tilt reflective panels to put more light on the collector. After all, they use solar panels in space where the light is far brighter than down on the ground -- especially at the latitudes most of us live.
|
|
|
|
|
1928
|
Using Arduino / Project Guidance / Re: Looking for custom enclosure for my project
|
on: March 28, 2012, 09:46:46 pm
|
|
+1 on the 3D printing, if you don't require a metal enclosure. You might have an excuse to get your own Cupcake!
OTOH there are places you can send a design file and they will print the items... but what cost?
If the device won't make much heat or could be built on a heat sink then you could maybe pot it into a plastic brick.
If you want to cut sheet metal clean, use punch and die. For just making small holes in thin metal, a custom paper punch will do though you'd want some kind of positioning jig so the hole is in the right place. That would be for modifying a box like an Altoids tin and be prepared to sharpen the punch every so often. Another alternative would be to use hollow punches (Harbor Freight has them) or set up punch and die in a press. Drills and saws for sheet metal work are for amateurs. They're slow and the cuts need too much dressing up.
|
|
|
|
|
1929
|
Using Arduino / Project Guidance / Re: Removing the pot setting LCD contrast?
|
on: March 28, 2012, 09:15:21 pm
|
Yes, electrically it "works". However the human eye has this tendency to open up more in darker settings than in brighter ones. A light-emitting display that is comfortable to the eyes in a bright setting will not be as comfortable in a darker setting to normal human beings. To that end it is good to be able to adjust the brightness of the display for viewer comfort. It is also good from a battery-saving viewpoint. Background & Objective: This project began as an effort to create a smart backlighting system for television remote controls. A low-power capacitive proximity sensor detects active handling which in turn controls the backlight. To save battery life, the backlight should not be turned on in bright conditions. But adding a separate light sensor would require a new mechanical design for the remote, adding considerable cost. Our solution was to use the backlight LED itself as the light sensor. We developed a simple microprocessor interface technique that uses one additional digital I/O pin, but no other additional components compared to those need to simply light the LED. Since the circuit draws only microwatts of power, it has a minimal impact on battery life. Hmmmm, and for their purposes it's better to shut the backlight off in bright conditions.
|
|
|
|
|
1934
|
Using Arduino / Project Guidance / Re: how to create an array with both members and number of members undefined
|
on: March 27, 2012, 11:42:44 pm
|
I'm looking all over the place, and I guess it's just my lack of understanding  , but I can't find a decent example of a continuous array being smoothed - not just averaged. What I mean is that if in the course of 300 values from 0 to 299 I have parts like: 234, 235, 238, 236, 239, 240, 241 I can smooth the curve to 234, 235, 236, 237, 238, 239, 240 Any pointer? Thanks You want curve fitting or can you live with a linear fit? That's possibly a major scope in itself. The quick and easy for curve fitting would be to transfer the data to your PC and use an application there. Perhaps a spreadsheet or matlab?
|
|
|
|
|
1935
|
Using Arduino / Project Guidance / Re: piezoelectricity
|
on: March 27, 2012, 02:19:49 pm
|
|
I put one edge of a disk up on a pen and tapped the center, it made the led shine brighter.
You can keep a led lit this way, but it's the frequency of taps/stressings over time that makes a difference. Like 1000's of taps per minute _maybe_ can burn a led out, depends on how hard the piezo is hit.
I hope you're not expecting to run a motor off a piezo?
|
|
|
|
|