Wednesday, January 21, 2015

Netduino Library and Samples for 1Sheeld

NOTE:  See the revisited post here for additional information and updates.

I received a Netduino Plus 2 as a gift a little while back. I have completed converting the 1Sheeld Arduino Libraries and Sample Sketches to C# so they can be used with my Netduinos (I now own a Netduino 3 Wifi as-well).

Please note: the projects / source were created with Visual Studio 2013 Professional, but are being maintained with Visual Studio 2015 Professional (Note: the free version of Visual Studio 2015 Community works fine and will load the solution, compile and run the samples without any problems).  The projects / source also expects a recent firmware on the Netduinos with the latest.NET Micro Framework, the VS 2015 Project System, and the latest Netduino SDK.

Recommendation: Since there are multiple projects that you can deploy in the OneSheeld solution, rather than setting a sample as a Startup Project, I highly recommend that you right-click on one of the sample solutions, select debug->Start new instance to upload to the Netduino and start a debugging session of whatever sample you want to play with.

All Shields and the SDK supported by the Arduino 1Sheeld v1.13 library are now supported by the Netduino library.

If  you are interested in playing with the Netduino Libraries and Samples, you can find the most recent updates here

You can also follow along with the discussions and updates on the 1Sheeld Forums here. (you will need to be a member and logged in to get the full benefit).

I just leave the 1Sheeld at 3.3v and the other switch set to UART (you do NOT need to change the switch to upload to the Netduino Plus 2 & Netduino 3 Wifi ... not sure about other Netduinos).   


01-22-2015 (1) - Added Buzzer and Camera Shields. Note: Difference with Arduino Samples ... pin 11 is used for the Button (Arduino Samples use pin 12) ... pin 12 always seems to start high on my Netduino ... not sure why really ... but pin 11 is low, so it does seem to be a Netduino hardware feature. And when using a button from the 1Sheeld, until you specify the pin for the button, it will stay high (since technically there isn't a button hooked up to the pin). Had some issues when I re-connected the the 1Sheeld app with a PushButton and Camera already defined, it would start taking pictures until I setup the pin 12 on the pushbutton ... not exactly what we want ... I guess I could have setup a hardware button rather than using the 1Sheeld PushButton ... but what's the fun in that????

01-22-2015 (2) - Added Twitter Shield. Note: Camera sample now sends picture as Tweet (like Arduino sample does). Again, used pin 11 instead of 12 for button.

01-22-2015 (3) - Added Accelerometer Sensor Shield. Note: Sample only expects 1 Axis to be > 8 (Arduino seems to want all 3 ... although just the Z-Axis > 8 might turn on the LED on the Arduino, just because of hardware performance).

01-22-2015 (4) - Added SevenSegment Shield. Note: setDot() function doesn't work, but according to the 1Sheeld docs, it's for future use.

01-23-2015 (1) - Added LCD and Magnetometer Shields.  LCD sample included and Magnetometer sample uses LCD too (Arduino sample uses hardware LCD shield ... why???).

01-23-2015 (2) - Added Facebook Shield (with sample).

01-24-2015 (1) - Added Gravity Sensor and Gyroscope Sensor Shields support, both have samples which are slightly different than the Arduino versions.  Just a single led is used to show when one of the 3 axis values go large enough to illuminate the led, Also, realized that I did have access to a Sqrt function directly from .NET so the MagnetometerShield class now calls it, rather than providing its own.

01-24-2015 (2) - Added Temperature Sensor Shield support with Sample.  Note: I have NO WAY to test this.  I think it will work. For those that can use it: if it doesn't work, please let me know.

01-25-2015 (1) - Added Light Sensor Shield support with Sample.  Note: The callback interface names have changed a bit recently ... Instead of using a Shield Name within the Interface Name (like IToggleButtonCallback), I am now using names based on data type (IByteCallback, or IBoolCallback ... these can be used across Shield implementations ... one exception is the ITwitterCallback which is pretty unique and that callback interface is still present) ... I would recommend just deleting and re-installing the whole OneSheeld Library/Sample directory structure.  If you have also started coding and you have used one of the old callback interface names, the only change you should have to make is the name of the interface that your class derives from.

01-25-2015 (2) - Added Proximity Sensor Shield support with Sample.

01-26-2015 (1) - Added Terminal Shield support with Sample.  Also fixed a problem with PushButton and ToggleButton (when I moved to a base class for these shields, I missed initializing the Shield Function Id variable in the constructor.   So, if you are having problems with either of these shields ... UPDATE, they should work again.  I do need to do some additional testing for the terminal shield.  But, the sample definitely works (a bit different from the Arduino sample ... I didn't want to hook up a fan and I have no way to use a temperature sensor shield, so the Netduino sample just sends a message to the Terminal Shield when a ToggleButton Shield button is on (it also turns on an Led connected to pin 13).

01-26-2015 (2) - Added Orientation Sensor, Pressure Sensor and SMS Shield support with Samples. Again, since I don't have a temperature sensor compatible device that I can use for testing, the SMS sample just uses a simple PUSHBUTTON to send a text.  The Pressure sample uses SMS too.  Don't forget to change the phone # for sending the message(s) in the samples.

01-27-2015 (1) - Added Slider Shield support with sample.  Also, changed ALL samples using callbacks. You should see far better performance now.  Moving the actual processing back to the Loop() and just capturing the value in the callback is a better way to handle things.  Otherwise you are reliant on the speed at which the Library has time to process the callback.  Just capturing the value(s) sent by the callback, then using it in the main process Loop will give you far better performance (and control).  When I was testing the Slider sample, it became very evident that there was a performance issue.   The Slider sample is different from the Arduino sample.  I use a Buzzer and a Slider Shield.  As the slider is moved up, the speed of the buzzer going on and off will increase (the length of the on/off times will decrease), and in-turn when the slider is moved down, the speed of the buzzer going on and off will decrease (the length of the on/off times will increase).

01-27-2015 (2) - Added Clock, TTS and VoiceRecognition Shield support with Samples.  Note:  The TTS sample is also the VoiceRecognition sample for now.  Also:  The Clock Shield on the Netduino cannot be initialized (using begin()) in Setup since the reset of the Netduino also resets the 1Sheeld (and the clock never gets initialized).  I have added a new function to the Netduino Clock Shield called isInitialized.  In the sample Loop function, I check to see if the clock hasn't been initialized, if it hasn't, I call begin() there instead ... this will initialize the clock and future reads will return data.  The Clock sample is different from the Arduino sample, I just use a Terminal Shield to send the current time to the Terminal every 2 seconds.  Finally, the main section of the posting now shows those shields NOT supported, this list will shrink as time progresses.

01-27-2015 (3) - Added DataLogger Shield support with Sample.

01-27-2015 (4) - Added Email Shield support with Sample.

01-27-2015 (5) - Added Foursquare Shield support with Sample.

01-27-2015 (6) - Added GamePad Shield support with Sample.  Again, sample is different from Arduino.  I'm more interested in things working (and being able to see things working than getting too fancy right now).  So, the sample just sends a text message to terminal when buttons are pressed.  Also, I think there is a problem with how the Arduino callback support is implemented for the GamePad shield (will be reporting  my assessment to guys at OneSheeld).

01-28-2015 (1) - All remaining Shields are now Supported (GPS, KEYBOARD, MUSICPLAYER, NOTIFICATION, PHONE, REMOTE and SKYPE) ... with samples.   I also created a VOICERECOGNITION sample.   Please NOTE:  I have no idea if Remote Shields work (I only have a single 1Sheeld ... it won't be because there's no code, it will be because I messed up).  Please let me know if you find any problems.

01-28-2015 (2) - Just uploaded a new version.  I upgraded to the Non-Beta (QFE R2) version of the .NET Micro Framework that was just released.   Just in-case something changed project wise, etc, just wanted to make sure the latest was available for download.   No other changes.

01-29-2015 - A very minor change to the Clock Shield ... it wouldn't make any difference in the actual functionality.  But it might save some clock cycles (but nothing you would probably notice) ... lol ... a change to the Clock Shield that saves clock cycles.  I crack myself up.

02-13-2015 - Moved Library and Sample Downloads from Google Drive to Github.

03-09-2015 - Added support for v1.4 app with currently supported Shields.   Updated Github.

03-10-2015 - Added support for v1.4 Pattern Shield with Sample ... Internet Shield is next.  Updated Github.

03-16-2015 - Added support for v1.4 Internet Shield with (2) Samples.  Also added instance and callback support similar to Arduino libraries.   Github has been updated.

03-18-2015 -  Upgraded Github with Usability updates.   See new post for an explanation.

05-06-2015 - Upgraded Library and Samples to v1.5.  NFC and Color Detector Shields are now supported (samples included for each).  Remote Shield support has been removed.  Clock Shield has been updated.   Everything is checked in to Github.

05-08-2015 - Made some modifications to ColorShield memory handling and also added ISelectionCallback support to the SampleCOLOR sample (both non-callback and callback versions). There is also a public setColor method that has been added to ColorClass (which is used within the ColorShield for improved memory handling).

05-09-2015 - Changed supported Netduino SDK version to v4.3.2.1.

06-25-2015 - Improved Serial Port handling (now uses multi-byte reads) ... also tweaked a couple of the Samples.   Everything is checked in to Github.

08-10-2015 - Noted support for Visual Studio 2015 Community.

08-18-2015 - Upgraded Library and Samples to v1.6.  GLCD Shield is now supported (samples included).  Everything is checked into Github.

09-20-2015 - Upgraded Library to 1.6.1.  Everything is checked into Github.

11-24-2015 - Upgraded Library to 1.7.  Everything is checked into Github.

01-26-2016 - Upgraded Library to 1.8.  Everything is checked into Github.

04-22-2016 - Upgraded Library to 1.9.  Everything is Checked into Github.

05-24-2016 - Upgraded Library to 1.9.2 (I never did a 1.9.1 upgrade).  Everything is Checked into Github

11-30-2016 - Upgraded Library to 1.10.0.  (This includes the newest Barcode Scanner Shield). Everything is Checked into Github.

01-05-2017 - Upgraded Library to 1.11.0 (This includes the new Face Detection and Fingerprint Scanner Shields).  Everything is Checked into Gibhub.

02-17-2017 - Upgraded Library to 1.12.0 (This includes the new Chart Shield).  Everything is checked into Github.

06-21-2017 - Upgraded Library to 1.13.0 (This includes the new IOT Shield).  Everything is checked into Github.

No comments:

Post a Comment