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."static" functions are mostly meant for "helper" functions and functions without side effects.
...
This is *the* .NET way
- Netduino Forums
- → bill.french's Content
bill.french's Content
There have been 260 items by bill.french (Search limited from 05-July 23)
#7216 Use of Static Keyword
Posted by bill.french on 07 January 2011 - 03:53 PM in General Discussion
#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
#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
I have to know: how did you find this thread??Disclaimer: I work for PreEmptive Solutiuons (the makers of Dotfuscator)
#4080 We have a little Netduino surprise to share...
Posted by bill.french on 21 October 2010 - 11:44 PM in General Discussion
#8919 4Display Shields - Drivers
Posted by bill.french on 02 February 2011 - 11:26 PM in Project Showcase
#8890 4Display Shields - Drivers
Posted by bill.french on 02 February 2011 - 04:38 PM in Project Showcase
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)
From: http://www.kpsec.fre...om/trancirc.htm
#5595 Proper LED Circuit
Posted by bill.french on 01 December 2010 - 05:21 PM in Netduino 2 (and Netduino 1)
#5583 Proper LED Circuit
Posted by bill.french on 01 December 2010 - 02:41 PM in Netduino 2 (and Netduino 1)
#5581 Proper LED Circuit
Posted by bill.french on 01 December 2010 - 02:32 PM in Netduino 2 (and Netduino 1)
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)
#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
#7336 Connecting an analog joystick to a netduino
Posted by bill.french on 09 January 2011 - 01:25 PM in Project Showcase
#6383 picoUPS -- tiny uninteruptable power supply
Posted by bill.french on 22 December 2010 - 06:31 PM in General Discussion
... 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)
http://www.sparkfun.com/products/8883
#8514 Analog Read
Posted by bill.french on 27 January 2011 - 03:19 AM in Netduino 2 (and Netduino 1)
#7804 Fluent Interop 1.2
Posted by bill.french on 17 January 2011 - 06:12 AM in Project Showcase
It certainly looks more responsive compared to your previous attempt, but what do you think?
#7787 Fluent Interop 1.2
Posted by bill.french on 17 January 2011 - 01:19 AM in Project Showcase
#4356 Netduino at PDC 2010 (or watch online)...
Posted by bill.french on 29 October 2010 - 11:04 PM in General Discussion
#4361 Netduino at PDC 2010 (or watch online)...
Posted by bill.french on 30 October 2010 - 12:37 AM in General Discussion
#5453 Reading a photoresistor
Posted by bill.french on 28 November 2010 - 01:02 PM in Netduino 2 (and Netduino 1)
#5095 How to tell Mini to auto start my app?
Posted by bill.french on 20 November 2010 - 01:33 PM in Netduino Mini
#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?
- Netduino Forums
- → bill.french's Content
- Privacy Policy