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.

alanb

Member Since 14 Dec 2010
Offline Last Active May 18 2013 04:12 PM
-----

Topics I've Started

How do you create software events

17 February 2011 - 06:42 PM

Hi,

So far I have created a display manager class, that internally creates a thread listening on a socket for commands. That all works fine, the main thread generates numbers on a display and sending a message from a client on my pc will display that message on the display.

Now when my displaymanager recieves a command code on the socket I want to pass that command back to the main program. On the pc I would usually use an event. When I looked for EventHandler<> I could only find something called NativeEventHandler. Is that the N+ equivalent of EventHandler?

What is the equivalent of my pc code
public event EventHandler<StringEventArgs> ReceivedCommand;

...

In Some function

if (ReceivedCommand != null)
   ReceivedCommand(this, new StringEventArgs(command));

Or, as is highly probable, am I going about this in the wrong way.

By the way, a lot of this code is by others from the forum so if you recognise your own code, profound thanks. I will reference everyone in the finished article.
Alan

Any experience using keypad in your project?

09 February 2011 - 04:09 PM

Hi, For my project I need to let the user enter data. So I need to use a keypad. I saw this http://www.sparkfun.com/products/8871 sealed membrane keypad. Or alternatively this http://www.sparkfun.com/products/8653. My preference would be the first one because the arrow keys etc would be useful. I just am interested if anyone has used either keypad and how easy each is to interface to the N+. There is an arduino forum discussion (http://www.arduino.c...um=1209003950/0) on using the second keypad but I can find nothing yet about using the sealed membrane keypad. Alan

Project to run my machine

01 February 2011 - 06:30 PM

Hi, I have built a small Rose engine which is a type of lathe used in ornamental turning (see http://blog dot alanbattersby dot co dot uk/). Currently I run EMC to control the steppers but my aim is to write the necessary code so that my shiny new Netduino plus controls the rose engine. Basically whilst rotating the spindle at the cutting speed (often 1-2 rpm) I need to move the headstock laterally from side to side and also forwards and backwards. So there are three steppers to control but each only moving by small ammounts. The stepper driving the spindle is 200 steps per rev with 2* microstep and is connected to a 16:1 gearbox so claculations give 17.778 steps per degree. I calculate that issuing a step every 1ms will give a top rotation speed of roughly just over 9rpm, this is fine as the normal speed when cutting a pattern is around 1-2 rpm. The steppers driving the headstock movement are again as before but connected to a ball screw of 5mm pitch so one rotation of 400 seteps moves the headstock by 5mm giving 80 steps per mm. Typically cutting a wave pattern of 20mm amplitude and a frequency of 6 giving a maximum lateral offset movement of approx 2.1mm per degree of rotation so max 168 steps per degree or max 9.5 steps laterally for each rotational step. So again at 1ms per step laterally the rotational speed will be just under 1 rpm. So maybe I should generate steps every 500us to cover this and again give a rotational speed of around 2rpm. But not bothered if rotational speed is less than 1 rpm. I can generate the tables giving the number of steps to move so from software I have already written, I want to be able to download these to the N+ store them on the micro sd card then press a button to start the machine. So much for the background, now for the code running on the Netduino I anticipate spawning at least one thread fom main and then using the main thread for communication to-from a simple keyboard and display. I want to use the internal PIT to set an interrupt every 500us say and the ISR should load the necessary values onto output pins to determine the direction and step if any of each motor. The thread is to host a simple trajectory controller that should accelerate the stepping at the start and decellerate whenever the next move has a change in direction. I am not trying to implement the full functionality of a sophisticated piece of software such as EMC. So that is what I want to acheive my questions are 1) Is it possible on the N+ 2) Where can I find references to examples of using ISR and the internal timer etc? I am a retired ex programmer with 20+ years experience at least 8 in c# and then java before that. I appreciate that the N+ is a young product with little documentation but I have to start somewhere. So thanks in advance for any suggestions and pointers to docs code etc. Hopefully I will put links to anything I discover / write on my blog. Alan (PS I noticed whilst writing this my web site had gone down. We are having a little trouble with this over the last few days and I am aware of it so thanks again)

Help required with Update firmware to 4.1.1

31 January 2011 - 04:48 PM

Hi, I got a Netduino Plus at Christmas so am a newcomer. I tried to update the 4.1.0.5 firmware to 4.1.1 Alpha, followed the instructions. But when I press deploy I get the messagebox with the progress bar saying Connecting to TintBooter but it just hangs there with no progress. Can someone tell me what is going wrong and how to fix it? Thanks Alan

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.