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.

Fabian Nunez's Content

There have been 10 items by Fabian Nunez (Search limited from 30-March 23)


By content type

See this member's

Sort by                Order  

#28256 GO! Module wishlist

Posted by Fabian Nunez on 28 April 2012 - 10:15 AM in Netduino Go

Optical mouse sensor, with a modified lens so it can be used as a (very) low resolution camera for basic machine vision. The most common sensors have SPI interfaces, so they're easy to use. See eg here and here (pdf doc).



#28168 SparkFun Inventor's Kit / CIRC-05 | 8 More LEDs - 74HC595 Shift Register

Posted by Fabian Nunez on 26 April 2012 - 09:24 PM in Netduino Go

Static objects are always tricky, especially if you don't own all the modules as is the case here. What is probably happening is that your static initializer is being called before those of the other classes you're calling. I think the best fix is to use gbreder's solution.



#28117 SparkFun Inventor's Kit / CIRC-05 | 8 More LEDs - 74HC595 Shift Register

Posted by Fabian Nunez on 26 April 2012 - 04:52 AM in Netduino Go

NP. Always glad to share my obscure .net knowledge :)



#28115 SparkFun Inventor's Kit / CIRC-05 | 8 More LEDs - 74HC595 Shift Register

Posted by Fabian Nunez on 26 April 2012 - 04:35 AM in Netduino Go

The reason you're having problems is that .net doesn't guarantee the initialization order of static fields in a class. If you need them initialized in a particular way (eg they depend on each other), you have to write a static constructor for the class. This is just a method that has the same name as the class, just like a regular constructor, but has the 'static' qualifier in front of it. This static constructor will be called sometime between the module being loaded and the first time the class is used.

public class program
{
        static ShieldBase shieldBase;
        static OutputPort data;
        static OutputPort clock;
        static OutputPort latch;
        
        static program()
        {
            shieldBase = new ShieldBase(GoSockets.Socket5);
            data = new OutputPort(shieldBase.Pins.GPIO_PIN_D2, false);  //Set pin 2 as an output and our data line
            clock = new OutputPort(shieldBase.Pins.GPIO_PIN_D3, false); //Set pin 3 as an output and our clock line
            latch = new OutputPort(shieldBase.Pins.GPIO_PIN_D4, false); //Set pin 4 as an output and our latch line
        }

        public static void Main()   
        {
           // everything is already initialized when you enter this function
        }
}



#26840 What date will the downloads be available?

Posted by Fabian Nunez on 10 April 2012 - 07:22 AM in Netduino Go

@Antti Dude, relax. Schedules slip all the time, and it's only been a couple of days. It's aggressive attitudes like yours that push companies away from open source. These guys could have made the Go bus proprietary, patented the bus protocol and implemented everything as a closed source set of libraries running on top of .net micro - it's allowed by the license. They chose to open source everything. Cut them some slack.



#26708 Programming Netduino Go

Posted by Fabian Nunez on 08 April 2012 - 06:15 AM in Netduino Go

@Chris Sounds cool! I'll be keeping an eye out.



#26698 Programming Netduino Go

Posted by Fabian Nunez on 08 April 2012 - 03:30 AM in Netduino Go

Thanks Chris! Are there any plans for a "generic" go module that has just a bunch of exposed pins and code that gets sent over the go bus and run from RAM? [Edit] Nevermind, I see that the STM8S family uses the Harvard architecture, which means that native code and data are separate. I'm guessing that means that code has to be in flash.



#26695 Programming Netduino Go

Posted by Fabian Nunez on 08 April 2012 - 12:10 AM in Netduino Go

There are some devices that absolutely need interop to work correctly (eg a Parallax Ping sensor, which requires measuring pulses as short as a tenth of a millisecond and can't be interrupted by the scheduler giving the CPU to another thread). The overhead of the gobus means that the native code will need to run on the go module itself, so I'm guessing that you guys have something in mind already. Can you share roughly how this would work? (eg does one need to flash the go module, or does one send a stream of bytes with the code at init time? do modules run the CLR or some minimal firmware? etc)



#15841 Measuring Angle of Attack

Posted by Fabian Nunez on 24 July 2011 - 12:33 AM in General Discussion

I appreciate your response... and keeping me honest! :blink:

I neglected to mention... the object is flying and I'm needing an accurate determination of its pitch angle (AOA)... hopefully in the 0.1 degree range.

Thanks

I agree with Mario, just use a simple pendulum constrained to only swinging in one plane (like the pendulum on a grandfather clock). The pendulum would swing from a simple potentiometer, and like he says there are simple ways to very accurately measure resistance. If you're worried about vibrations you could make it small and encase it in a box filled with nonconducting oil to dampen the vibrations. The viscosity of the oil would dictate how much damping you get.



#13740 Creating Enum instances using Reflection

Posted by Fabian Nunez on 30 May 2011 - 12:07 AM in General Discussion

What exactly are you trying to do? Enums are basically just strongly typed integers, so if you know the value of the enum a simple cast will do, there's no need to call constructors.




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.