Devantech SRF04 and 05 Ultrasonic Sensor

The Devantech SRF04 and SRF05 ultrasonic sensors are easy to use and reasonably accurate distance ranging sensors. To use them, you send the sensor s pulse of 10 microseconds on its INIT pin. Then the sensor sends out an ultrasonic pulse and waits for the pulse to bounce off something and return an echo. The sensor then pulses its ECHO pin. The length of the pulse in microseconds is proportional to the distance of the object from the sensor. The code below reads a Devantech sensor on an Arduino or Wiring module.

Continue reading “Devantech SRF04 and 05 Ultrasonic Sensor”

PDuino

Hans Steiner, God of PD/USB and a darn nice guy, has released PDuino. In his words:

“Here’s the first test release of Pduino, a Pd firmware for Arduinoand a matching Pd object, . This allows you get data from the digital and analog inputs, and send data to the PWM and digital outputs. It also allows you to change the digital pins from input, output, or PWM. And you can choose how many analog inputs and turn on/off digital input.

“Keep in mind its a test release, the only thing I am not sure about right now is digitalInput, everything else seems to work fine. In the future, I’d like to figure out how to add the pulseIn feature.

“This firmware would work well with Processing, Max/MSP, Flash, whatever. Then the Arduino becomes a dead simple, cheap sensor box for the newbies, but still open for playing later.”

Stepper motor controller from analog input

This program controls a stepper motor from an analog input. In testing it, I used a potentiometer, which gives a persistent value. An analog input that changes when it’s not contacted, like a SpectraSymbol linear or circular pot, wouldn’t work with this example.

Thanks to the Fall ’05 Wednesday morning class for the early experimentation on this code.

Written in PicBasic Pro, tested on a PIC18F252

Continue reading “Stepper motor controller from analog input”