Category Archives: pBasic (Basic stamp)

Controlling Inkjet Printers from a microcontroller

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 … Continue reading

Posted in arduino/wiring, AVR, BX-24, circuits, pBasic (Basic stamp), PIC | Tagged | 1 Comment

DC Motor Control with a TIP120 Transistor

Here’s the schematic for the capacitors and the regulator:The simplest program for this would be as follows (on the BX-24): Sub main() call delay(0.5) ‘ start program with a half-second delay do call putPin(13,1) call delay(1.0) call putPin(13,0) call delay(0.5) loopend sub In PicBasic Pro, the code would be as follows: pause 500 ‘ start program with a half-second delay main: high PORTD.2 pause 1000 low PORTD.2 pause 1000goto mainFor pBasic and mBasic, use the PicBasic Pro example and change the pin names.If your power supply for the microcontroller is compatible with your motor, you can wire the motor supply in parallel with the 5V regulator. For example, I use a 12V DC 1000 mA power adaptor, so I can use a 12V motor, if the power from the motor is wired in parallel with the 5V regulator’s input, like so:Note that the motor and the BX24 need a common ground (in our case, they get it through the transistor’s base; see above schematic).A motor controlled like this can only be turned in one direction. Continue reading

Posted in BX-24, pBasic (Basic stamp), PicBasic Pro | Comments Off on DC Motor Control with a TIP120 Transistor

Random Numbers and Physical Computing

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…. 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. Continue reading

Posted in arduino/wiring, AVR, BX-24, misc, pBasic (Basic stamp), PIC, PicBasic Pro, XBee | Tagged , , | Leave a comment

Branch

BRANCH allows branching to one of multiple subroutines depending on the value of a specified variable…. If value = 1, the program goes to label2. Continue reading

Posted in pBasic (Basic stamp) | Comments Off on Branch