Hi, I would like to ask is there any reference code for reading analog input from analog input module that's connected to the Bpod state machine R2 using Pybpod? I only see matlab code, but could not find anything similar in the pybpod protocols. Therefore am wondering if this is possible. Thank you!
Is this a correct python code?
from pybpodapi.protocol import Bpod, StateMachine
#initiate Bpod
my_bpod = Bpod()
sma = StateMachine(my_bpod)
sma.add_state(
state_name='run',
state_timer=0.05, #LED turn on for 1 sec
state_change_conditions={Bpod.Events.Tup: baseline},
output_actions=[Bpod.AnalogInput1, 1])
my_bpod.send_state_machine(sma) # Send state machine description to Bpod device
my_bpod.run_state_machine(sma) # Run state machine
print("Current trial info: {0}".format(my_bpod.session.current_trial))
my_bpod.close()