uint8_t UNIT_PmodHB5SetDCPWMDutCycle(UART_MODULE uartID)
{
	uint8_t dutyCycle = 0;
	PmodHB5SetDCPWMDutyCycle(dutyCycle,hBridge.ocChannel)	;
	UARTPutS("\n\rEXECUTING TEST =>UNIT_PmodHB5SetDCPWMDutyCycle\r\n",uartID);
	do
	{
		UARTPutS("Enter a duty cycle percentage between 0 and 100 =>",uartID);
		dutyCycle = getIntegerFromConsole(uartID);
		if(dutyCycle > 100)
		{
			UARTPutS("Invalid Entry\r\n",uartID);
		}
	}while(dutyCycle > 100);
	PORTSetBits(IOPORT_D,BIT_7); //set direction forward

	PmodHB5SetDCPWMDutyCycle(PR2 * dutyCycle/100,hBridge.ocChannel);
	if(OC2RS == PR2 * dutyCycle/100)
	{ 
		return 1;
	}
	else
	{
		return 0;
	}

}
Beispiel #2
0
int menuShowCalendar()
{
    cout << "Menu - wyswietl kalendarz" << endl;
    cout << "1. Wyswietl aktualny miesiac" << endl;
    cout << "2. Wyswietl konkretny miesiac" << endl;
    cout << "3. Cofnij" << endl << endl;
    cout << "$: ";

    int choice = getIntegerFromConsole();
    return choice;
}
Beispiel #3
0
int menuAddEvent()
{
    cout << "Menu - dodaj zdarzenie" << endl<< endl;
    cout << "1. Spotkanie" << endl;
    cout << "2. Zadanie" << endl;
    cout << "3. Notatka" << endl;
    cout << "4. Cofnij" << endl << endl;
    cout << "$: ";

    int choice = getIntegerFromConsole();
    return choice;
}
Beispiel #4
0
int menuShowEvents()
{
    cout << "Menu - wyswietl zdarzenia" << endl<< endl;
    cout << "1. Wyswietl najblizsze" << endl;
    cout << "2. Wyswietl z danego miesiaca" << endl;
    cout << "3. Wyswietl wszystkie twoje zdarzenia" << endl;
    cout << "4. Cofnij" << endl << endl;
    cout << "$: ";

    int choice = getIntegerFromConsole();
    return choice;
}
Beispiel #5
0
int menuLogged()
{
    cout << "Menu" << endl;
    cout << "1. Wyswietl kalendarz" << endl;
    cout << "2. Wyswietl zdarzenia" << endl;
    cout << "3. Dodaj zdarzenie" << endl;
    cout << "4. Wyloguj sie" << endl << endl;
    cout << "$: ";

    int choice = getIntegerFromConsole();
    return choice;

}
Beispiel #6
0
//menu przy pierwszym uruchomieniu programu ( dla niezalogowanego usera )
int mainMenu()
{
    clearScreen();


    cout << "Aplikacja Task Manager v1.0" << endl << endl;
    cout << "Menu" << endl;
    cout << "1. Zaloguj sie" << endl;
    cout << "2. Zaloz konto" << endl;
    cout << "3. Usun uzytkownika" << endl;
    cout << "4. Wyjdz" << endl << endl;
    cout << "$: ";

    int choice = getIntegerFromConsole();
    return choice;

}