virtual shields library support

Status
Not open for further replies.

tonton81

Well-known member
I'm interested to use a phone/tablet's sensors on a teensy and posted an issue regarding the library not compiling with teensy but does on a mega260/uno

without hesitating to close the issue bluntly, a response was as follows

question:
i can compile it fine with mega2560 but it wont compile on my teensy 3.2 or 3.5 which uses arduino IDE 1.8
with teensyduino 1.34 support.

answer:
Hi Tonton81,
That is correct Virtual shields is for Arduino and is not expected to support Teensy. As stated on their site they expect many libraries to work but not all. See https://www.pjrc.com/teensy/td_libs.html
Sincerely,
IoTGirl
 
I'm interested to use a phone/tablet's sensors on a teensy and posted an issue regarding the library not compiling with teensy but does on a mega260/uno

without hesitating to close the issue bluntly, a response was as follows

question:
i can compile it fine with mega2560 but it wont compile on my teensy 3.2 or 3.5 which uses arduino IDE 1.8
with teensyduino 1.34 support.

answer:
Hi Tonton81,
That is correct Virtual shields is for Arduino and is not expected to support Teensy. As stated on their site they expect many libraries to work but not all. See https://www.pjrc.com/teensy/td_libs.html
Sincerely,
IoTGirl

Well, maybe, IoTGirl does not know what a Teensy is or that it IS Arduino.
I quick look at the site https://github.com/ms-iot/virtual-shields-arduino shows, that it connects through a BlueSMiRF Bluetooth module - so it should be easy to make it work (simple serial connection).

I don't own a Microsoft phone, and I don't want to buy one - so, maybe, someone else wants take a closer look..
 
Last edited:
it isnt for just a phone, it's for anything that runs windows 10, like my surface book for example. there are many "virtual shields" which are basically reading the sensors, users logged in, apps running etc to the mcu from the OS
 
"It seems that they may be a clone but are very honest that this is a different platform and that they don't support all Arduino capabilities. See the differences section on their site https://www.pjrc.com/teensy/teensyduino.html"

teensy is a different platform and a clone of arduino? Ouch for a response like that :p
 
Looks like it might just need a couple checks for Teensy near the top of VirtualSerial.cpp. Seems the code is already there to use Serial1 instead of Serial.

And yeah, kind of a poor attitude, especially from a project the has structured its code to require adding these minor hardware difference ifdefs.
 
Ok, I might have a fix for you. This at least gets it to compile and looks like it ought to work. I don't have any Windows phone for testing, so please let me know if this really works? If so, I'll send the VirtualShield.cpp changes to them as a pull request. I've already merged the other 2 files into Teensyduino, so they'll be in future versions.

This uses Serial1 (pins 0 and 1) for the bluetooth module, so follow the same instructions for connection as Arduino Uno.

To use this, put WString.h into hardware/teensy/avr/cores/teensy3, put pgmspace.h into hardware/teensy/avr/cores/teensy3/avr, and put VirtualShield.cpp into your copy of this library.
 

Attachments

  • pgmspace.h
    5.1 KB · Views: 93
  • VirtualShield.cpp
    22.8 KB · Views: 177
  • WString.h
    9.4 KB · Views: 151
i couldnt find my bt board so i ordered 2 adafruit ble breakouts just gotta wait for them, compile works tho
 
i would presume the adafruit spi ble code adds a Serialx instance which i can edit in virtualshields to match. if this isnt possible then i will order the non spi version as well, however i heard that the spi version is way faster with less errors than a regular uart
 
Last edited:
I'm very skeptical this library will work with any hardware other than the Sparkfun BlueSMiRF Silver it was designed to use. You're taking quite a chance with that Adafruit product. Well, I guess about a $20 chance at least. If you haven't placed the order yet, or even if you have, I'd really recommend getting the proper Sparkfun product this library is meant to use.

I didn't write this library, but I did study its code quite a bit to come up with the fixes I posted in msg #7. It has a lot of very specific serial protocol design, which won't ever work with SPI, and probably does depend in subtle ways on specifics of the BlueSMiRF Silver.
 
I didn't finish writing my thought ... Adafruit did a lot and included their own apps - but :: they don't support the Windows interface like SparkFun.

Though I did follow a link to a hackster.io site and the comments started 2 years back. One way down only 10 months old did suggest that somebody could edit the Bluetooth calls to BLE calls for another DFRobot BLE board though. Not sure if that is really all that is involved - versus what Paul saw in the code.

It was this link from SparkFun >> Basic Windows Remote Arduino

<edit> : fixed link - it was doubleentereddoubleentered. Yes that referred to fermata - so not the Win IOT Paul looked at.
 
Last edited:
thats nice robotshop said they had stock online then emailed me saying two week backorder "maybe", ill goto a local shop tomorrow if i dont have time today to see if they have it, by the tine i get one ill have a variety of btle modules thrown in the closet lol
 
link was dead but the remote arduino needs the firmata installed to control arduino, whereas virtual shields is able to use lumia/surface book, or any win10 device localization and desktop events, itll be useful to me anyways since my tablet is carpc with T3.5 connected 24/7 and virtual shields is able to use cortana as well with arduino... kinda sucks i cant use the usb because their windows app doesnt support usb, otherwise id have no use for BT (as of yet).
 
Last edited:
Status
Not open for further replies.
Back
Top