Saturday, January 31, 2015

MakerShield Kit, why another Prototyping Shield?

Even though I do have an Adafruit Proto Shield, which works well and I've had no problems what-so-ever with it, I decided to pick up one of the MakerShield Kits for a number of reasons.

  • Yes, It has a Potentiometer on the board ... but that wasn't the primary reason.
  • The Shield Headers allow you to attach shields ON TOP ... BIG reason #1 
  • The ICSP Headers are in the correct place for Arduino Shields ... BIG reason #2

So, why is this important if you are going to use it as a Prototyping shield, you want it to be the one on top, so you can access everything... right?   Well... yes, typically.  But here are the benefits to me...

  1. I have a pcDuino with a T Board to bridge 5V Arduino shields (the pcDuino only wants 3.3V shields used, the T Board allows 5V shields without damaging the pcDuino).  It has ICSP headers, but they aren't in the standard location for Arduino shields.  The MakerShield fixes that, I can attach this to the T Board and then attach a shield that has the ICSP connection, and I'm good-to-go.
  2. I also have an Arduino UNO clone from doflye.net (Chinese).  Bought it for about $4.00 on eBay.  After replacing the chip with the correct one for UNO (instead of the one that was included with it ,.. another $2.00 expense), I found that the ICSP headers on this board were rotated 180%!!!! (i.e not compatible with standard Arduino shields at all), and it's offset just a tad from the Standard Arduino.position too.   The MakerShield fixes that too.  I can now just attach the MakerShield to the clone, then attach a shield that has an ICSP connection, and, again, good-to-go.   I tried it with my USB Host Shield and it worked like a charm.
To me, the MakerShield is a benefit in a couple of ways ... plus it's a nice Prototyping shield too ... it works for my Arduino (including fixing a problem with a clone I purchased), pcDuino (fixing the ICSP header location on the T-Board) and my Netduino too (it doesn't even have ICSP headers ... this Shield is the recommended way to resolve that too!).

Keep in mind, that it does come as a kit, you need to dig out the tools and soldering iron to put it together.  But once you do, I think you'll find it's a nice addition.

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).   

Updates

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.

Saturday, January 17, 2015

SolidDigi Color Image Shield Revisited

As previously mentioned, the SolidDigi Color Image Shield is very similar to the (now retired) SparkFun Color LCD Shield, but does have some differences. I had converted some of the code found around the internet that was available for the SparkFun shield so it would work on the SolidDigi shield. Now, I've decided to take a lot of that same code and make it work on the pcDuino. So, if you have a pcDuino, this shield will now have some sample code that works on the pcDuino.

Below is a list of what has (and has not been converted) of those mentioned in a previous post:

  • The Color LCD Shield Library - converted and working.
  • The Arduino-O-scope - converted and working,
  • The SparkFun Sample - not converted (although I did move over the Mandelbrot and RGB Image code to the SolidDigi Sample (just run the SOLID application and press the 1st and 3rd buttons simultaneously to see the demo(s) work).
  • The SolidDigi Sample (with color tweaks) - converted and working.

You can find the code here.    Just unzip the two directories (Solid and ColorLCDShield) into the c_environment directory.  Change to the directories and run a make clean followed by a make to rebuild everything.   The samples will a end up, ready to run in the directories' sample/bin directory.  Don't forget you have to run with a ./ preceeding the sample name if the directory isn't part of the path.  So, for example, you would run the SOLID sample by typing ./SOLID and pressing enter (while being in the ~/c_enviroment/Solid/sample/bin directory).

A couple of notes:

- This isn't the fastest running code in the world (for example, the clock sample included with the Color LCD Shield library...I had to add 2 seconds to every update for the clock to keep up (and it actually does pretty well accuracy wise ... no promises on absolute accuracy though ... consider it just a sample for the shield, not necessarily an accurate clock!).

- The main problem with speed is that I haven't found a way (yet) to have direct access to the GPIO pins (I do use the file writing method ... which works, but not nearly as zippy as a memory mapped technique, etc).

If anyone knows about a faster method of setting pin modes and performing digital writes on a pcDuino, I'd love to hear about it.   Something similar to the PORTB/DDRB abilities on an Arduino.

For now, these samples do work.   I'm using the Translatiion T Board with this shield.  Not so much that I need to ... but, I'm just not 100% convinced I don't need to.   Even with 3.3V shields, they work just fine with the T Board.  I'd rather be safe than sorry.

Updates

02-16-2015 - Libraries and Sketches moved to Github.