There was an interesting thread on the Sketching in Hardware mailing list a while back on how to control an inkjet printer. Wendy Ju started the discussion. Following are some of the links from that thread:
A closed, proprietary portable printer: Xyron Design Runner
Nice explanation of how inkjets work and how to control them in general. Link submitted by Scott Minneman
Instructions for now sold-out Parallax Serial Inkjet Kit (which does include inkjet cartridge pinouts for the HP 51604A Black Inkjet Cartridge, as well as board schematics, parts and instruction routines for writing to the cartridge). Even without the device, Parallax’ documentation is handy.
Instructions on how to build your own DNA microarrayer using commercial off-the-shelf parts, including inkjet technologies. The last two links submitted by Wendy.
Haven’t had occasion to use these yet, but they seem handy.
This example assumes you’re using a DC motor that runs on low voltage DC, in the 5-15V range. Connect leads to its terminals, and run if from a benchtop power supply if you have one. Try changing the voltage on it, and seeing what effect it has. Don’t go over the motor’s rated voltage. Connect a switch in series with the motor and use it to turn on the motor.
Continue reading “DC Motor Control with a TIP120 Transistor”
Most microcontrollers don’t have a random function. Random functions are not truly random, they’re actually a complex mathematical formula that results in a number that “seems” random. That can take up lots of processing time, so it’s usually the first function to go when writing a microprocessor language.
In fact, most of what you do in programming physical computing projects is to figure out how to deal with the world’s natural randomness and make it look smooth. A photoresistor read through an analog-to-digital converter, for example, will never give you a nice steady number, it always fluctuates with tiny changes in lighting that your eye can’t see. Your consciousness is a great leveller for the sensors that are your eyes, ears, skin, nose, and taste buds When you move a photoresistor from one room to another, your readings will be totally different, and all of a sudden, you have to re-calculate what is “average” and what constitutes the lighting change that you want. And that’s just one of many examples. The fact is, data from sensors is filled with the noise of the real world. Plan for it in advance.
Technorati Tags: pcomp, physical computing, programming
Continue reading “Random Numbers and Physical Computing”
BRANCH allows branching to one of multiple subroutines depending on the value of a specified variable. It’s the equivalent of a case statement. PicBasic Pro also has a BRANCH statement, as does mBasic. It looks like this:
BRANCH value, [label1, label2, label3...]
If value = 0, the program goes to label1. If value = 1, the program goes to label2. If value = 2, it goes to label3, and so forth.
Here’s a BS2 program illustrating BRANCH:
Continue reading “Branch”