Posts Tagged ‘software’

Functional Eclipse Computer

August 8, 2017

I have progressed on the eclipse computer project past a prototype to something that mostly works. There a few minor bugs in the code, but it is usable as-is. I’ve got fixes for them, but need to test before committing. The system still doesn’t use its buzzer for an audible prompt, and I haven’t written anything yet to help take a sequence of pictures showing the progression of the eclipse. I may not get to that for a day or two to deal with travel related issues. I plan on taking it, and a bunch of camera gear, to the Nashville area to view the eclipse.Eclipse ComputerThe picture shows what is nearly the final hardware, but older software. This video shows the current software. The hardware changes between the two are all to help keep everything from moving around in the case, and to keep the barrel connector that supplies power to the upper breadboard close to the board. The connector was moving away from the board too easily and causing a reduction in the supplied voltage.

All of these problems were solved by applying solid copper wires in the right spots. I use solid copper with breadboards a lot because I can cut the wires to the length I need and the conductor is stiff enough to be inserted into the breadboard without tinning or the addition of some connector. I used a few more of these wires to hold down the barrel connector and to apply some pressure against the top of the case. It worked out quite well.

I changed the display from a 16×2 LCD to a 20×4 one just for the additional text. The video shows how I’ve made use of the space. The 20×4 display is a bit dark and needs a backlight to be readable unless it is in bright direct sunlight. The 16×2 display didn’t have this problem; it is more like a common digital watch display in how it handles light. I made and adjusted an automatic backlight control program that gets brightness measurements from a TSL2591 at its minimum gain setting and uses one of the Raspberry Pi’s PWM outputs. It seems to make the display readable enough in bright light and keeps it from being brighter than it needs to be most of the time. I’d rather have a 20×4 that is more like the 16×2, but I haven’t got the time.

I tested the computer running on 8 Eneloop NiMH 2000mAH batteries. For most of the test, the computer was indoors and used the minimum backlight setting. It recorded around 600mW power consumption under these conditions. In brighter light, power consumption got as high as 850mW. Working out a new times of totality can add about 400mW, but I wrote the code to limit how often that occurs.

The batteries kept the computer running so long that I couldn’t finish a battery life test in one day. The combined runtime before exhausting the battery charge was around 25 hours. That was much longer than I anticipated when I decided on 8 AAs. I’m still going to use 8 because I can, and the backlight will make the runtime a bit shorter, maybe 16 or 17 hours, about twice what I need. Also, a smaller battery pack would have more room to move about, and I already wrote low battery detection code based on 8 batteries in series.

I’ve got the Raspberry Pi Zero running Gentoo Linux. I made modifications to the configuration used by OpenRC to boot up the system so that it starts the program that provides information on the LCD and the separate backlight control program. A simple Bash script keeps re-running the software until it terminates without error, or the script is killed. No GUI is installed. I’m going to see if I can get it to set the clocks on my cameras, and bring up a network connection, when the corresponding device is plugged into USB. Nothing critical, but it would be nice. Hopefully plugging in a camera won’t cause it to reboot.

Advertisements

A Backslash is not a Slash

June 26, 2011

I must be playing the crotchety old man today. Maybe it has something to do with not feeling all that well. I’ll get over that, but I might not get over these young’uns who, when I tell ’em to use a slash, ask which one. There is only one. It is used for division. It is used in paths for Internet protocols like HTTP and FTP. It is used as the directory separator on UNIX and UNIX-like systems, which is how it came to be used in Internet protocols. That slash. You know the one.

These young’uns seem to get the slash confused with the backslash. I’m not quite sure why. Try putting in your source code somewhere “a = b \ 2” and I can guarantee that it won’t divide by two unless you have made a conscious effort to do something about that backslash. Try putting backslashes in place of the slashes in the URL bar of your web browser. There is a good chance that the web browser won’t know what you want it to do, and if you get past that, the web server will likely give you a 404.

My best guess is that these young’uns have gotten confused by some Microsoft software allowing both the slash and backslash to be used as directory separators. There was a time when their web browser allowed this and caused some people just learning how to make web sites to make links that were incompatible with anything other than Microsoft software. It seems we have gotten past that bit of confusion from the late 1990’s, yet some software developers get confused when I tell them to use a slash, even though they ought to know them apart to make their division and escape sequences work.

I suppose I might be partly to blame. I regularly use slashes in paths on code that runs on Windows systems because I know that the Windows libraries, like Win32, will interpret the slash as a directory separator. It was a fine decision on Microsoft’s part to assist in porting UNIX software to Windows, and I do use some software at work that started on UNIX and was later ported to Windows. The whole development team does, even if they don’t realize it. So, I use slashes in the paths because they work, and I don’t have to type two characters; using the backslash would start an escape sequence and require another backslash to be interpreted as a single backslash in a string literal.

Still, that doesn’t seem very confusing to me. Software developers need to get this sort of thing straight, so I’m still not clear as to why software developers don’t know what I mean when I say slash. I can understand if they ask about it in the context of a path since not all software on Windows will go both ways, but I get asked outside that context, too. I think when I’m asked which slash to use in the future, I may start answering with use the character for division, or use the character for an escape sequence. If a software developer still doesn’t know what I mean, then they shouldn’t be employed as a software developer. Fortunately, I think it’ll be a while before I find myself working with such an ignorant developer.


False Steps

The Space Race as it might have been

keithlugcom.wordpress.com/

You Control The Action!

High Frontier

the space colony simulation game

Simple Climate

Straightforwardly explaining climate change, so you can read, react and then get on with your life.