Exemplo n.º 1
0
void OmniRobot::gamepadButton(int button, int pressed)
{
    if (pressed == 0) return;

    switch (omniState)
    {
    case INIT_MODE:
        switch (button)
        {
        case 1: movementMode = ROTATE_MAX_MODE; break;
        case 2: movementMode = ROTATE_POINT_MODE; break;
        case 3: movementMode = ROTATE_MODE; break;
        case 5: movementMode = ANDROID_MODE; period = 10; break;
        }
        omniState = CONTROL_MODE;
        startControl();
        break;
    case CONTROL_MODE:
        qDebug() << "INIT_MODE";
        init();
        omniState = INIT_MODE;
        brick.stop();
        timer.stop();
        disconnect(&timer, SIGNAL(timeout()), this, SLOT(omniControl()));
        break;
    default:
        brick.stop();
        timer.stop();
        disconnect(&timer, SIGNAL(timeout()), this, SLOT(omniControl()));
    }

}
Exemplo n.º 2
0
void startMozzi(int control_rate_hz)
{
	setupMozziADC(); // you can use setupFastAnalogRead() with FASTER or FASTEST in setup() if desired (not for Teensy 3.1)
	// delay(200); // so AutoRange doesn't read 0 to start with
	startControl(control_rate_hz);
#if (AUDIO_MODE == STANDARD) || (AUDIO_MODE == STANDARD_PLUS)
	startAudioStandard();
#elif (AUDIO_MODE == HIFI)
	startAudioHiFi();
#endif
}
Exemplo n.º 3
0
void startMozzi(int control_rate_hz)
{
	setupMozziADC(); // you can use setupFastAnalogRead() with FASTER or FASTEST in setup() if desired (not for Teensy 3.1)
	// delay(200); // so AutoRange doesn't read 0 to start with
	startControl(control_rate_hz);
#if (AUDIO_MODE == STANDARD) || (AUDIO_MODE == STANDARD_PLUS) || IS_STM32()  // Sorry, this is really hacky. But on STM32 regular and HIFI audio modes are so similar to set up, that we do it all in one function.
	startAudioStandard();
#elif (AUDIO_MODE == HIFI)
	startAudioHiFi();
#endif
}