This notebook demonstrates how to use Mathematica to control a bTop-2 device for analog input and output.
We begin, as always, by loading the BTopTools package.
BTopAnalog can be used to get a single sample from a set of analog input channels. Here we ask the first connected bTop-2 for the voltages on its analog input channels 0, 1, and 3:
We can set voltages on the output channels using a similar command. Here we set the voltage on channel 1 of the first connected bTop to 1.5V:
We can loop output channel one back to an input channel to see if that last command worked. Here I've looped output channel 1 back to input channel 3:
We can take analog samples at a controlled rate using the BTopAnalog function as well, by using two extra arguments. The next command takes 4000 samples from channel 0 of the first connected bTop-2, at a rate of 1000Hz:
We extract the analog data from the first channel of the first connected bTop- 2, and play the tone:
We can send the analog signal straight into Mathematica's Fourier function. In this case I used a signal generator to get a pure sine wave
Created by Mathematica (January 24, 2007)