While on the subject of electronics, here are some good places to buy LEDs:
MPJA (www.mpja.com) - you can get 100 LEDs (red, green, or yellow) for $1.95. But, there is a $15.00 minimum order. I bought a breadboard from them recently, and the order was filled quickly, so they seem like a pretty reputable establishment.
Jameco (www.jameco.com) - item number 334052 is an orange LED that is $2.20 for 100. Other colors are more expensive, however. I've bought stuff from them in the past, and they're reputable, but their website is kind of a pain to use.
The discrepancies between what different places charge for an LED - a plain vanilla component if there ever was one - really amaze me. At Sparkfun, you pay $0.35 for a green one and $0.50 for a red or yellow. That's right, more than 10 times more expensive!
Sunday, August 31, 2008
AVR microcontroller stuff
I'm pretty close to having the parts I need to start my crazy AVR microcontroller project. (Note to self: in the future, don't order parts from Thailand if you want them to arrive in a timely fashion :-) At the moment I'm just waiting for a programming cable, then I'll be off and running. I was originally going to build a programming cable, but after reflecting on my lack of soldering skills, I decided this wasn't a great idea. The one I ordered (from Sparkfun, good place to buy AVR stuff, BTW) was the AVR-PG1B, which connects to a serial port on your PC, and allegedly is supported by avrdude. I also ordered a nifty little breakout board which adapts the 10 pin AVR ISP connector (2x5 pins) to a single row of six pins which can be plugged into a breadboard. I'll need to get some help soldering it, however.
While waiting for the programmer to arrive, I've been poking around the 'net looking at various AVR tutorials. The best one I've come across is at Sparkfun:
When I get some blinkenlights working I'll post a picture.
While waiting for the programmer to arrive, I've been poking around the 'net looking at various AVR tutorials. The best one I've come across is at Sparkfun:
Beginning Embedded ElectronicsThere's a bunch of stuff at the beginning about building a power supply circuit using a 7805 voltage regulator, but you can save that effort if you have a good switching 5V wall wart power supply. Digilent has a good one (part number SWPS). They also have a nice cable for getting the output of the power supply to a pair of leads (part number COAXPOWER). Beware though: the ends of the leads are tinned with solder, so you don't want to stick them directly into a breadboard, lest bits of solder flake off and cause shorts. A terminal block solves this problem nicely.
When I get some blinkenlights working I'll post a picture.
Friday, August 22, 2008
The rest2web template of awesomeness
Now that classes are starting again, it's time to create course web pages. As I mentioned earlier, I'm using rest2web to generate most of the course web pages.
One really nice feature of rest2web is that the template page (used as a basis for all generated web pages) can contain arbitrary chunks of python code. One thing I noticed about my site design was that the sidebar (containing navigation links) was nice for index documents, but distracting for "leaf" documents such as assignment descriptions, lecture notes, etc.
So, I put in a few lines of code to check the page being generated (available from the pagename variable: see the rest2web template documentation) to see if it's an index page, and if so, suppress the sidebar. I needed to futz a tiny bit with the CSS styles, but overall it was an extremely easy change.
My CS 200 page shows how the generated sites look. Given how much easier it is to author reStructuredText documents than HTML, I think I'm getting awfully close to web content nirvana.
Feel free to use/modify/steal my rest2web template and CSS stylesheet files.
One really nice feature of rest2web is that the template page (used as a basis for all generated web pages) can contain arbitrary chunks of python code. One thing I noticed about my site design was that the sidebar (containing navigation links) was nice for index documents, but distracting for "leaf" documents such as assignment descriptions, lecture notes, etc.
So, I put in a few lines of code to check the page being generated (available from the pagename variable: see the rest2web template documentation) to see if it's an index page, and if so, suppress the sidebar. I needed to futz a tiny bit with the CSS styles, but overall it was an extremely easy change.
My CS 200 page shows how the generated sites look. Given how much easier it is to author reStructuredText documents than HTML, I think I'm getting awfully close to web content nirvana.
Feel free to use/modify/steal my rest2web template and CSS stylesheet files.
Tuesday, August 19, 2008
Thinkpad X61 Tablet
I'm now using a Lenovo Thinkpad X61 Tablet as my main computer at school. So far, I like it a lot. I'm dual booting Windows XP and Kubuntu 8.04. I was able to get the tablet functionality working, with automatic screen rotation (nifty!), using information on the following web page:
You have to have the "hdaps_ec" module loaded. I put it in my /etc/modules file.
You also have to edit /etc/X11/xorg.conf. Here's a link to the one I'm using (caveat emptor):
http://www.krizka.net/2008/02/13/thinkpad-x61-tablet-automatic-screen-rotation-under-linux/If you look down at the comments section, there's some information on running on Kubuntu (KDE) instead of Ubuntu (Gnome).
You have to have the "hdaps_ec" module loaded. I put it in my /etc/modules file.
You also have to edit /etc/X11/xorg.conf. Here's a link to the one I'm using (caveat emptor):
http://faculty.ycp.edu/~dhovemey/thinkpadX61t/xorg.confFinally, the "autorotate.py" script has a regular expression bug (fix is in the comments). Here's the fixed version:
http://faculty.ycp.edu/~dhovemey/thinkpadX61t/autorotate.pyThe stylus is not calibrated terribly well, and the Debian/Ubuntu folks somehow forgot to include the utility that calibrates it. However, it works acceptably. I used the Xournal program to jot some notes, and while it's not exactly like writing on paper, it's not bad at all. I may try to use this in class rather than writing on the whiteboard.
Thursday, August 7, 2008
gschem vs. kicad
I have officially given up trying to use gschem. I can place components (and even create new symbols), but I have had no success connecting pins with wires. It is possible that I am an idiot, but I don't think I have to go too far out on a limb to claim that gschem isn't the most user-friendly of programs.
Fortunately, there appears to be a nice alternative called kicad. The problem of parts I need (e.g., ATtiny2313, ICM7212) not being in the default symbol library is still an issue, although some web searching did eventually turn up symbols for the parts I needed.
Update: I was able to connect VCC on the ATtiny2313 to +5V! I'm going to tentatively say that kicad rocks.
Fortunately, there appears to be a nice alternative called kicad. The problem of parts I need (e.g., ATtiny2313, ICM7212) not being in the default symbol library is still an issue, although some web searching did eventually turn up symbols for the parts I needed.
Update: I was able to connect VCC on the ATtiny2313 to +5V! I'm going to tentatively say that kicad rocks.
Wednesday, August 6, 2008
rest2web
I've written a lot of HTML in the past few years, especially for course web pages. I've used two basic techniques:
Technique #2 is better than #1, but Kompozer (which was derived from the Mozilla editor) has its own share of quirks. It's buggy, and it generates ugly HTML (it wants to put <br> tags all over the #^!%#! place). I've been willing to live with its flaws, and it's saved me a lot of time. However, it doesn't help in automating the creation of navigational elements (e.g., breadcrumbs, sidebars).
Enter reStructuredText and rest2web. The former is a wiki-like lightweight markup language: a reST document looks more or less like plain text, but can easily be turned into HTML via a nifty python utility. The latter is a site-creation tool which uses reST and some additional lightweight metadata to create complete websites from reST files. It took a couple hours to learn my way around, but I was able to produce a very spiffy-looking site from (essentially) plain text files. Sweet!
Now I just need to create some content :-)
- Hand-written HTML using a text editor. Blech.
- Editing HTML documents using Kompozer.
Technique #2 is better than #1, but Kompozer (which was derived from the Mozilla editor) has its own share of quirks. It's buggy, and it generates ugly HTML (it wants to put <br> tags all over the #^!%#! place). I've been willing to live with its flaws, and it's saved me a lot of time. However, it doesn't help in automating the creation of navigational elements (e.g., breadcrumbs, sidebars).
Enter reStructuredText and rest2web. The former is a wiki-like lightweight markup language: a reST document looks more or less like plain text, but can easily be turned into HTML via a nifty python utility. The latter is a site-creation tool which uses reST and some additional lightweight metadata to create complete websites from reST files. It took a couple hours to learn my way around, but I was able to produce a very spiffy-looking site from (essentially) plain text files. Sweet!
Now I just need to create some content :-)
Saturday, August 2, 2008
djboxsym - a better way to create gschem symbols
OK, after my recent frustrations trying to use tragesym to make a gschem symbol for the ICM7212, I tried out djboxsym.
To make a long story short, it took about 15 minutes to do what I needed. Sweet. I used the web interface, which is very cool because you can immediately preview your work.
For posterity, my extremely modest efforts are available:
icm7212.sym
icm7212.symdef
Caveat emptor.
To make a long story short, it took about 15 minutes to do what I needed. Sweet. I used the web interface, which is very cool because you can immediately preview your work.
For posterity, my extremely modest efforts are available:
icm7212.sym
icm7212.symdef
Caveat emptor.
Subscribe to:
Posts (Atom)