- Netduino Forums
- → dab's Content
dab's Content
There have been 54 items by dab (Search limited from 29-April 23)
#4193 What is the Netduino Mini?
Posted by dab on 24 October 2010 - 11:45 PM in Netduino Mini
#3384 UART Shield
Posted by dab on 02 October 2010 - 04:22 AM in Project Showcase
Works great with the Netduino (make sure to get the 3V3 version).
#3292 Serial Comms via USB in the cards?
Posted by dab on 30 September 2010 - 05:26 PM in Netduino 2 (and Netduino 1)
Pardon my ignorance, but what's CDC (besides the Centers for Disease Control )?We are working on a USB HID (driverless) communication channel...and are looking at CDC as well. We're not sure if we'll be able to enable CDC _and_ USB debugging at the same time--but we're looking at it.
#3263 SD huh?
Posted by dab on 30 September 2010 - 06:11 AM in Netduino Plus 2 (and Netduino Plus 1)
Also, it looks like you can just use 128 for the 3rd parameter to FileStream.Read()...if it reads less than 128 bytes, then it should be OK (the method will return the actual number of bytes it read).On second thought...
fileLocation += fStream.Read(buffer, fileLocation, System.Math.Min(128, (int)(fInfo.Length - fileLocation)));
fileLocation is 128 on your second loop--too high of an offset in your 128-byte buffer array. Did you want to pass 0 as your second parameter?
Chris
#3261 How to use the SD card and StreamWriter
Posted by dab on 30 September 2010 - 06:01 AM in Netduino Plus 2 (and Netduino Plus 1)
Cool - thanks for getting the new firmware out so quickly!We have posted updated firmware to address the SD card mounting and memory allocation issues.
http://forums.netdui...patch-4-beta-1/
SD card-related updates in the firmware update:
* Mounting invalid MicroSD cards now throws an exception
* Reduced memory usage when accessing SD cards
Please let me know if this new firmware fixes things for you...
Chris
This seems to fix the problem I was having with the StreamReader.ReadLine() method yesterday:
Current directory: \ dir: \SD file: \SD\FOO.TXT The quick brown fox jumps over the lazy dog.
Now I need to figure out what to do with 1.83 GB of storage.
#3237 Console Output??
Posted by dab on 30 September 2010 - 02:03 AM in General Discussion
Oh, cool - I didn't know that. Thanks for the tip!You can also view the Debug.Print statements through MFDeploy. If you're not running the app from Visual Studio, press F5 in MFDeploy to hook into the Netduino's Debug output.
Chris
#3236 Power Questions - i.e. Voltage
Posted by dab on 30 September 2010 - 01:59 AM in General Discussion
Well, you could put two of the 6V batteries in series to get 12V.ummmm didnt think about that.... I dont really know. I guess what I'm asking is what can I do to get a battery with high amps and at least 9V... cuz they sell them for RC model airplanes, but those are crazy expensive
With a regulator, it's fairly easy to *decrease* the voltage. But, in general, it's not easy to increase the voltage of a DC source.
Increasing the voltage generally involves converting DC to AC (or a DC square wave), passing it through a step-up transformer, and converting back to DC.
But if you do that, then the current will decrease proportionally with the voltage increase (actually, you'll lose even more current due to losses in the transformer, etc.).
#3209 Console Output??
Posted by dab on 29 September 2010 - 09:14 PM in General Discussion
Hi Shane and welcome!
The Debug.Print will appear in the Output window within Visual Studio or Express.
Cheers,
Matt.
And you need to have the debugger attached. In VS2010, go to Debug | Start Debugging, which will run the solution in the debugger.
If the debugger isn't attached, the Debug.Print() statements will have no effect.
#3184 Stay close to your computer (or come to MakerFaire)...
Posted by dab on 29 September 2010 - 07:23 AM in General Discussion
Sure.Would you be interested in helping implement (Micro)SDHC libraries using SPI?
Uuhm, depends on what you mean by "team".Helping lead the team?
#3180 Introducing Netduino Plus -- Notes
Posted by dab on 29 September 2010 - 06:58 AM in Netduino Plus 2 (and Netduino Plus 1)
I bought this one today, and it seems to work (well, I can read the directories and file names, but there seems to be a problem with reading file contents).Chris,
I have no microSD atm, so will need to buy one. Could you post a list of cards that are known to work?
SanDisk Mobile microSD Card 2GB
$9.99 at Office Depot in the US.
#3178 How to use the SD card and StreamWriter
Posted by dab on 29 September 2010 - 06:48 AM in Netduino Plus 2 (and Netduino Plus 1)
I'm getting exactly the same error as Szymon when I try to read a file from the SD card. I actually wrote my sample before I saw this thread, but my code is almost the same.Chris,
Thanks for looking into this. If you change to use ReadToEnd() the behavior is the same. So this might be memory leak inside the StreamReader itself.
Here's the sample code where I use a StreamReader object to get the first line of a text file:
using System; using System.IO; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; namespace SDCardSample { public class Program { public static void Main() { string currentDir = Directory.GetCurrentDirectory(); Debug.Print("Current directory: " + currentDir); string[] dirs = Directory.GetDirectories(currentDir); foreach (string d in dirs) { Debug.Print("dir: " + d); string[] files = Directory.GetFiles(d); foreach (string f in files) { Debug.Print("file: " + f); StreamReader reader = new StreamReader(f); Debug.Print(reader.ReadLine()); reader.Close(); } } } } }
And the exception that gets thrown:
Current directory: \ dir: \SD file: \SD\FOO.TXT Failed allocation for 685 blocks, 8220 bytes Failed allocation for 685 blocks, 8220 bytes #### Exception System.OutOfMemoryException - CLR_E_OUT_OF_MEMORY (1) #### #### Message: #### System.IO.StreamReader::ReadLine [IP: 000a] #### #### SDCardSample.Program::Main [IP: 005e] #### A first chance exception of type 'System.OutOfMemoryException' occurred in System.IO.dll An unhandled exception of type 'System.OutOfMemoryException' occurred in System.IO.dll
Note that this happens for both ANSI and UTF-8 encoded files (I created the files on the PC).
#3131 Stay close to your computer (or come to MakerFaire)...
Posted by dab on 28 September 2010 - 06:32 PM in General Discussion
klotz,
A bit of both. But mostly a software limitation. If there's interest, we can start a community project to expand this to 4GB or beyond (for MicroSD cards that support SPI).
Chris
As a member of the community, I'd be interested in the project to expand the microSD capacity...
#3129 Buying or Acquiring Parts
Posted by dab on 28 September 2010 - 06:24 PM in General Discussion
I'll add a couple more:
- Evil Mad Science Shop: This is the companion store for the Evil Mad Scientist Laboratories blog. A smaller but more eclectic shop. They mainly sell kits of their own design, and also have some good deals on components (like RGB LEDs). Also check out the EggBot.
- Adafruit Industries: The companion store for the LadyAda.net blog (aka Limor Fried). Like Evil Mad Science, the store carries a lot of kits designed by LadyAda, as well as lots of Arduino boards and shields. There's some overlap with MakerShed and SparkFun, but a lot of cool stuff.
#2702 Out of memory error
Posted by dab on 23 September 2010 - 10:45 PM in Netduino 2 (and Netduino 1)
#2653 Stay close to your computer (or come to MakerFaire)...
Posted by dab on 23 September 2010 - 05:55 AM in General Discussion
#2651 What is need to get started with Netduino?
Posted by dab on 23 September 2010 - 05:44 AM in General Discussion
You can also get the eBook version for US $27.99.Thanks David for the reference to the Make: Electronics book. Exactly what I'm after!! (now to find someone in Australia that sells them!)....
#2644 What is need to get started with Netduino?
Posted by dab on 23 September 2010 - 04:05 AM in General Discussion
You'll probably need three resistors--one for each of the Red, Green, and Blue elements.
Chris
1K is probably too high a resistance if you're driving LEDs from the Netduino output pins (3.3v).
Something like 100 ohms is probably more appropriate for Red or Green LEDs. I think Blue LEDs generally have a higher forward voltage, so you may need an even smaller resistor (or maybe no resistor at all). Best bet is to buy a resistor assortment, and save yourself some frustration.
Also, you'll probably want a potentiometer to attach that knob to .
If you're just getting started in electronics, I'd highly recommend the Make: Electronics book. It's a great hands-on introduction to basic electronics. It doesn't cover Arduino/Netduino specifically, but it's a good learning guide.
#2643 Stay close to your computer (or come to MakerFaire)...
Posted by dab on 23 September 2010 - 03:51 AM in General Discussion
I quite like flying things. Will it be a flying rug? Only time will tell
Flying rugs are so old world. I vote for flying cars
#2642 Stay close to your computer (or come to MakerFaire)...
Posted by dab on 23 September 2010 - 03:48 AM in General Discussion
#2602 Controlling a LED Intensity
Posted by dab on 22 September 2010 - 05:27 AM in General Discussion
#2601 PwmSample
Posted by dab on 22 September 2010 - 05:15 AM in Project Showcase
Oooooooooooooo... button-controlled fading. Pretty!
Now to get my head around the code and get it doing something useful.
dab, thanks for publishing useful example. How do you suggest I get a relevant basic command reference? I hate reading (and writing) documentation as much as the next guy but there are times when it really helps...
The community (including me ) would probably benefit enormously from some pointers on how to research the command syntax.
Hi FastEddy,
Thanks for the kind words - I'm glad you find the sample code helpful .
You raise a good point about getting up to speed on the technology. I consider myself pretty much a newbie to C# and the .NET framework (until relatively recently, I was a C++/Win32 API kind of guy).
For me, the biggest challenge is the .NET framework itself. It's huge (even .NETMF), and a lot of classes aren't very discoverable. I always find myself thinking "I know there's a class/method to do 'x', but where?".
Here are some things I've found helpful:
- Sample code. Find something here in the Project showcase that looks interesting to you, get the source code, and play with it. Look up the classes / methods that you're not familiar with. Try making small changes to the code and see what happens. Don't be afraid to experiment.
- Online documentation. Currently, the best available documentation is at the MSDN library site. But be aware that even that is sometimes wrong, or slightly out-of-date for the .NETMF libraries.
- Books. There are a couple of books that I've found sort of useful. One is "Embedded Programming with the .NET Micro Framework", by Donald Thompson and Rob Miles. The other is "Expert .NET Micro Framework" by Jens Kuhner. Both of these are a bit dated, but have some useful sample code. There's also quite a bit of stuff in both books that I didn't find that useful, but they're worth reading for a couple of chapters (I'd recommend borrowing them if you can find a library that has them, or buy used copies).
- Community. Right here is a good resource - it's a fairly small (but growing) community, and people I've seen are eager to share and swap advice and ideas. And the Secret Labs folks here are also super-helpful.
I hope that helps get you started.
#1415 Schematic capture software?
Posted by dab on 27 August 2010 - 03:19 PM in General Discussion
Thanks, Szymon. I'll take a look at Fritzing - it looks interesting.Did you look at Fritzing? It's what I use to document schematics for my projects.
And CW2 already created Fritzing part for Netduino.
#1404 Electronics Books
Posted by dab on 27 August 2010 - 06:16 AM in General Discussion
+1 on Make: Electronics. Very fun and easy read, with clear explanations and experiments that demonstrate the principles well.I'm in the same boat. This book has been fan-freakin-tastic: Make: Electronics
Stacy
Some of the old Radio Shack books by Forest M. Mims are also quite good. I believe you can still get his classic "Getting Started in Electronics", as well as reprints that combine several of the small "Engineer's Mini Notebook" titles in one book.
#1403 Soldering Temperature for IC's, etc...
Posted by dab on 27 August 2010 - 06:07 AM in General Discussion
#1401 Schematic capture software?
Posted by dab on 27 August 2010 - 05:57 AM in General Discussion
Some the little sample projects that I've been sharing over on the Project Showcase are getting large enough that it would be helpful to post a schematic along with the code. I expect the circuits will only get bigger as time goes on.
I've been out of the electronics hobby for a while, so I'm curious what kind of schematic capture software is hobbyist-friendly. Basically, this means free (or cheap), and easy to learn.
It looks like Eagle supports schematic capture as well as PCB layout, and has a limited freeware version.
I've also heard some recommendations for KiCad (open-source).
Are there any others I should look into? I'm on the Windows platform, BTW.
- Netduino Forums
- → dab's Content
- Privacy Policy