contact info:
info@blueink.com

Blueink.com
3014 Bluff #101
Boulder CO 80301

Sending sound out with the BX-24.
The BX-24 can output audible frequencies (measured in Hertz) by using the Freqout Command (see below).

Some notes about frequencies:

  • Humans hear frequencies from 20 to 20,000 Hz. But as a person ages, the high frequencies are the first to go. Your parents and professors probably hear about 25 to 14,000 Hz.
  • Middle A (above middle C) is 440 Hz.
  • Pitch is frequency (high pitch = high freq.).
  • One octave is a doubling of frequency (A=440 Hz, high A = 880 Hz).


Excerpt from Personal Robotics News - April, 2000, http://www3.sympatico.ca/donroy/codebank.html
-----------------------------

Make Some Noise

Getting your BX-24 powered robot to deliver audible outputs is simplicity itself. To do this, obtain a piezoelectric speaker (e.g.: Radio Shack #273-073). Connect the positive lead to an output pin and the negative to the BX-24 ground.

With that completed, you are ready to start investigating the FreqOut procedure. The program syntax for the command is:

Call FreqOut(Pin, F1, F2, Duration) (see more on freqout below)

Pin is the I/O line that you connected the positive lead of the piezo unit to. F1 and F2 are the frequencies to output-the BX-24 can generate a composite signal containing two different notes. If you just want a single frequency, make F1 and F2 the same value. Lastly, Duration is the length of time for it to generate the audio output, measured in seconds.

A simple beep command might use 1000 for the F1 and F2 values, along with 0.25 for duration. Be aware also that multitasking is disabled for the length of the sound output. Also, the real time clock will lose ticks if the process takes anything more than 1.95 ms.

With this information, you should be able to start developing some satisfying software for your BX-24 powered robot. Rudimentary collision recovery is possible with the servo drive routines and bump switch reading capability, perhaps with bump events being punctuated by audible output.

Copyright © 1999-2000 TSG Technical & Systems Group, Inc.


FreqOut procedure (float version)

Call FreqOut(Pin, Freq1, Freq2, Duration)

Arguments

Item

Type

Direction

Description

Pin

Byte

Input

Output pin number.

Freq1

Integer

Input

Frequency 1. Units are in Hz.

Freq2

Integer

Input

Frequency 2. Units are in Hz.

Duration

Single

Input

Duration of signal. Units are in seconds. Range is about 1.0 ms to 2.56 s.

Description

Generates an analog signal that consists of two superimposed sine waves. The signal is generated for the specified duration, where the time units are in seconds.

Warning

This procedure halts all multitasking for the duration of the call. The real time clock (RTC), task switching and network traffic are suspended during this time. If Duration is greater than 1.95 milliseconds, the RTC will lose time.