TVZ2020 / Mbed OS Konstrukcijski_Husnik
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