Exemplo n.º 1
0
void loop() {

	dataProvider->resetParse();

	while (!WalkeraSerial->available()); // Wait until Data comes in
	while (WalkeraSerial->available() > 0)
	{
		byte c = WalkeraSerial->read();
		dataProvider->parseMessage(c);
	}

	dataProvider->finishParse();

	processData();
	updateHeartbeat();
}
Exemplo n.º 2
0
void LightsController::loop(uint32_t now) {
	if (setuped) {
		if (lightsTimer.isDue_ms(LED_UPDATE_RATE, now)) {
			if (startup) {
				for (int i = 0;i<16;i++) {
					sn3218.set(i,0);
				}
				startup = false;
			}
			updateHeartbeat();
			updateBrokenLight();
			updateActuator();

			sn3218.update();
		}
	}
}
Exemplo n.º 3
0
void loop() {

#ifdef MAVLINKTELEMETRY
	if( dataProvider->enable_mav_request || (millis() - dataProvider->lastMAVBeat > 5000) )
	{
		if(millis() - rateRequestTimer > 2000)
		{
			for(int n = 0; n < 3; n++)
			{
#ifdef DEBUG
				debugSerial->println("Making rate request.");
#endif
				dataProvider->makeRateRequest();
				delay(50);
			}

			dataProvider->enable_mav_request = 0;
			dataProvider->waitingMAVBeats = 0;
			rateRequestTimer = millis();
		}

	}
#endif

	while (mavlinkSerial->available() > 0)
	{
		if (queue.count() < 128)
		{
			char c = mavlinkSerial->read();
			queue.enqueue(c);
		}
		else
		{
#ifdef DEBUG
			debugSerial->println("QUEUE IS FULL!");
#endif
		}
	}

	processData();
	updateHeartbeat();

	sendWalkeraData();
}
Exemplo n.º 4
0
void Device::update()
{
    updateHeartbeat();
    updateFault();
    updateState();
}