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: USB/usb.cpp
- Revision:
- 0:77dba5d612e5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/USB/usb.cpp Thu Apr 08 16:32:55 2021 +0000
@@ -0,0 +1,19 @@
+#include "usb.h"
+
+Serial PC(USBTX, USBRX, 9600);
+
+void Start(void){
+ PC.printf("\n\r Unos vrijednosti u rasponu 0 - 9:\n\r");
+ }
+
+float Unos(void){
+ char podatak = PC.getc();
+ PC.printf("%c\n\r", podatak);
+ int a;
+ float b;
+ a = podatak;
+ if ((a <= 57)&&(a >= 48 )){
+ b = (a - 48)/10.0;
+ }
+ return (b);
+}
\ No newline at end of file