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.

bill.french's Content

There have been 260 items by bill.french (Search limited from 05-July 23)


By content type

See this member's


Sort by                Order  

#7216 Use of Static Keyword

Posted by bill.french on 07 January 2011 - 03:53 PM in General Discussion

"static" functions are mostly meant for "helper" functions and functions without side effects.
...
This is *the* .NET way

What are you basing these statements off of? The first doesn't sound quite right to me, but I really don't know and really would like to learn the right (.net) way.



#8171 Coding style discussion

Posted by bill.french on 23 January 2011 - 02:44 PM in General Discussion

Edit: Actually there is one other thing, what is DDD?: this http://www.gnu.org/software/ddd/?


my guess was this: http://en.wikipedia....n-driven_design

... i've added it to my extensive list of things to read about.



#8643 Coding style discussion

Posted by bill.french on 28 January 2011 - 11:39 PM in General Discussion

i vote Chris Walker deletes all posts in this thread (including this one) that do not contribute to (or at least encourage) the achievement of safe netmf quardoflight.



#8321 2 arcane feature requests: dotfuscator and the extension method attribute

Posted by bill.french on 24 January 2011 - 07:24 PM in General Discussion

Disclaimer: I work for PreEmptive Solutiuons (the makers of Dotfuscator)

I have to know: how did you find this thread??



#4080 We have a little Netduino surprise to share...

Posted by bill.french on 21 October 2010 - 11:44 PM in General Discussion

F5 F5 F5 F5 ... GRRR!



#8919 4Display Shields - Drivers

Posted by bill.french on 02 February 2011 - 11:26 PM in Project Showcase

Quiche31, is that "command complete" for SGC? Either way, awesome, the color constants alone are great!



#8890 4Display Shields - Drivers

Posted by bill.french on 02 February 2011 - 04:38 PM in Project Showcase

Hey, Omar, here's my uLCD-144 class, I haven't spent much time to round it out but it might have something useful for you. It still has a bunch of debug.print stuff. Also some links to my other threads in case it helps someone:
http://forums.netdui...ch__1#entry7992
http://forums.netdui...ch__1#entry7521


using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using System.IO.Ports;

namespace uLCD_144_Test1
{

    class uLCD_144
    {
        private byte currentline;
        public static byte[] GetByteArray(string s)
        {
            return System.Text.Encoding.UTF8.GetBytes(s);
        }
        public SerialPort _COMPORT;
        public void TextHome()
        {
            currentline = 0;
        }
        public void init()
        {
            using (OutputPort d4 = new OutputPort(Pins.GPIO_PIN_A5, true))
            {
                d4.Write(false);
                d4.Write(true);
            }
            currentline = 0;
            Thread.Sleep(2000);
            _COMPORT.DiscardInBuffer();
            _COMPORT.DiscardOutBuffer();
            this.write(new byte[] { (byte)0x55 });
            WaitForACK();
            TextMode(false);
        }
        public void WaitForACK(string note = "")
        {
            while (_COMPORT.BytesToWrite > 0)
            {
            }
            while (_COMPORT.BytesToRead == 0)
            {
            }
            dumpbuffer(note);
        }

        public void CopyPaste(byte startx, byte starty, byte endx, byte endy, byte width, byte height)
        {
            write((byte)0x63);
            write(startx);
            write(starty);
            write(endx);
            write(endy);
            write(width);
            write(height);
            WaitForACK();
            dumpbuffer("CopyPaste");

        }
        public void TextMode(bool transparent = false)
        {
            if (transparent)
            {
                write((byte)0x4f);
                write((byte)0x00);

            }
            else
            {
                write((byte)0x4f);
                write((byte)0x01);
            }
            WaitForACK();
            dumpbuffer("TextMode");
        }

        public void Print(string s)
        {

            if (currentline > 15)
            {
                CopyPaste(0, 8, 0, 0, 128, 119);
                currentline = 15;
                //DrawASCIIString("                     ", (ushort)0xFFFF, (byte)0, (byte)0, (byte)currentline);
            }
            //DrawASCIIString("                    ", (ushort)0xFFFF, (byte)0, (byte)0, (byte)currentline);
            dumpbuffer("print-cl");
            DrawASCIIString(s, (ushort)0xFFFF, (byte)0, (byte)0, (byte)currentline);
            currentline += (byte)(s.Length / 21 + 1);

            dumpbuffer("print");
        }
        public void DrawASCIIString(string s, ushort color = (ushort)0xffff, byte font = 0, byte x = 0, byte y = 0)

        //2.3.6 Draw “String” of ASCII Text (text format) - 73hex
        //Command cmd, column, row, font, stringColour(msb:lsb), “string”, terminator
        {
            byte[] textba = GetByteArray(s);
            write((byte)0x73);
            write(x);
            write(y);
            write(font);
            write((byte)(color >> 8));
            write((byte)(color & 0x00FF));
            write(textba);
            write((byte)0x00);
            WaitForACK();
        }
        public void clear()
        {
            currentline = 0;
            write((byte)0x45);
            WaitForACK();
            dumpbuffer("Clear");

        }
        public void DrawPixel(byte x, byte y, ushort color = 0xFFFF)
        {
            this.write(0x50);
            this.write(x);
            this.write(y);
            this.write(color);
            WaitForACK("Draw Pixel");

        }
        public void drawbitmap(byte[] bmp)
        {
            //2.2.5 Draw Image-Icon - 49hex
            //Command cmd, x, y, width, height, colourMode, pixel1, .. pixelN
            byte[] cmd = new byte[] { (byte)0x49, (byte)0x00, (byte)0x2A, (byte)0x80, (byte)0x28, (byte)0x08 };
            this.write(cmd);
            this.write(bmp);
            WaitForACK();
        }
        public void write(byte B)
        {
            byte[] ba = new byte[1];
            ba[0] = b;
            this.write(ba);
        }
        public void write(byte[] ba)
        {
            if (this._COMPORT.IsOpen)
            {
                this._COMPORT.Write(ba, 0, ba.Length);
                //int sleeptime = (ba.Length / 7) + 1;  //(calculate transmission time, at 115200, it can send 14 bytes / mx
                //Debug.Print(sleeptime.ToString());
                //if (pause)
                //{
                ///Thread.Sleep(sleeptime);
                //}
            }
            else
            {

            }
        }
        public void write(ushort us)
        {
            write((byte)(us >> 8));
            write((byte)(us & 0x00FF));
        }
        public void dumpbuffer(string note = "")
        {
            //_COMPORT.
            Debug.Print("(" + note + ") In buffer: " + _COMPORT.BytesToRead.ToString());
            while (_COMPORT.BytesToRead > 0)
            {
                byte[] buffer = new byte[1];
                _COMPORT.Read(buffer, 0, 1);
                Debug.Print(buffer[0].ToString());
            }
        }
        public uLCD_144(string sp = SerialPorts.COM1)
        {
            this._COMPORT = new SerialPort(sp, 115200);
            this._COMPORT.Open();
            this.init();
        }
    }
}



#5603 Proper LED Circuit

Posted by bill.french on 01 December 2010 - 07:30 PM in Netduino 2 (and Netduino 1)

Well, PNP is a totally different animal. My circuit assumed the more common NPN style transistor.

From: http://www.kpsec.fre...om/trancirc.htm

Posted Image



#5595 Proper LED Circuit

Posted by bill.french on 01 December 2010 - 05:21 PM in Netduino 2 (and Netduino 1)

You got it working with a motor as I remember -- have you substituted the motor with an LED, now? It should work, assuming you have the LED oriented properly? I would start using any output port, such as D0, which is the most upper-right pin on the netduino. Once you get it working, then move on to PWM. I see you are in NYC, do you have a car? I'm joining a hackerspace in Highland Park, NJ, which is about 1/2 way from NYC, id be happy to get together and work on some stuff. Your previous thread: http://forums.netdui...ch__1#entry4823



#5583 Proper LED Circuit

Posted by bill.french on 01 December 2010 - 02:41 PM in Netduino 2 (and Netduino 1)

The specs of the netduino: max current: 8 mA per pin digital pins 2, 3, 7: 16 mA per pin analog pins 0-3: 2 mA per pin microcontroller max current: 200 mA total 8ma and 16ma are a little "low" for driving many LEDs.. the "standard" i remember from way back for LEDs is 21ma, but there are many different leds out there, and some are much brighter and draw much more current. So, to avoid burning out your netduino's pins, you should probably use a transistor. (certainly I and others have been driving leds directly, but...) Also, this kind of circuit is an easy way to learn about transistors, and with an added diode for safety you can drive motors, relays, etc.



#5581 Proper LED Circuit

Posted by bill.french on 01 December 2010 - 02:32 PM in Netduino 2 (and Netduino 1)

Also, in addition to what Fred said, I generally like to have the "load" on the collector side of the transistor, otherwise the load gets involved in the base-emitter current, which can complicate things. So, now with an extra resistor, and the load on the collector side, a diagram:

Posted Image

I would use a 1k transistor to the base, which (using V=IR) works out to a safe 3.3ma (I=V/R, or IB = 3.3v/1000, which is .0033 amps, which is 3.3ma) current from the netduino pin, and a 220k resistor for the LED load, limiting the current to 15ma (IC = 3.3v/220) which should be safe for most leds, but possibly a little dim. (Check your LED specs)



#5584 Proper LED Circuit

Posted by bill.french on 01 December 2010 - 02:44 PM in Netduino 2 (and Netduino 1)

also, i just realized, the OP was using a 10mm 3.5-4v LED, which is higher than the 3.3v of the outputs, so my circuit should probably have the collector side hooked to 5v instead of 3.3v.



#5590 Proper LED Circuit

Posted by bill.french on 01 December 2010 - 03:52 PM in Netduino 2 (and Netduino 1)

I just attach LEDs to a digital i/o and then a ground pin, but I still need to get a breadboard. Maybe that's not the way with a 10mm one.


You're probably "ok" doing this, but not too many LEDs draw less than 8ma, so you are theoretically risking running outside of the specs and burning out your netduino, if you are using one of the 8ma or 16ma pins. You should probably use some kind of resistor, regardless.



#6914 Question about SPI

Posted by bill.french on 03 January 2011 - 04:16 PM in General Discussion

This doc talks about extending one wire to 200m: http://www.maxim-ic....ndex.mvp/id/148



#7336 Connecting an analog joystick to a netduino

Posted by bill.french on 09 January 2011 - 01:25 PM in Project Showcase

Did you make the joystick part of a voltage divider circuit, or wire it straight up to the analog input?



#6383 picoUPS -- tiny uninteruptable power supply

Posted by bill.french on 22 December 2010 - 06:31 PM in General Discussion

I used one of these in a project at work:
Posted Image

... it basically lets you build a small 12v uninterruptable power supply, using a 12v battery, which it charges. In case it's useful for anyone!



#8554 Analog Read

Posted by bill.french on 27 January 2011 - 01:39 PM in Netduino 2 (and Netduino 1)

Well I'm stumped. I don't think the netduino can measure current directly. You might need something like this that outputs varying voltage:

http://www.sparkfun.com/products/8883

Posted Image



#8514 Analog Read

Posted by bill.french on 27 January 2011 - 03:19 AM in Netduino 2 (and Netduino 1)

Could you post a link to the specific sensor?



#7804 Fluent Interop 1.2

Posted by bill.french on 17 January 2011 - 06:12 AM in Project Showcase

I was actually hoping you'd talk a bit about what you have going on. Your code is... beyond me at this point, although I certainly want to get there, as I have some ideas that I think would benefit from your work.

It certainly looks more responsive compared to your previous attempt, but what do you think?

Posted Image



#7787 Fluent Interop 1.2

Posted by bill.french on 17 January 2011 - 01:19 AM in Project Showcase

Very nice! Give some details!!



#4356 Netduino at PDC 2010 (or watch online)...

Posted by bill.french on 29 October 2010 - 11:04 PM in General Discussion

managed to miss the whole thing... ugh, anyone have a link yet??



#4361 Netduino at PDC 2010 (or watch online)...

Posted by bill.french on 30 October 2010 - 12:37 AM in General Discussion

Thanks, Raven, for the link. I love this stuff!



#5453 Reading a photoresistor

Posted by bill.french on 28 November 2010 - 01:02 PM in Netduino 2 (and Netduino 1)

Any way you can post a photo? Seems like it should work, although the analog inputs only support 3.3v, so maybe you're outside of that with the 5v connection. My other guess is that you're not feeding 3.3v to the aref pin. This link might be helpful: http://forums.netdui...ch__1#entry4703



#5095 How to tell Mini to auto start my app?

Posted by bill.french on 20 November 2010 - 01:33 PM in Netduino Mini

Are you sure you are powering it properly? Sounds like the mini is only running off the ftdi power, if that's even possible?



#8570 netduino controlled toy car

Posted by bill.french on 27 January 2011 - 05:36 PM in Netduino 2 (and Netduino 1)

Servos also require PPM waves, you can use an ESC and a servo interchangeably.

@CW: Yes, I'd like support for PPM, although the wave is quite easy to generate. See: http://www.fezzer.co...1/servo-driver/


..but that example uses PWM? I thought servos were controlled by sending a 1-2ms pulse within something like a 25ms frame? I thought ppm was used for multiplexing on the radio side?




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.