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.

Asymptot

Member Since 21 Sep 2010
Offline Last Active Sep 01 2012 07:00 PM
-----

Topics I've Started

Black line path

31 August 2012 - 12:31 PM

Hi, I am currently building a line-follower. The robot passed the nominal tests on a small black line drawn on a sheet of paper (can detect the line correctly, and switch wheels speeds accordingly). Now i would like to try a field test. What would be the best way to have a black path on a white floor? Black line drawn on white paper? Black line drawn on foldable laminated poster board? Black adhesive band on paper? Is there any "ready to print" paths somewhere? Sorry if the question is a bit out of topic. But if the line follower works, it'll pay off, and I'll have something to show in the "Project showcase" section. Thank you for your answers, Farouk

Issue with DFRobot MotorShield 1A

16 August 2012 - 02:18 PM

Hello,

I currently have this strange problem when I try to use the DFRobot MotorShield 1A (http://www.dfrobot.c...or_Shield_(L293)_(SKU:_DRI0001)) with my Netduino, still using the 4.1 firmware and framework :

When I use a dummy code like this :

while (true)
{

}

Both motors run (and if i don't plug any motor, the motor LEDs indicating motor activity are lit)
Nevertheless when i set the different PINs for more control, like this :

            PWM E1 = new PWM(Pins.GPIO_PIN_D5);
            OutputPort M1 = new OutputPort(Pins.GPIO_PIN_D4, true);

            PWM E2 = new PWM(Pins.GPIO_PIN_D6);
            OutputPort M2 = new OutputPort(Pins.GPIO_PIN_D7, true);
            
            E1.SetDutyCycle(50);
            E1.SetDutyCycle(50);

Then, both motors run during the boot/loading phase, and then stop.
It seems to me that for some reason, bothmotors run by default, and trying to set PWM on them turn them off...
I have no idea why this is happenning.

Does anyone has an idea of why this is happenning?

Generic line detector class

25 July 2012 - 04:58 PM

Hello,

while working on my line follower robot project, I had to make a class for reading the sensors of my line detector.
The idea is to read all sensors and send a grouped message to the main program in the form of an int.
I thought I'd make it as generic as possible for any sensor array that would use one digital input per sensor.


Here is the code :

/// <summary>
    /// This class represents the reflectance array - or line detector.
    /// I made it with the Parallax 8-reflectance sensors array in mind, but I'm trying to make it
    /// as generic as possible.
    /// </summary>
    class CLineDetector
    {
        private InputPort[] sensorArray;
        /// <summary>
        /// Represents the arrays of inputs used in the Netduino for the sensor array
        /// </summary>
        public InputPort[] SensorArray
        {
            get 
            {
                return sensorArray;
            }
            set 
            {
                value = sensorArray;
            }
        }

        private int arrayLength;
        /// <summary>
        /// Represents the numbers of sensors in the Line detector.
        /// </summary>
        public int ArrayLength
        {
            get 
            {
                return arrayLength;
            }
            set 
            {
                value = arrayLength;
            }
        }


        public CLineDetector()
        {

        }

        public CLineDetector(InputPort[] sensorarray)
        {
            sensorArray = sensorarray;
        }

        /// <summary>
        /// Reads all sensors and returns their grouped readings.
        /// </summary>
        /// <returns>A reading of the whole array</returns>
        public int ReadAll()
        {
            int iRes = 0;
            int iCount, iReading;
            

            //Reads all the sensors and put them all in a single int

            for (iCount = 0; iCount < sensorArray.Length; iCount++)
            {
                iReading = sensorArray[iCount].Read() ? 1 : 0;
                iRes += iReading << iCount;
            }
            // Put them in form

            return iRes;
        }
    }

I'm posting it for critics as to the generic-ness of the class, and also for two specific questions :

- It seems to me the SensorArray member really doesn't need to be public, since the rest of the program will only need to know the end result and the number of sensors. What do you think?
- The time factor, I didn't use any "sleep" in my "ReadAll" method, thinking it's more the main program's job. Am I right?

Thanks you for comments and critics :-).

Parallax Infrared Line Follower and Netduino

20 February 2012 - 04:09 PM

Hello, in my line-follower project, I'm thinking about using the Parallax Infrared Line Follower here : http://www.robotshop...-236&lang=en-US It seems more practical to mount on my robot than my current system based on four separated reflectance sensors (that i have to mount one by one on the robot, as opposed to this kit where i won't have to use space and cables to have all sensors using the same vcc and ground). I read the specs and see no reason why this kit wouldn't be compatible with the Netduino, but I may be wrong, so, i'm wondering if any of you guys tried it before and if you had trouble? Or if you read something in the specs that i forgot to take into account? EDIT : i had the answer to my question in the chat. Seems like it will work. I will buy it, and will let you know about my line following progress. Thanks, Asymptot

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.