mamo91 / Dongleless-myo

Replacement for MyoConnect on linux without the official Myo dongle.
19 stars 10 forks source link

Streaming EMG data #1

Open emanuellimabr opened 8 years ago

emanuellimabr commented 8 years ago

How do I stream the emg data? When I call the event "emg_data", it prints the data just once

GermanAndresVargasTorres commented 7 years ago

Try this:

import dongleless
import time

def emg_data(myo, emg):
    print("Current POSIX time: ", time.time())
    print("New EMG sample: ", emg)
    print(" ")

function_dict = {
# "imu_data":imu_data, #printing these gets really crowded, uncomment them if you want to use them.
"emg_data":emg_data 
}

dongleless.run(function_dict)