Write("V " + V.ToString("F1") + " A:" + A.ToString("F2") + " W:" + (A * V).ToString("F1"));
...the funny thing is that ToString sometimes seems to return the value and sometimes the name of the type, that's why I didn't try it before.

![]() |
  | |||||||||||||
![]() |
|
![]() |
||||||||||||
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.
Rod Lopez's ContentThere have been 33 items by Rod Lopez (Search limited from 02-July 24) #12079 String.format
In case anybody else has similar issues the solution is as simple as this:
Write("V " + V.ToString("F1") + " A:" + A.ToString("F2") + " W:" + (A * V).ToString("F1")); ...the funny thing is that ToString sometimes seems to return the value and sometimes the name of the type, that's why I didn't try it before. ![]() #12078 String.format
Hi there,
I am having a very simple issue, I am trying to write a few values to a 16x2 LCD, the values are, originally floats. I need to be able to see the whole set of info in a single glance. The issue is that, by default, I end up printing too much (the number plus eight digits of precision), so my result doesn't fit on the screen at all. My code looks like this: float A = 0, V = 0; PowerSampling.GetPower(ref V, ref A); Write("V " + V + " A:" + A + " W:" + A * V); ...and the code I am trying to replicate (I am porting this from an Arduino) looks like this: float A, V; PowerSampling.GetPower(V, A); lcd << "V" << _FLOAT(V, 1) << " A" << _FLOAT(A,2) << " W" << _FLOAT(V * A,1); I was intending to use String.Format but that doesn't seem to be supported... how can it be done? #12017 Problem with GliterFilterTime
Hi guys,
It seems to me like it would be great to be able to choose the de-bouncing algorithm. Charles makes a good point (and a great post) on how to do debouncing, but it does add to the complexity and cost of a prototype board.
...plus you may not not have the right ICs at hand.
I would love to be able to throw cycles to the problem (at the cost of memory and perf) rather than having to change the board layout/part list if that'd be possible.
For a final product it might not matter all that much, but in the prototyping stages it is handy to just have these things working out-of-the-box
![]() #12077 Problem with GliterFilterTime
I ended up writing something like this:
static DateTime lastTrackerSwitch = new DateTime(); static void OnTrackerSwitchButton(uint data1, uint data2, DateTime time) { if (time.Ticks - lastTrackerSwitch.Ticks < 150 * System.TimeSpan.TicksPerMillisecond) return; else lastTrackerSwitch = time; //Here goes your code, being called after debouncingdoes that seem sane? #13084 Power through vIn pin?
so I thought, my EE skills are a tad rusty, so didn't want to risk it
![]() #13053 Power through vIn pin?
I mean the Vin, I would hope not to toast the pin or its connections, right now I am peaking at around 150mA when all servo and display hell breaks loose
![]() #13049 Power through vIn pin?
Can I power the Netduino using unregulated 7.5-12 volts though the vIn pin in the board? as in... instead of using the power connector
If so.. what's the maximum power I can drain? (I have a few 3.3 and 5v devices connected to the Netduino)
#13079 Power through vIn pin?
I'll use Vin as input then, there's one tiny detail left though... the switching between Vin and USB for power, is it mechanical or electronic?
#11965 Out of memory issues
It seems like it was as Mario suspected, if all the incoming data is not consumed with a read() call it'll just accumulate and start consuming RAM, until it runs out.
I connected a callback to RXOver but never got called, I'll get back if I can get the experiment in the right setup again (you know how it when you need to break some things in order to fix others
![]() #11455 Out of memory issues
I get more or less the same result, it might take a bit longer (it is hard to say) but still runs out of memory at aprox the same pace.
I am pretty sure I am getting much more data than what I am consuming -through serialport.read-. I assumed it would be stored in the serial chip's memory and when full it would just drop new data. I'd make sense that, if an internal buffer expands with arriving data it would end up too big... I'll give that a shot and report back #11443 Out of memory issues
Hi there,
This is my first post here, so please let me know if I am posting in the wrong place ![]() So, as to the issue... I have a setup where I am using one of the Netduino COMs as serial interface to an external chip (an IMU), communication works, and everything is fine and dandy (a.k.a I get my data through the serial), but I eventually (pretty much at predictable intervals) get an 'Out of Memory' error. I honestly thought that moving to a managed framework meant that you didn't have to care about your memory anymore, is that true? do I need to release / dispatch memory blocks somehow? Do I need to manually invoke the garbage collector? Could you give a look to the code and tell me if I am doing something terribly wrong? thanks!! -rod IMUSerial = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One); IMUSerial.DataReceived += new SerialDataReceivedEventHandler(IMUSerial_DataReceived); IMUSerial.Open(); //write IMU code Debug.Print("Serial is " + (IMUSerial.IsOpen? "open" : "not opened")); byte[] pip = System.Text.Encoding.UTF8.GetBytes("r"); Debug.GC(true); while (true) { IMUSerial.Write(pip, 0, 1); Thread.Sleep(100); } static void IMUSerial_DataReceived(object sender, SerialDataReceivedEventArgs e) { byte[] buffer = new byte[10]; IMUSerial.Read(buffer, 0, 10); String message = new String(System.Text.Encoding.UTF8.GetChars(buffer)); Debug.Print(message); } #12137 LCD KS0066 driver?
Hey Ken,
You might want to check this one out: http://icontexto.com/charactercreator/
I saw it recommended by Ladyada some time ago...
#11627 Interrupt/Event Problem
Are there any news regarding this issue?
I have the same SerialDataReceivedEventHandler-not-triggered issue with an extra bit of info, my event gets triggered if I am debugging from the PC, if the netduino runs standalone (as in non-f5, just a local reset) then I never get the events.
I have changed the code to constantly look for serial data in the main loop and then it works, ideas? suggestions? popcorn?
#12039 Interrupt/Event Problem
Hi Chris,
Nope, I haven't updated the firmware (I am trying to keep my schedule for releasing something and I am afraid of the "beta" moniker)
What I have done is check out the changes and follow the description of the fix to one of the bugs (surely the same you think) to figure out and avoid the bug at setup-time, and it does work as expected.
I am pretty confident the firmware upgrade will make my fix redundant
![]() #12136 Inter pin resistance
@Mario: It has been a really strange trip that one.
I have finally managed to get things running, but I'll look for a trivial case that can reproduce the error I've been having (maybe it is some combination of software and hardware)
My basic assumption is that, under normal circumstances, connecting an analog pin to a circuit where another analog pin is connected shouldn't change the value returned by the first pin. That assumption was broken in my Netduino circuit (where as I was having perfectly valid reading on an Arduino version).
One of the main issues, I think, is that the analog sampling happens in a given moment in time, and I have a couple of switching circuits that could be producing parasitic frequencies, with a bit of luck I ended up sampling a few of those peaks.
Your answer made me rethink the whole approach and eventually to figure out what was going on
![]() #13224 Inter pin resistance
Hi guys,
Chris:
That was my assumption too, it is good to know. An overload is definitely possible (though I encountered the issue from early on proting from an Arduino setup) I am dealing with both robotics and power sampling so it seems reasonable a cable would have touched something it shoudln't.
One question on the "damage", what are the chances the issue might be consistent (as in, would I be able to add a multiplier to the incoming signal and sure, loose precision, but use the pin ) or can it become totally random?
Mario:
The ref is plugged to 3.3.
Seems a bit funky to have to connect physically though, is there any way to wire those internally? Software maybe?
I might be answering the wrong thing though, I don't quite get what you mean by "+3.3V >= VRef >= Vin" if I read that a-la software it doesn't quite make sense to me
![]() #13380 Inter pin resistance
Exactly what I mean and what the specs wants. The reason why I am confused is that it sound like Vin is to be 3.3 volts or lower, which isn't enough to feed the Netduino in any case. That's what +3.3V >= VRef >= Vin tells me, anyway. Btw, I did measure the resistances of all the pins, across ground and different pins, the input resistance returned by the multimeter is very high (non-measurable really). My guess is that some magic inside the AD has gone off, possibly not blown (I can measure in a fairly deterministic way) but definitely not in the right range. There's one thing that puzzles me, though. It feels like the Netduino reports a lower voltage than it should. It is normally a bit lower (in any pin) than the voltage reported by either power source or multimeter, but, as the load increases (let's say the LCD screen that's fed by the Netduino goes on), the voltage reported by the Netduino decreases much faster than what's reported by the multimeter. We are not talking about massive value offsets, mostly in the order of one-two tenths of a volt; but I am keeping track of battery charge and it gets sensitive to small voltage changes ![]() #13216 Inter pin resistance
Finally I have had a bit of time to create a repro case.
What I have set up is very simple, an external power supply with a voltage divider (22k/10k), ground to Netduino ground and the divider being fed to an analog analog pin. What I get is super funky: -using any analog input but for a3 things seem to work all the time the way you'd expect. -Reading from analog3 does actually (pretty much exactly) half the sampled value, but not only from the Netduino side (as in not a software-scaling problem), if you put a voltmeter to the divider, the divider's voltage does drop the moment the divider is connected to a3, otherwise the value is what you'd expect. Is a3 special in any way? Is my board broken in the strangest manner? Qui lo sa? ![]() #12085 Inter pin resistance
Hi all,
I am trying to debug a simple yet specially tricky situation, I am trying to measure both voltage and current going through a certain circuit.
The voltage is no big deal, resistor divider:
Vcc----1M---+A0---470k---GND
..and I measure across A0 and GND, all good.
The problem is the current, I add an extra resistance, so things look a bit like
Vcc----1M----+A0---470k--10---+A1----GND
At that point, though I get a decent reading for current, my reading for voltage goes to hell...
My guess is that the internal resistance between A0 and A1 is lower than I expected (acording to the change in result it should be around 500k), so that one would appear in parallel with the 470k resistance and kill my reading.
I can throw an opAmp (or lower the divider's resistors)and be over with it fairly quickly, but I would like to make sure I understand what's going on.
Does anybody know what the internal inter-pin resistance should be?
thanks!
#13235 Inter pin resistance
Hi again!
@Chris: The measured/real ratio seems to be fairly stable at 0.43 no matter how low or high the incoming sampled value is, can I take that as I-can-use-the-pin?
Btw, I do have a similar but lower-scale issue with analog reading in other pins (ratio being around 6%) even in pins I have never used, is that within acceptable Netduino precision?.
The offset also seems to change when the power drain through the Netduino (Vin->5V output) increases (about .8%) when drain increases from 5mA to 80mA.
@Mario:
I still don't get it, the way I read +3.3V >= VRef >= Vin is:
3.3v has to be greater or equal than VRef, which should be greater or equal than Vin, the signs should be the other way around, or am I a bit confused?
The idea of checking the power drain was great, through a3 I get 0.2 mA, in other pins it is too low to measure (I am using about 1.3v)
@Mark:
Thanks for the tip, I have noticed that vRef connected-and-non-connected where giving me the same values and I was wondering if it was a coincidence or something. What you mention would make ton of sense.
Btw, how do I know if I have a rev a or b board?
#12172 How can I get amperage input?
Hi Sam,
One way you can do it is by adding a very low resistor (a shunt resistor as they are usually called) between the ground and the servo's ground. An increase in current will increase the voltage dropped across the resistor. I have been using a 0.1Ohm and an op amp (just to make the voltage easier to read from the Netduino) and it's been working like a champ. Just for reference you can check Shunt resistors, look for "Use in current measuring" #21616 Current State of features
Mario,
I am not planning to run the device from a 9 volt battery, the battery for my usage is more of large marine type, with a connected solar charger and other loads, that's where the 20mAmp come from
![]() #21537 Current State of features
Hi guys,
A few months ago I was finishing a robotics project and ended up hitting pretty hard limitations on the Arduino platform, I switched to a Netduino, and life was good... other than minor issues I came across at the time. I have a similar situation now with a different project, it started with Arduino and I am thinking about moving over once again. I just wanted to get a heads-up on what the current state of the platform is. So, if anybody could help with a couple of questions, here they go! -Can I communicate though USB? I am storing information in an SD card that I would need to read, it used to be that the USB(digital 0-1) were only for debugging, is that still so? I am using all pins on the Arduino, I won't be able to use the second UART for sending data over. -I remember some conversation on low-power modes, but it all seemed on the air (waiting for 4.2 and so). Is there anything working today? My application is fairly power-critical (big batteries but must last for months), I could trigger a hardware interrupt if that's needed ![]() -I might be producing a few tens of devices in the next six months or so, how well does the Netduino/MCU scale in terms of production? (I am thinking chip availability, bootloading, etc) In the Arduino you can buy a blank chip, program it and have it running on a custom PCB in no time ![]() -I have found some cases for the Arduino (I particularly like the one Adafruit has), is there any that's Netduino-friendly? Netduino having the usb plug in a different location and so... thanks a ton! #21611 Current State of features
I guess this stays the way it used to be then, which leads me back to the pin count issue, I am wondering... could I use the digital 0 and 1 for communication using an external UART->USB chip (or alternatively do the same with 2-3 and leave 0-1 as normal digital in/out)? I know you guys are working on a better solution, but I'd need to make a decision with what is available (and proven) today ![]() I really like the idea of powering the whole board off, as Mario suggests, as I'd need to collect data only every so often. The issue is that there's an UI that requires fast-enough response, as I current have with event handling, but was wondering if it could also recover a deep sleep... I wouldn't mind having a few mAmps of usage (even if I have to disconnect a LED), it all depends on how many. My guess is that anything around 20 would be okay, maybe the Netduino Mini has lower power reqs? I could always go for the SAM7X directly on-PCB, but I'd rather do the first hundred or so units with an already-available MCU board than having to integrate it in the design... Mostly as I feel that integrating the SAM7X would be way harder than integrating a, say, 328. (I would need a SMD-friendly programmer to add the Netduino bootloader to the chips, am I right?) thanks for your help guys! The community rocks ![]() #21625 Current State of features
Jonny, Nope, I haven't really measure it, but the response should be fast enough to feel fluid, probably less than 30ms from button to UI response, that's, I think' way out of any MCU league (other than hardware-interrupt wake up). That aside there are also menu entries displayed that would need updating every second, seems to me like quite a bit of the time for sleep would be spent waking up in such a scenario. I have thought about having an extra MCU (msp430, atmega328) dealing with the menu/UI side of things, the problem is that it gets more complex both software and PCB-wise, and more expensive to manufacture. The menu display does require some access to much of the rest of the code. In that sense, for the rest of what the code is doing right now the extra added complexity wouldn't make sense, it would just make sense to simply put the whole code in the msp/328 instead.
| ||||||||||||||
![]() |
||||||||||||||
![]() |
|
![]() |
||||||||||||
![]() |
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ![]() |
||||||||||||
![]() |