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.

Bendage's Content

There have been 149 items by Bendage (Search limited from 04-May 23)


By content type

See this member's


Sort by                Order  

#35599 Early "Getting Started with Netduino Go" software and instructions

Posted by Bendage on 20 September 2012 - 03:56 PM in Netduino Go



The Shield Base is currently in beta, and temporarily requires use of an entire go!bus channel. You can plug it into any socket--but you'll need to keep all other modules on that channel free for the moment (first channel = sockets 1-4; second channel = sockets 5-8). Once we get feedback that the current featureset is working well, we'll remove this restriction.

To blink an LED attached to pin A5 on the Shield Base:

// NOTE: be sure to add Microsoft.SPOT.Hardware.dll as a reference to your project.

// use the Shield Base on socket 5 (nothing else plugged into sockets 6-8 for the moment)


Hi Chris,

Has the restriction been removed yet?



#35446 Electronic Speed Control question

Posted by Bendage on 18 September 2012 - 04:28 AM in General Discussion

Thanks Mario. You've always been good at responding to my questions. So like a L239D a motor shield would work?



#35442 Electronic Speed Control question

Posted by Bendage on 18 September 2012 - 02:48 AM in General Discussion

Hi, My background is code and not electronics but this is probably a simple question for most of you... I am controlling a DC motor via PWM and a force sensor via Analog input. I map the 0 - 1023 values of the force sensor to a duty cycle of 0 - 100 for the PWM pin. It works fine. Using a multimeter I can see 0 - 3.3v coming out of the PWM as I squeeze the sensor but the motor doesn't move. If I hook the motor directly to a variable power supply it runs just fine on 3.3v. Is there not enough current drawing from the PWM pin or what? If I juice the motor from a different power source how can I make the voltage vary? I'm assuming I need to use an ESC. So if I power the motor via 9v and only want 3.3v do I just set the PWM duty cycle to around 33 for max voltage? If an ESC is what I need are there any recommendations?



#35130 Base64Encode

Posted by Bendage on 13 September 2012 - 04:11 PM in General Discussion

Stefan, The "duh" was on me... not you. It wasn't easy to find although it should have been :) Mario... it is. http://msdn.microsof...y/hh401577.aspx http://msdn.microsof...y/hh435051.aspx



#35110 Base64Encode

Posted by Bendage on 13 September 2012 - 11:08 AM in General Discussion

I didn't include one in the toolbox since I didn't need it yet. Same for url encoding, I don't have url decoding included in the toolbox as well. Every added feature will use code storage, so I try to stay keen on that.
So... "But for the life of me" hope that one's saved ;)

I could add it to the wishlist for the toolbox, but to be realistic, it wouldn't be implemented within a month, unless I got a high need for it.



Ha! Funny guy Stefan

Actually.... duh! After further searching, Base64 is in the Micro Framework under the Convert class. So I guess my next question would be... why is it in the toolbox?

Mario,

I have successfully sent a 40k photo @ 19200 sending 120 bytes at a time. No memory loss when streaming to SD file. It does require a thread.sleep of 200 milliseconds between looping sends though or else the serial datarecieved gets a chunk of the message cut off. Still much testing to do but I am pretty stoked.



#35098 Base64Encode

Posted by Bendage on 13 September 2012 - 05:54 AM in General Discussion

I guess I needed too fast... I just rewrote the Java one.

Someone should add this to the netduino helper classes. I believe this site maintains those classes.

        public static String Base64Decode(String s) 
        {
 
            // remove/ignore any characters not in the base64 characters list
            // or the pad character -- particularly newlines
            s = s.Replace("[^" + base64chars + "=]", "");
 
            // replace any incoming padding with a zero pad (the 'A' character is
            // zero)
            String p = (s[s.Length - 1] == '=' ? (s[s.Length - 2] == '=' ? "AA" : "A") : "");
            String r = "";
            s = s.Substring(0, s.Length - p.Length) + p;
 
            // increment over the length of this encrypted string, four characters
            // at a time
            for (int c = 0; c < s.Length; c += 4) {
 
                // each of these four characters represents a 6-bit index in the
                // base64 characters list which, when concatenated, will give the
                // 24-bit number for the original 3 characters
                **** int n = (base64chars.IndexOf(s[c]) << 18)
                        + (base64chars.IndexOf(s[c + 1]) << 12)
                        + (base64chars.IndexOf(s[c + 2]) << 6)
                        + base64chars.IndexOf(s[c + 3]); *****
 
                // split the 24-bit number into the original three 8-bit (ASCII)
                // characters
                r += "" + (char) ((n >> 16) & 0xFF) + (char) ((n >> 8) & 0xFF) + (char) (n & 0xFF);
            }
 
            // remove any zero pad that was added to make this a multiple of 24 bits
            return r.Substring(0, r.Length - p.Length);
        }



Further testing shows the the Decode can only take an unencoded text of 57 characters before thrown an index out of range exception on the "****" code above. Thanks java! It's no good.



#35097 Base64Encode

Posted by Bendage on 13 September 2012 - 05:43 AM in General Discussion

I guess I needed too fast... I just rewrote the Java one.

Someone should add this to the netduino helper classes. I believe this site maintains those classes.

        public static String Base64Decode(String s) 
        {
 
            // remove/ignore any characters not in the base64 characters list
            // or the pad character -- particularly newlines
            s = s.Replace("[^" + base64chars + "=]", "");
 
            // replace any incoming padding with a zero pad (the 'A' character is
            // zero)
            String p = (s[s.Length - 1] == '=' ? (s[s.Length - 2] == '=' ? "AA" : "A") : "");
            String r = "";
            s = s.Substring(0, s.Length - p.Length) + p;
 
            // increment over the length of this encrypted string, four characters
            // at a time
            for (int c = 0; c < s.Length; c += 4) {
 
                // each of these four characters represents a 6-bit index in the
                // base64 characters list which, when concatenated, will give the
                // 24-bit number for the original 3 characters
                int n = (base64chars.IndexOf(s[c]) << 18)
                        + (base64chars.IndexOf(s[c + 1]) << 12)
                        + (base64chars.IndexOf(s[c + 2]) << 6)
                        + base64chars.IndexOf(s[c + 3]);
 
                // split the 24-bit number into the original three 8-bit (ASCII)
                // characters
                r += "" + (char) ((n >> 16) & 0xFF) + (char) ((n >> 8) & 0xFF) + (char) (n & 0xFF);
            }
 
            // remove any zero pad that was added to make this a multiple of 24 bits
            return r.Substring(0, r.Length - p.Length);
        }




#35090 News: Visual Studio Express 2012 support for .NET MF 4.3

Posted by Bendage on 13 September 2012 - 04:40 AM in General Discussion

Nothing related to the .Net MF, but I'm using VS2012 Ultimate in my office since about a month. I'd want to alert that it looks still unstable than the old VS2010. Sometime the IDE freezes, and the only thing to do is to close the windows with the task manager.
So, I'd wait a little bit more before choosing the new 2012: the 2010 is still the very best among all the Visual Studios.

BTW, thank Chris for the news.
Hope it helps.
Cheers



Thanks for the heads up Mario.

Hey Chris, I got an update back that they were going to try and stick the debugging capabilities of dll's off of the memory card in the 4.3 release.



#35089 Base64Encode

Posted by Bendage on 13 September 2012 - 03:57 AM in General Discussion

Hi everyone, Ive been working on a big Netduino project for over a year now. This project I believe will be highly beneficial for the Netduino community. I am on the final stages of demo'ing this code and releasing the source to the community. There is one final piece missing with my project... byte streaming to and from the board via serial. The problem is that I have deducted with the custom serial protocal I wrote, I must use Base64 Encoding. There is no other way around it. The good news is that there is a class in the Toolbox.NETMF.Tools framework located at http://netmftoolbox....box.NETMF.Tools called Base64Encode. But for the life of me I can't figure out why they did not write a decode routine. I desperately need to decode it on the Netduino. Does anyone know where I can get a Base64Decode routine? Your reply is greatly appreciated.



#35030 PWM Pin Breakdown

Posted by Bendage on 12 September 2012 - 02:25 AM in General Discussion

Paul.... Milliseconds it is



#34349 Delay microseconds

Posted by Bendage on 28 August 2012 - 10:49 PM in Netduino 2 (and Netduino 1)

Hi,

Here's a function that i wrote. I find it quite accurate: (loosely based on the functions mentioned above)

private static void delayMicroseconds(int microseconds)
{
   for (int temp = 0; temp < ((microseconds - 208)/61); temp++);
}

It works in ~65us wide steps, and it's minimum is about 240us.

have fun,



Nice idea. I will play with this when my scope comes in the mail.



#34348 Introducing Netduino Go

Posted by Bendage on 28 August 2012 - 10:46 PM in Netduino Go


In the next few weeks, the GoBus ecosystem will have shipped at least a dozen modules and be working on the second dozen. Secret Labs has completed hardware designs for three new modules (SD Card, Ethernet, and a mystery module) which should be shipping soon.



LOL Chris.. Mystery module!

I guess you don't call it secret Labs for nothin!

Please consider a 9 Degrees Of Freedom module. Guaranteed to sell the heck out of N-Gos with that one.



#34313 Introducing Netduino Go

Posted by Bendage on 28 August 2012 - 06:55 AM in Netduino Go

Motor controller and accelerometer modules would be epic! The reason I asked because I was curious if delays were based on lack of interest from the industry.



#34312 PWM Pin Breakdown

Posted by Bendage on 28 August 2012 - 06:46 AM in General Discussion

Yes, Pete's article was very helpful to me, but I think there is a mistake in the example code.
I did ask a question on the page, but he never replied.

He says the values are in micro-seconds, but then in his code examples he multiplies by a million to get milli-seconds:

const uint period = 3 * 1000 * 1000;    // 3 ms


I'll leave it to you to make your own mind up.
Someone tell me if I am being stupid.

Paul


He still never did get back to you Paul did he. Well, I ordered a scope today and can't wait to get to the bottom of this.

Stand by :)



#34248 Introducing Netduino Go

Posted by Bendage on 26 August 2012 - 08:32 PM in Netduino Go

Next up are Piezo Buzzer, Ethernet, and SD Card modules--coming soon. Several dozen modules will ship this year...and we welcome you to build your own as well

This makes me very very very happy!

Can you even hint at what some of these might be?


Sensors? (Ping? Light? Tilt? Sound? Temperature? Humidity? Flex? Infrared?)
Voice recognition?
RFID?
GPS?
Imaging?
Bluetooth? Wifi?
Some sort of Robotics platform?

Several dozen is a lot!


Are you still on par for releasing 'several dozen modules' this year?



#34215 I2C and ADXL345 maxing sample rate

Posted by Bendage on 25 August 2012 - 08:32 PM in Netduino Plus 2 (and Netduino Plus 1)

Thank you Ferocildo!



#34188 How to install (or upgrade to) .NET Micro Framework v4.2 SDK

Posted by Bendage on 25 August 2012 - 07:05 AM in General Discussion

Just reformatted my drive with Win 7 (64) AND vs 2012. This won't install on 2012. Any hacks to make it work? I was hoping to move on from 2010.



#33547 Debugging Assemblies loaded via Reflection

Posted by Bendage on 13 August 2012 - 08:16 PM in General Discussion

Done... http://netmf.codeple...m/workitem/1737



#33540 Debugging Assemblies loaded via Reflection

Posted by Bendage on 13 August 2012 - 06:42 PM in General Discussion

Ya it was dynamically loaded. But here is the thing... if I "weak reference" it, AND dynamically load via reflection it points to the same pdb file that says "Matching symbol file not found" and will let me debug via reflection. It appears something can be done to make this better but not 'hooked up" in NETMF I guess :( This way is all fine and dandy I guess for me but I want to publish this Console engine and developers will have to launch the source of the engine to debug their plugins. That is kind of lame.



#33532 Debugging Assemblies loaded via Reflection

Posted by Bendage on 13 August 2012 - 05:36 PM in General Discussion

After doing a little more research, once the dll is loaded from the memory card on the Debug menu, choose Windows, and then click Modules.

There it shows which symbol file (pdb) is being used to debug the dll and it can be changed manually. In my case though it receives a "No symbols loaded" status. When I directly point to the pdb file in the le build directory it says "A matching symbol file was not found in this folder." Well that is impossible because I'm looking right at it and the date/time stamps match with the PDB file and the PE file.

What gives?

Posted Image



#33523 Debugging Assemblies loaded via Reflection

Posted by Bendage on 13 August 2012 - 04:30 PM in General Discussion

Extremely helpful!!!! A weak reference to the the dynamic dll in the startup project did the trick. Though not a smooth way of doing it, the dlls are now debugable. And you are right, an option to specify where the debugger can find those PBX files for an external dll would be very beneficial.

Thanks Chris!!!!

Game on!

Hi Bendage,

To debug into a DLL, Visual Studio uses the DLL's corresponding PDB files (found in your project's bin\debug folder). When you deploy an application to your Netduino, Visual Studio knows where to locate these PDB files. When you dynamically load a compressed .PE assembly, I'm guessing that Visual Basic has no idea where to find the source or PDB (debugging info).

More info on PDBs:
http://www.wintellec...-must-know.aspx

If you need to debug the .PE assembly, can you add just that assembly's project to your solution and then create some weak link to it (such as creating of some object within it)...so that NETMF loads your class? If so, it might then be possible to debug into that DLL (since you'll be debugging the deployed PE rather than the one on the SD card).

It would be really cool to add a feature to Visual Studio which let the developer select the DLL/PDB for a .PE loaded dynamically at runtime. There may be a way to do this today but if there's not, I recommend requesting it as a new feature at netmf.codeplex.com.

Chris




#33385 Debugging Assemblies loaded via Reflection

Posted by Bendage on 10 August 2012 - 07:20 PM in General Discussion

I like your idea. There is one problem. The dlls I am referencing through reflection are in fact being called by a dll library... a rather complex one that is being called/referenced by the start up project. If I make a separate library engine, one for debugging and one for production, it makes this tool harder to use by other developers which negates the whole project together... http://forums.netdui...h__1#entry27177 Take a look at this and you can understand that these reflection dlls are actually plugins based on a plugin interface.



#33381 Debugging Assemblies loaded via Reflection

Posted by Bendage on 10 August 2012 - 05:23 PM in General Discussion

Axel, Thank you for your reply. Let me try to understand the way your app is set up... "I create a simple program that includes the .dll as a library." - You have 2 projects and the ND startup is 'referencing' your library? "I then flash this to the ND as a single program (no loading assemblies from sd) I do all of my debugging there as normal." - Your deployment grabs the library project and loads it to the flash chip? How are you referencing the library at this point? Standard reference or reflection? "When I am ready to deploy in Production, I just deploy the obj/Release/le/*.pe (Associated to my .dll) to SD and load my "bootloader" program through regular deployment." - What exactly are you doing here differently in your calling startup assembly?



#33373 Debugging Assemblies loaded via Reflection

Posted by Bendage on 10 August 2012 - 03:20 PM in General Discussion

Hi Chris, No. I'm saying that the full Windows framework can load assemblies via reflection and the code from the external dll can be stepped through. Not so (or at least I can't figure out how to) with micro framework when you load the dll onto the SD card. It steps over any code called inside the assembly. If per say the debugger just won't allow that (there must be a way)... then how might I at least push out the dll onto the flash chip with the rest of the build and load it from there? Doubt it is possible but sure would be a lot easier than having to pull the SD card and load the assembly every build (50x a day). Thanks for inquiring about clarity. I had a really cool project I invested a ton of hours in last year and walked away out of frustration.



#33343 Debugging Assemblies loaded via Reflection

Posted by Bendage on 09 August 2012 - 10:23 PM in General Discussion

There are some great articles written on how to load a DLL from a memory card through MF. The problem is, every time you have a bug you need to pull the card out, compile, copy, reinsert, and retest. When you are dealing with rather large DLL plugins it is rather cumbersome repeating this 50x a day. In regular framework assemblies loaded via reflection are debugable. Why can the MF debugger break inside of these DLLs?




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.