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.

Gauss's Content

There have been 7 items by Gauss (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#53196 Queue's available for Netduino?

Posted by Gauss on 14 October 2013 - 07:39 PM in Visual Studio

Hi Gauss,

 

I have written some code to use a queue, but have yet to try it out properly.

Your post triggered me to run it up.

 

I am using a Netduino plus v1 with .netmf v4.2.

 

I put a break point on the line:

messageQueue = new Queue();

Before the line executes, I confirmed that the messageQueue variable appears as "null" when the mouse hovers over it.

After stepping over the line, the variable appears as "Count = 0" instead, and I can click a "+" to see more internal data.

 

The queue is a private member of a class that is created by the main program.

It is new'd when the class constructor runs.

 

What hardware and framework combination do you have?

 

Hope this is of some help - Paul

 

I have a Netduino Plus v1 with .NET MF v4.2

 

I found out that its actually putting the Queue in there, but apparently some of the functions are timing out during debug... Very weird.




#53139 Queue's available for Netduino?

Posted by Gauss on 11 October 2013 - 05:15 PM in Visual Studio

Ok, so I have a little project with heating elements, and based on a temperature differential the netduino will ask for a certain number to be on.

 

I am trying to create a little object which uses a Queue to equalize the loading on all of them so I don't manually have to swap them out to ensure even wearing over time.

 

Problem is the Queue initialization seems to be returning null, but its just the standard Queue from System.Collections. Does the .NET MF not actually implement Queue?

 

Code:

public class Balancer{              public Balancer(Cpu.Pin[] relayPins)        {            _avail = new RelayList(false);            foreach (Cpu.Pin relaypin in relayPins)                _avail.Enqueue(new Heater(relaypin));        }}public class RelayList{        protected bool _isActive;        protected Queue _list;        public RelayList(bool isActive)        {            _isActive = isActive;            _list = new Queue();        }        public virtual object Dequeue()        {            if (_list != null)                return _list.Dequeue();            return new object();        }        public virtual void Enqueue(object toAdd)        {            if (_list != null)                _list.Enqueue(toAdd);        }}

As you can see, _list is a Queue. I was concerned because the _avail.Enqueue was not putting the Heater objects into the Queue.

 

When I started my debug, basically the if(_list != null) in Enqueue was failing, so I walked through the constructor and, after the _list = new Queue() line, _list is still null. Am I doing something wrong? Is their a limit on call stack depth (this code is called about 4 deep during intialization, Main -> Balancer -> RelayList -> Queue)? Would that cause an error like this or would it throw an exception?




#53118 float vs. double in code

Posted by Gauss on 10 October 2013 - 03:12 PM in Netduino Plus 2 (and Netduino Plus 1)

Mario, thank you for your response.

 

I was actually just reading your blog on performance metrics with code in the .Net Micro Framework.




#53100 float vs. double in code

Posted by Gauss on 09 October 2013 - 04:51 PM in Netduino Plus 2 (and Netduino Plus 1)

So, I am somewhat curious about the backend implementation of the .NET MicroFramework.

 

I am programming a temperature monitoring system for my house and using the Netduino to do all the interpretation and logic to drive everything.

 

I have been using floats since my temperature sensor is only accurate to ~0.1 degrees, my issue is AnalogInput, most of the built in Math library functions, and any deicmal number I type in the program seems to use use doubles, which I have been casting as floats for my math.

 

Is this actually saving me anything? Since we have a 32-bit uC, I presume this is saving a memory location and register for operations with my program because double is 64-bit, but for all I know I am adding an operation without gaining anything because all the calculations will still be done using double.

 

I have a code snippet below of what I am talking about:

	    private static float GetTemp()	    {		    return (((float)0.442368) * (float)_adc.Read()) - ((float)4.92304);	    }

0.442368, 4.92304, and _adc.Read() are being treated as doubles according to the IDE, and I am casting as a float.




#52893 Netduino Plus 1 Firmware v4.2.0 (update 1)

Posted by Gauss on 25 September 2013 - 04:53 AM in Netduino Plus 2 (and Netduino Plus 1)

Ok, I'm not sure what exactly is going on here...

 

So I have updated my Netdunio Plus (v1) to the TinyBooter 4.2.0.1

After following these steps (http://wiki.netduino...ep-by-step.ashx) this is what I get in MFDeploy:

 

 

Pinging... TinyBooter Bootloader build info: Netduino Plus (v4.2.0.1) by Secret Labs LLC

 

 

The problem comes when I try to send the ER_FLASH and ER_CONFIG files.

 

It just hangs on the 'Chk' step, I never get 'Chk Signature... Signature Passed!'

 

And when I cycle power on the device and ping, this is all I get:  

 

Pinging... TinyCLR

 

 

No version, no updates after that (which seems atypical given every guide I've read on this). However, 'Device Capabilities...' nets:  

 

HalSystemInfo.halVersion: 4.2.0.0 HalSystemInfo.halVendorInfo:   Netduino Plus (v4.2.0.1) by Secret Labs LLC HalSystemInfo.oemCode:   34 HalSystemInfo.modelCode:   177 HalSystemInfo.skuCode:   4097 HalSystemInfo.moduleSerialNumber: 00000000000000000000000000000000 HalSystemInfo.systemSerialNumber: 0000000000000000 ClrInfo.clrVersion: 4.2.0.0 ClrInfo.clrVendorInfo:   Netduino Plus (v4.2.0.1) by Secret Labs LLC ClrInfo.targetFrameworkVersion: 4.2.0.0 SolutionReleaseInfo.solutionVersion:   4.2.0.0 SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.1) by Secret Labs LLC SoftwareVersion.BuildDate:   Sep 19 2012 SoftwareVersion.CompilerVersion:   410894 FloatingPoint:   True SourceLevelDebugging: True ThreadCreateEx: True LCD.Width:   0 LCD.Height: 0 LCD.BitsPerPixel: 0 AppDomains: True ExceptionFilters: True IncrementalDeployment:   True SoftReboot: True Profiling:   False ProfilingAllocations: False ProfilingCalls: False IsUnknown:   False

 

 

Any ideas? Could it be related to what I believe to be random disconnects (the Blue LED on my Netdunio Plus will turn off at a certain point in time).




#52881 Adafruit LCD Shield and I2C on the Netdunio Plus

Posted by Gauss on 24 September 2013 - 07:24 PM in Netduino Plus 2 (and Netduino Plus 1)

You are correct: SDA is A4 and SCL is A5.

 

You'll probably need pull-up resistors for both SDA and SCL if your LCD module doesn't have them on the board.

 

Plenty of us have driven similar LCD modules through I2C but the bus isn't nearly as fast as SPI. I'd probably buy a cheaper board (you can get a 20x4 module with I2C for $12 @ Amazon) rather than the Adafruit model but you'll interact with them the same. AxelG wrote a great library that will jump start you as well.

 

Good luck!

 

Thanks for the info.

I was actually considering the Adafruit shield because it includes the buttons, I felt the package was nicer. I'll have to see if there is a quicker way to sneak in some buttons. It'll have to be enclosed anwyay.




#52874 Adafruit LCD Shield and I2C on the Netdunio Plus

Posted by Gauss on 24 September 2013 - 02:24 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok, I am looking to repurpose my Netduino plus relative to what it is currently doing and my new project requires an LCD screen.

 

The issue I am running into is that I am using the original Netdunio plus and seem to have issues confirming operation since everybody compares the current Arduino with the Netdunio plus 2, so I decided to come here since you guys are the experts :P

 

I'm looking to pick up this shield (http://www.adafruit.com/products/772) or equivalent, in this case the LCD is controlled through I2C.

 

Now I have never done any I2C with the original Netdunio Plus, but per the hardware specs (http://www.netduino....oplus/specs.htm) I should have:

analog pins 4-5: I2C SDA, SCL

 

I just wanted to confirm, that means my analog pin 4 is I2C SDA and pin 5 is I2C SCL and that I should be able to drive this LCD shield through those pins.

 

Are there any other concerns? Anybody done anything like this? Anything else I should be looking at?

 

Thanks in advance guys.





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.