Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

vission

Member Since 07 May 2011
Offline Last Active Feb 16 2014 03:44 AM
-----

Topics I've Started

Simple Storage

20 November 2013 - 02:59 AM

Was Simple Storage ever implemented for v4.2 on Netduino Plus v1? Are there any examples of it's use? I've not seen any mention of it since 2012 and I could use some basic storage capabilities without having to resort to SD Card.

 

Thanx.


Adafruit Motor Shield V2 - Netduino Plus Driver

13 November 2013 - 07:09 PM

Hi there!

 

I'm taking an non-working Sony 400Disc DVD Changer(ebay) and turning it into a 400Disc BluRay changer for use with Windows Media Center via webservices.  I thought this might be a great project to actually use my Netduino Plus for!  There are 3 DC motors(non-stepper) used to handle the various mechanics and a multitude of optical sensors.  Well I needed to be able to drive those motors so I picked up the Adafruit Motor Shield V2.  Come to find out there is little support for this shield on the Netduino Plus(that I could find) but Adafruit had schematics and source code(C++).  So after many days trying to translate the code I finally got it to work and can now drive each motor/direction/speed.  I wanted to share my code since this forum and the Adafruit information was very helpful to me.  Also, I try to write as concise code as possible but if anyone has any suggestions for optimization I'd be happy to hear it.  Enjoy!

 

Attached is the class for driving the shield. Below is sample code to use it:

(be sure to update your namespace as necessary.

 

namespace I2C_Motors
{
    public class Program
    {
 
 
        public static void Main()
        {
            MotorShieldV2 myMotor = new MotorShieldV2();
            myMotor.startUp(1600);  //1600 is the frequency used
 
            //Run Motor 1 & 3 at the same time
            myMotor.runMotor(1, 150, true);  //Motor #1-4, Speed (0 - 255), Direction (true/false)
            myMotor.runMotor(3, 150, true);
 
            Thread.Sleep(2000);
 
            //Stop Motor 1& 3 at the same time
            myMotor.runMotor(1, 0, true);
            myMotor.runMotor(3, 0, true);
 
            //Cleanup
            myMotor.Dispose();
        }
    }
}

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.