lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


if BetaValue>0.2 then
hudps(Go);
else
hudps(Stop);
end

I added a "then" to make it suit lua syntax

On Wed, Mar 1, 2017 at 8:08 PM, Hamed Taheri <hamedtaheri@yahoo.com> wrote:
Hi all

I want to do my project using openvibe and another software.
i made a connection between these two software.
in OpenVibe we have lua simulator which it send a stimuli to my another software but the problem is
i don't know how can i send i unit8 output.
in my project i should read EEG beta band power if this power is higher than my threshold send 1 to 127.0.0.1 : 3000
and if lower than threshold send 0 to IP Port.
here a i have a simple Matlab code that it work well for sending 1 or 0 but i don't know how can i write in lua language.

Go=uint8('1');
Stop=uint8('0');

hudps = dsp.UDPSender('RemoteIPPort',3000);   % Sets up UDP Sender port

if(BetaValue>0.2)    % My Threshold
hudps(Go);
else
hudps(Stop);
end

i will be so grateful if you can help me.

Best Regards



 
Hamed Taheri Gorji
PhD Candidate
Brain Imaging Laboratory 

DEPARTMENT OF PSYCHOLOGY
FACULTY OF MEDICINE AND PSYCHOLOGY
SAPIENZA
University of Rome


Santa Lucia Foundation, Via
Ardeatina 306, 00179 Rome