Denwis La / Mbed OS mDot_Send_Data

Dependencies:   libmDot-dev-mbed5-deprecated ISL29011

Fork of mdot-examples by 3mdeb

Revision:
7:5f2b3d1a9b0b
Parent:
6:3b41238872a8
Child:
8:efab0e415826
--- a/peer_to_peer_example.cpp	Fri Dec 01 21:03:18 2017 +0000
+++ b/peer_to_peer_example.cpp	Fri Dec 01 21:08:13 2017 +0000
@@ -375,20 +375,20 @@
                 break;
             case 57:    // 9
                 int intRegister;
-                char input[2];
+                char input[4];
                 char passRegister[1];
                 int intData;
                 char passData[1];
                 pc.printf("What register do you want(2 digit hex form)? \n\r"
                          "Ex: Register 0x01 enter 01\n\r");
-                pc.gets(input,1);
+                pc.scanf("%s\n\r", input);
                 intRegister = atoi(input);  
                 itoa(intRegister, passRegister, 16);    // Convert number(input), into hexadecimal(16), and save in char buffer(passVariable)
                 passRegister[0] = atoi(passRegister);
                 pc.printf("0x%x register\n\r", passRegister[0]);
                 
                 pc.printf("What is the hex representation of your data?\n\r");
-                pc.gets(input,1);
+                pc.scanf("%s\n\r", input);
                 intData = atoi(input);  // Convert input to integer
                 itoa(intRegister, passData, 16);  //Convert number(input), into hexadecimal(16), and save in char buffer(passVariable)
                 passData[0] = atoi(passData);