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 01-July 23)


By content type

See this member's


Sort by                Order  

#7963 Interfacing with the uLCD-144 mini lcd screen

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

Hi there. It just needs 5v to the vin, ground, then you hook the tx/rx to the rx/tx on either uart (i used com2 above but have switched to com1 now) and then any io to the reset to be able to reset the device. In the above code I used D4, but have since switched to A5. Edit: and "yes" to the SGC question.



#8038 Interfacing with the uLCD-144 mini lcd screen

Posted by bill.french on 21 January 2011 - 02:18 AM in Netduino 2 (and Netduino 1)

Yes, it is awesome, but comes with a price -- it's a little pricey, and it is small. It also can generate sound on the other pin. It's crazy. I am building a library to mirror the all the SGC commands, then I'll go from there. Part of me would like to get it to dial out via a modem and connect to a bbs or something. Use lynx to surf the web? LOL



#7572 Interfacing with the uLCD-144 mini lcd screen

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

That looks cool! But how did you get the netduino icon to appear on the display?

I was going to post it, but it's huge. I wrote this method (see above):

public void drawbitmap(byte[] bmp)

... and passed it in a static readonly byte array, a trick I learned from your fluent interopt stuff. I modified my c# code generator to do (byte) instead of (short), and had it read from a 8 bit bitmap file i generated from one of the 4D tools. I'll post more of a snippet tonight. I also have text working, but there's lots more work to do -- for instance, feeding it a file off the netduino SD card, or interfacing with the screen's SD card.



#7521 Interfacing with the uLCD-144 mini lcd screen

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

I was introduced to this lcd in this thread: http://forums.netdui...ch__1#entry7229 -- and I got it working:

Posted Image

It's a 128x128 1.44" color LCD, with a serial interface and a "graphics processor" attached. Sparkfun has them for about $32. One of the comments from the Sparkfun page:

So let me get this straight. This thing is a color LCD with built in controller, backlight circuitry, microSD socket which is compatible with both low capacity and high capacity cards, AND! it basically has a user programmable microcontroller with 10k of program space and 2 GPIO lines in addition to all the on-board control lines for interfacing with the LCD?


The product pages are here: uLCD-144(GFX)

4D has two versions: GFX and SGC. GFX is basically a "standalone" version, meaning you program the built in controller directly, and can built an interface to whatever you want (netduino, pic, etc -- but you have to write the interface)

SGC is more like a "traditional" serial display, where you send it command like "draw a circle here", "display this text", etc.

At first I thought the difference was actually in the hardware, but it's not: it's just firmware. You can reflash the GFX to the SGC and back without any trouble. You can get the SGC firmware here.

I was able to power, test, flash, and program it using the 3.3v Sparkfun FTDI breakout via a breadboard, in spite of the board requiring 5v. I did have to manually toggle the reset line, but it was flawless, otherwise.

Here is the start of the class I'm building to interface with it:
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.IO.Ports;

namespace uLCD_144_Test1
{
    class uLCD_144
    {
        public SerialPort _COM2;
        public void init()
        {
            using (OutputPort d4 = new OutputPort(Pins.GPIO_PIN_D4, true))
            {
                d4.Write(false);
                d4.Write(true);
            }
            Thread.Sleep(2000);
            this.write(new byte[] { (byte)0x55 });
        }
        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, false);
            this.write(bmp);
        }

        public void write(byte[] ba, bool pause = true)
        {
            if (this._COM2.IsOpen)
            {
                this._COM2.Write(ba, 0, ba.Length);
                int sleeptime = (ba.Length / 14) + 1;  //(calculate transmission time, at 115200, it can send 14 bytes / ms
                Debug.Print(sleeptime.ToString());
                if (pause)
                {
                    Thread.Sleep(sleeptime);
                }
            }
            else
            {

            }
        }
        public uLCD_144()
        {
            this._COM2 = new SerialPort(SerialPorts.COM2, 115200);
            this._COM2.Open();
            this.init();
        }
    }
}



#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



#8121 How can I get instant (or close to) data from http...?

Posted by bill.french on 22 January 2011 - 10:08 PM in Netduino Plus 2 (and Netduino Plus 1)

Not entirely sure I understand what you're looking for?
1. How to get your javascript to get live data w/o refreshing the whole page?
2. Or a different way to get data from the netduino?

For #2, I don't know what you're going for.

For #1, check out jquery and the load command: (this would go in your refresh function once you have jquery included)

$('#myDiv').load('data.htm');

(to add jquery, use:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
in your <head>)

... in your program.cs: (i have not tested this, so it's more of an idea than anything)

namespace NetduinoPlusWebServer
{
    public class Program
    {
        public static void Main()
        {
            Listener webServer = new Listener(RequestReceived);

            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
            while (true)
            {
                // Blink LED to show we're still responsive
                led.Write(!led.Read());
                Thread.Sleep(500);
            }

        }


        private static void RequestReceived(Request request)
        {
          if (request.URL == "data.htm")
          {
          request.SendResponse("some kind of data");
          }


        }


    }
}



#8173 How can I get instant (or close to) data from http...?

Posted by bill.french on 23 January 2011 - 02:53 PM in Netduino Plus 2 (and Netduino Plus 1)

Yup, *Note to self: "srtw"* (http://www.stopreinventingthewheel.com)


LOL... i added the quote to that page. I think I'll start a collection.

Have you tried playing with my example above? I think it should work.

jquery is definitly the place to start (and probably end) for ajax, i think VS is has intellisense for it?



#8572 netduino controlled toy car

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

...but the second "p" in PPM is "position", right? You're not varying the position of the pulse within the frame to change the servo angle, just the width. I was trying to find a link to back my position, wiki says PWM: http://en.wikipedia....anism#RC_servos and PPM is something else: http://en.wikipedia....tion_modulation .. but there's lots of arduino stuff that says "PWM damages servos" ... but i imagine that's from using the wrong pulse/frame size.



#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?



#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??



#8178 How can I get instant (or close to) data from http...?

Posted by bill.french on 23 January 2011 - 04:00 PM in Netduino Plus 2 (and Netduino Plus 1)

...wait, so my example worked??? with a netduino?



#6737 A project suggestion - for Netduino, Plus, or mini.

Posted by bill.french on 31 December 2010 - 05:32 AM in General Discussion

I got the phanderson controller working -- check my links above.



#6411 A project suggestion - for Netduino, Plus, or mini.

Posted by bill.french on 23 December 2010 - 12:25 AM in General Discussion

You say "no internet" -- does that mean "no network"? My sous vide controller basically does what you describe, and sends the temp back via debug and network. There is an extra piece in the form of a onewire>rs232 controller, since the netduino doesn't support onewire directly, yet. Some links: Reading temp from DS18B20: http://forums.netdui...ch__1#entry5962 Graphing data over the network: http://forums.netdui...ch__1#entry4637 My sous vide thread: http://forums.netdui...ch__1#entry6196 The DS18B20 is a very cool chip. Once onewire is supported in the netduino, it will be a piece of cake to use.



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



#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



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



#5508 What's the status of Onewire?

Posted by bill.french on 30 November 2010 - 01:20 AM in Netduino 2 (and Netduino 1)

Any suggestions on a chip? I'm having trouble finding anything. Closest I could find was this: DS2480B but DIP would be much easier for me. Thanks!



#5615 What's the status of Onewire?

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

Thank you, that is very good information, and I understand you perfectly. I ordered one of these: http://www.phanderso...mp/onewire.html It seems similar to your suggestions. I will let you know how it goes!



#5664 What's the status of Onewire?

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

My chips should come today, my sensor is due tomorrow, so i should have some news soon. I bet if you email him directly and ask him to just mail them, it should be much cheaper... otherwise, I can mail you one of mine once I get it going.



#6164 Netduino Plus - First impressions from a beginner

Posted by bill.french on 16 December 2010 - 08:43 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks Bill.

Er, what can I do with it?

Jim


Well, if you've got a smartphone, you can get the microsoft tag app, scan it with your phone, and it will send you to the netduino download section.



#6157 Netduino Plus - First impressions from a beginner

Posted by bill.french on 16 December 2010 - 05:34 PM in Netduino Plus 2 (and Netduino Plus 1)

It's a Microsoft Tag. I was hoping it was some secret stuff, but it was more along the lines of "Drink More Ovaltine".

Microsoft Tags are actually really cool things.



#6080 What's the status of Onewire?

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

It is difficult/impossible to get the precise timing needed for onewire running in managed c# code. Someone wrote a low level onewire driver, but it's not integrated into the netduino firmware yet, and since I'm not ready to compile my own firmware, I needed another solution. Some might look at this as some sort of disadvantage of the netduino, but I think it illustrates the power of the device, since I have been able to create and debug my "business logic" and "network logic" very easily in c# on the netduino, with the precise timing stuff offloaded to dedicated devices. This is a paradigm that works well for me.



#5963 What's the status of Onewire?

Posted by bill.french on 10 December 2010 - 03:17 AM in Netduino 2 (and Netduino 1)

Got it working! http://forums.netdui...-using-onewire/



#5504 What's the status of Onewire?

Posted by bill.french on 29 November 2010 - 11:23 PM in Netduino 2 (and Netduino 1)

Hello! I ordered some DS18B20 temperature sensors, before I realized I had no idea how to interface them with the netduino -- what's the status of onewire? What do i need to do to support onewire and interface with the DS18B20? Thanks!




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.