91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2.51MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-11-14
  • 語言: 其他
  • 標(biāo)簽: thinkgear??腦電??

資源簡介

基于neurosky的腦電采集套件,vs2010上數(shù)據(jù)接收DEMO

資源截圖

代碼片段和文件信息

#include?
#include?

#include?“thinkgear.h“

/**
?*?Prompts?and?waits?for?the?user?to?press?ENTER.
?*/
void
wait()?{
????printf(?“\n“?);
????printf(?“Press?the?ENTER?key...\n“?);
????fflush(?stdout?);
????getc(?stdin?);
}

/**
?*?Program?which?prints?ThinkGear?EEG_POWERS?values?to?stdout.
?*/
int
main(?void?)?{

????char?*comPortName?=?NULL;
????int???dllVersion?=?0;
????int???connectionId?=?0;
????int???packetsRead?=?0;
????int???errCode?=?0;

????/*?Print?driver?version?number?*/
????dllVersion?=?TG_GetDriverVersion();
????printf(?“ThinkGear?DLL?version:?%d\n“?dllVersion?);

????/*?Get?a?connection?ID?handle?to?ThinkGear?*/
????connectionId?=?TG_GetNewConnectionId();
????if(?connectionId?????????fprintf(?stderr?“ERROR:?TG_GetNewConnectionId()?returned?%d.\n“?
?????????????????connectionId?);
????????wait();
????????exit(?EXIT_FAILURE?);
????}

????/*?Set/open?stream?(raw?bytes)?log?file?for?connection?*/
????errCode?=?TG_SetStreamLog(?connectionId?“streamLog.txt“?);
????if(?errCode?????????fprintf(?stderr?“ERROR:?TG_SetStreamLog()?returned?%d.\n“?errCode?);
????????wait();
????????exit(?EXIT_FAILURE?);
????}

????/*?Set/open?data?(ThinkGear?values)?log?file?for?connection?*/
????errCode?=?TG_SetDataLog(?connectionId?“dataLog.txt“?);
????if(?errCode?????????fprintf(?stderr?“ERROR:?TG_SetDataLog()?returned?%d.\n“?errCode?);
????????wait();
????????exit(?EXIT_FAILURE?);
????}

????/*?Attempt?to?connect?the?connection?ID?handle?to?serial?port?“COM5“?*/
????comPortName?=?“\\\\.\\COM3“;
????errCode?=?TG_Connect(?connectionId?
??????????????????????????comPortName?
??????????????????????????TG_BAUD_57600?
??????????????????????????TG_STREAM_PACKETS?);
????if(?errCode?????????fprintf(?stderr?“ERROR:?TG_Connect()?returned?%d.\n“?errCode?);
????????wait();
????????exit(?EXIT_FAILURE?);
????}

????/*?Read?10?ThinkGear?Packets?from?the?connection?1?Packet?at?a?time?*/
????packetsRead?=?0;
????while(?1?)?{

????????/*?Attempt?to?read?a?Packet?of?data?from?the?connection?*/
????????errCode?=?TG_ReadPackets(?connectionId?1?);

????????/*?If?TG_ReadPackets()?was?able?to?read?a?complete?Packet?of?data...?*/
????????if(?errCode?==?1?)?{
????????????packetsRead++;


?if(?TG_GetValueStatus(connectionId?TG_DATA_POOR_SIGNAL)?!=?0?)?{

????????????????/*?Get?and?print?out?the?updated?attention?value?*/
????????????????fprintf(?stdout?“New?PQ?value:?%d\n“
?????????????????????????(int)TG_GetValue(connectionId?TG_DATA_POOR_SIGNAL)?);
????????????????fflush(?stdout?);

????????????}

????????????/*?If?attention?value?has?been?updated?by?TG_ReadPackets()...?*/
????????????if(?TG_GetValueStatus(connectionId?TG_DATA_MEDITATION)?!=?0?)?{

????????????????/*?Get?and?print?out?the?updated?attention?value?*/
????????????????fprintf(?stdout?“New?attention?value:?%d\n“
?????????????????????????(int)TG_GetValue(connectionId?TG_DATA_MEDITATION)?);
????????????????fflush(?stdout?);

????????????}?/*?end?“

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-08-07?09:48??thinkgear_testapp\
?????文件?????4625936??2013-06-01?13:26??thinkgear_testapp\dataLog.txt
?????目錄???????????0??2013-08-07?09:48??thinkgear_testapp\Debug\
?????文件???????????0??2013-01-12?09:16??thinkgear_testapp\Debug\dataLog.txt
?????文件???????24201??2013-01-12?09:16??thinkgear_testapp\Debug\streamLog.txt
?????文件??????557056??2010-06-29?12:42??thinkgear_testapp\Debug\thinkgear.dll
?????文件????????2576??2013-08-07?09:48??thinkgear_testapp\Debug\thinkgear_testapp.Build.CppClean.log
?????文件?????????478??2013-08-07?09:48??thinkgear_testapp\Debug\thinkgear_testapp.log
?????目錄???????????0??2013-08-07?09:47??thinkgear_testapp\ipch\
?????目錄???????????0??2013-08-07?09:47??thinkgear_testapp\ipch\thinkgear_testapp-e8d51887\
?????文件?????2031616??2013-08-07?09:47??thinkgear_testapp\ipch\thinkgear_testapp-e8d51887\thinkgear_testapp-9f109853.ipch
?????文件?????4917099??2013-06-01?13:26??thinkgear_testapp\streamLog.txt
?????文件??????557056??2010-06-29?12:42??thinkgear_testapp\thinkgear.dll
?????文件???????31198??2010-06-29?12:42??thinkgear_testapp\thinkgear.h
?????文件????????9262??2010-06-29?12:42??thinkgear_testapp\thinkgear.lib
?????文件????????3283??2013-06-01?13:23??thinkgear_testapp\thinkgear_testapp.c
?????文件????????4544??2013-01-11?10:25??thinkgear_testapp\thinkgear_testapp.dsp
?????文件?????????557??2013-01-11?09:26??thinkgear_testapp\thinkgear_testapp.dsw
?????文件???????41984??2013-01-14?16:00??thinkgear_testapp\thinkgear_testapp.ncb
?????文件???????55808??2013-01-14?16:00??thinkgear_testapp\thinkgear_testapp.opt
?????文件????????1371??2013-01-14?15:55??thinkgear_testapp\thinkgear_testapp.plg
?????文件?????1855488??2013-08-07?09:48??thinkgear_testapp\thinkgear_testapp.sdf
?????文件?????????900??2013-05-06?11:34??thinkgear_testapp\thinkgear_testapp.sln
?????文件???????13824??2013-08-07?09:48??thinkgear_testapp\thinkgear_testapp.suo
?????文件????????6352??2013-08-07?09:47??thinkgear_testapp\thinkgear_testapp.vcxproj
?????文件????????1108??2013-08-07?09:47??thinkgear_testapp\thinkgear_testapp.vcxproj.filters
?????文件?????????143??2013-01-15?14:33??thinkgear_testapp\thinkgear_testapp.vcxproj.user
?????文件????????2991??2013-01-12?09:16??thinkgear_testapp\thinkgear_testappmmmm.c

評(píng)論

共有 條評(píng)論