示例#1
0
char
getNextChar(int16_t fd, char **pBufferPtr)
{
char nextChar = 0;
char *buffPtr = *pBufferPtr;

	if( fd != 0 ) 
	{
		nextChar = readSerialPort(fd);  // need to make polling/non-block
	}
	else
	{
		nextChar = *buffPtr++;
		*pBufferPtr = buffPtr;
	}
	
	return( nextChar);
	
}  //  end - getNextChar() 
示例#2
0
BuzzerModule::BuzzerModule() {
    setTitle("Buzzer");
    setControlWidget(new BuzzerControl);
    setLiveWidget(new BuzzerLive);
    BaseControl *control = getControlWidget();
    BaseLive *live = getLiveWidget();

    serial = new QSerialPort();
    teamLocked = false;

    connect(control, SIGNAL(sendTeamWin(QString)), live, SLOT(teamWin(QString)));
    connect(control, SIGNAL(openSerialPort(QString&)), this, SLOT(openSerialPort(QString&)));
    connect(control, SIGNAL(closeSerialPort()), this, SLOT(closeSerialPort()));
    connect(this, SIGNAL(teamWin(int)), control, SLOT(teamWin(int)));
    connect(serial, SIGNAL(readyRead()), this, SLOT(readSerialPort()));
    connect(live, SIGNAL(unlockTeam()), this, SLOT(unlockTeam()));
    connect(control, SIGNAL(setVideo(QString)), live, SLOT(setVideo(QString)));
    connect(control, SIGNAL(setVideoPlaying(bool)), live, SLOT(setVideoPlaying(bool)));
    connect(control, SIGNAL(toggleVideoPlaying()), live, SLOT(toggleVideoPlaying()));
    connect(live, SIGNAL(videoPlaying(bool)), control, SLOT(videoPlaying(bool)));
    connect(live, SIGNAL(videoFinished()), control, SLOT(videoFinished()));
}
示例#3
0
int main() {
	openSerialPort();
	setupPWM();
	readSerialPort();
	return 0;
}