The default number of decimal places for the example named Basic-GPS for the Microsoft Arduino Virtual Shield is 2 decimal places. This means that the accuracy of the GPS position is not accurate by 500m to 700m from the right location.
The gps.Latitude and gps.Longitude value can be made more accurate by appending the number of desired decimal places as shown in the figure below. What changed from the original code is
String lat = String(“Lat: “) + String(gps.Latitude);
String lon = String(“Lon: “) + String(gps.Longitude);
String lat = String(“Lat: “) + String(gps.Latitude,6);
String lon = String(“Lon: “) + String(gps.Longitude,6);
The rest of the code are similar to the example, except I use serial.begin(9600) to match with my HC-06 bluetooth baud rate.
On the next journey of tinkering with Windows Virtual Shield, I combined the use of ping sensor to measure distance and attempted to display the distance using Lumia 430 (Windows Virtual Shield).
Example codes that got ‘Frankensteined’ in this work are from the Ping Example and Windows Virtual Shield Example. Have a look below and see if you can replicate the same thing.
I have been attempting to run Hello World code using my Windows 10 Phone (Lumia 430, price RM 179) since 4 days ago to no avail. After a while, I have managed to run a successful example from this video:
Some of the lessons learned:
Problem: The Windows Virtual Shield app downloaded via Windows Store freeze once the phone and bluetooth connected.
Solution: See link Download Visual Studio 2015, download the source code of Windows Virtual Shield and deploy the codes to the phone via Visual Studio 2015.
Problem: Screen remain blank after device connected within Windows Virtual Shield.
Solution: Use the Arduino code below. I’m suspecting that the function ‘refresh’ will help to re-render the screen hence show the Hello World text on the phone.
Problem: No data received / shown
Solution: Make sure the baud rate matched with the bluetooth specification. I’m using JY-MCU BT_BOARD V1.03. Its baud rate is 9600.