Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.24 KB

README.md

File metadata and controls

56 lines (44 loc) · 1.24 KB

BITalino (r)evolution Python API

The BITalino (r)evolution Python API provides the needed tools to interact with BITalino (r)evolution using Python.

Dependencies

Installation

pip install bitalino

Example

# This example will collect data for 5 sec.
macAddress = "00:00:00:00:00:00"
running_time = 5
    
batteryThreshold = 30
acqChannels = [0, 1, 2, 3, 4, 5]
samplingRate = 1000
nSamples = 10
digitalOutput = [1,1]

# Connect to BITalino
device = BITalino(macAddress)

# Set battery threshold
print device.battery(batteryThreshold)

# Read BITalino version
device.version()
    
# Start Acquisition
device.start(samplingRate, acqChannels)

start = time.time()
end = time.time()
while (end - start) < running_time:
    # Read samples
    print device.read(nSamples)
    end = time.time()

# Turn BITalino led on
device.trigger(digitalOutput)
    
# Stop acquisition
device.stop()
    
# Close connection
device.close()

License

This project is licensed under the GNU GPL v3