Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: pcinput.cpp
- Revision:
- 0:8c4ff7ea7eb9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcinput.cpp Mon Mar 01 18:52:33 2021 +0000 @@ -0,0 +1,21 @@ +// input s tikovnice +#include "pcinput.h" +Serial pc(USBTX, USBRX); // komunikacija s recunalom +void inicijalizacija(void) +{ + pc.printf("\n\r Unesi vrjednost:\n\r"); +} +char KeyInput(void) +{ + char c = pc.getc(); // dobivanje ulaza s tikovnice + int uvijet; + uvijet = c; + if (uvijet < 48 ){ + c = 48; + } + if (uvijet > 58){ + c = 58; + } + pc.printf("%c",c); // isprintaj na teraterm + return (c); // vrati vrijednost znaka +} \ No newline at end of file