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.

ErikN's Content

There have been 89 items by ErikN (Search limited from 06-May 23)


By content type

See this member's


Sort by                Order  

#26937 Arduino body movement sensor does not work

Posted by ErikN on 11 April 2012 - 02:08 PM in General Discussion

Looking further at the board, the output goes high when it detects. Your InterruptPort looks like it might be configured for the opposite...



#26938 Individual assemblies sizes

Posted by ErikN on 11 April 2012 - 02:12 PM in Netduino 2 (and Netduino 1)

I've always just taken a look at the output directory file sizes. For instance, in a default configuration you'll have a BIN folder with 1 or 2 folders underneat: Debug and Release. Whichever configuration you're building, go into that folder. You should see your DLL (and probably other referenced files, build artifacts, etc.) and 2 more folders: LE and BE (for little endian and big endian builds.) These should be about equivalent but you're likely deploying the LE files. Go into that folder and take a look at the .PE file sizes (I'm pulling from memory - maybe it's not PE?).



#26985 Introducing Netduino Go

Posted by ErikN on 11 April 2012 - 10:14 PM in Netduino Go

Hi x893,

We used RVCT (ARM RVDS 4.1) to compile the Netduino Go firmware.

CW2 did quite a bit of work to get it to compile under GCC (using Yagarto...maybe CodeSourcery) as well. This is not tested, but we do want to make sure that everything compiles under the free GCC compiler as well.

Chris


THANK YOU! I tried compiling 4.1 from the NETMF sources but it was a jumbled mess and I couldn't figure it out. After a couple hours I was like: "I has a sad" and gave up. But I still strongly desire to tinker in the native layer to add in some things I think would be useful for me and test them out. I don't like the idea of asking others to make the change to see what happens and I won't blindly send a pull request or merge source that I can't test myself!

Chris - You're my hero for inspiring such awesome people.
CW2 - I will grant you one wish. Within my power to grant. And if it's not too troublesome or very illegal. Unless I'm incapable of making it work again.



#26991 Mutitasking help needed

Posted by ErikN on 11 April 2012 - 11:19 PM in Netduino 2 (and Netduino 1)

I'm so sorry for not responding sooner! My watch on this thread seems to have gotten lost! I guess this explains why perkunas emailed me directly!

This is the code I provided (the helper function is the main bit) and perkunas was able to integrate it and get it to work but he's seeing some strange behavior on some pins when the board is first turned on that he's still trying to diagnose. I thought it might be normal board behavior but it sounds not quite right. He says it stabilizes after 5 seconds or so. Hopefully someone more knowledgeable of the board can help here.

Before I paste the code - the other approaches are pretty much the same and probably lighter weight than this but since perkunas is actually using this at the moment I include it so everyone can be on the same page (so the hardware guys don't blame the software too soon or unjustly!) Again, the AwaitCompletionOf is an adaptation of a function that was heavily inspired by forum member Corey Kosak.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;



namespace Example
{
  public class Program
  {
      public const int SecondMs = 1000;
      public const int MinuteMs = 60 * SecondMs;
      public const int HourMs = 60 * MinuteMs;
      public const int DayMs = 24 * HourMs;
      public const int WeekMs = 7 * DayMs;

      static OutputPort ph = new OutputPort(Pins.GPIO_PIN_D2, true);
      static OutputPort b = new OutputPort(Pins.GPIO_PIN_D3, true);
      static OutputPort a = new OutputPort(Pins.GPIO_PIN_D4, true);
      static OutputPort drain = new OutputPort(Pins.GPIO_PIN_D5, true);
      static OutputPort solenoid = new OutputPort(Pins.GPIO_PIN_D6, true);
      static OutputPort heater = new OutputPort(Pins.GPIO_PIN_D7, true);
      static OutputPort controller = new OutputPort(Pins.GPIO_PIN_D8, true);


      public delegate void VoidAction();

      public static void Main()
      {
          try
          {
              while (true)
              {
                  Method_1();
                  AwaitCompletionOf(new VoidAction[] { Method_2, Method_3, Method_4, Method_5 });
                  AwaitCompletionOf(new VoidAction[] { Method_6, Method_7 });
                  Method_8();
                  Thread.Sleep(10000);
              }
          }
          catch
          {
              //Something has gone wrong; reset to a safe condition
          }
      }

      void RunTheStuff()
      {
      }

      public static void Method_1()
      {
          drain.Write(false);
          Thread.Sleep(16 * MinuteMs);
          drain.Write(true);
      }
      public static void Method_2()
      {
          solenoid.Write(false);
          Thread.Sleep(16 * MinuteMs);
          solenoid.Write(true);
      }
      public static void Method_3()
      {
          a.Write(false);
          Thread.Sleep(11 * MinuteMs + 7 * SecondMs);
          a.Write(true);
      }
      public static void Method_4()
      {
          b.Write(false);
          Thread.Sleep(6 * MinuteMs + 3 * SecondMs);
          b.Write(true);
      }
      public static void Method_5()
      {
          ph.Write(false);
          Thread.Sleep(3 * SecondMs);
          ph.Write(true);
      }
      public static void Method_6()
      {
          while (true)
          {
              controller.Write(false);
              Thread.Sleep(1 * SecondMs);
              controller.Write(true);
              Thread.Sleep(10 * MinuteMs);
          }
      }
      public static void Method_7()
      {
          heater.Write(false);
          for (int i = 0; i < 14; i++)
          {
              solenoid.Write(false);
              Thread.Sleep(20 * SecondMs);
              solenoid.Write(true);
              Thread.Sleep(1 * DayMs);

          }
          heater.Write(false); // added this
      }
      public static void Method_8()
      {
          drain.Write(false);
          Thread.Sleep(16 * MinuteMs);
          solenoid.Write(false);
          Thread.Sleep(16 * MinuteMs);
          Thread.Sleep(30 * MinuteMs);


      }

      public static void AwaitCompletionOf(VoidAction[] actions, int millsecondsTimeout = -1)
      {
          ManualResetEvent mre = new ManualResetEvent(false);
          Thread t = null;
          int total = 0;
          int target = actions.Length;

          for (int i = 0; i < target; i++)
          {
              if (null != t)
                  t.Start();

              int captured = i;

              t = new Thread(() =>
              {
                  try
                  {
                      actions[captured]();
                  }
                  finally
                  {
                      if (Interlocked.Increment(ref total) == target)
                          mre.Set();
                  }
              });
          }

          if (null != t)
          {
              t.Start();
              mre.WaitOne(millsecondsTimeout, false);
          }
      }
  }
}



#27025 Netduino Go Firmware v4.2.0

Posted by ErikN on 12 April 2012 - 06:15 AM in Netduino Go

Here is the Netduino Go firmware.

Version: 4.2.0 (version 4.2.0.0)


Is this what is already flashed on the boards or did they ship with a beta of somesort?



#27094 Introducing Netduino Go

Posted by ErikN on 12 April 2012 - 07:26 PM in Netduino Go

The firmware source patch for GCC-based toolchains will be released soon. Please stay tuned.


Tease. Posted Image



#27158 Bay Area Maker Faire Meetup Planning

Posted by ErikN on 13 April 2012 - 03:39 PM in General Discussion

Wish I could be there! I've only been to one so far, NYC last year. And I'll be going again this year. I just think it'd be sweet to see how the west coast Faire differs. EDIT: Awww Man! Adam Savage will be speaking at the Bay Area Faire. /sad_panda



#27161 Bay Area Maker Faire Meetup Planning

Posted by ErikN on 13 April 2012 - 04:11 PM in General Discussion

Artist? I was thinking about just the logo on the front, maybe on the back, pretty simple :D


You should consider an easy-to-read/remember shortlink or QR code for those too shy to ask about it. Make it easy for them to see or secretly scan to keep it on record to look up later!



#27333 Netduino Go firmware source for GCC

Posted by ErikN on 16 April 2012 - 02:31 AM in Beta Firmware and Drivers

Awesome job! Can't wait to get my compilers on it!



#27394 Free webcast: Getting Started with Netduino + Netduino Go!

Posted by ErikN on 16 April 2012 - 07:15 PM in General Discussion

The recorded session is now available.



#27399 .NET Micro Framework 4.3 Roadmap

Posted by ErikN on 16 April 2012 - 07:44 PM in General Discussion

Sweet! And we tentatively had this for 7 months. I can't wait for then to have already happened!



#27502 Two Fading LED's

Posted by ErikN on 17 April 2012 - 10:55 PM in Netduino 2 (and Netduino 1)

You can't do this with a single thread. You'll need to use 2 threads (and probably want to synchronize them in case one rushes the other by a little bit; otherwise the time difference could grow greater and greater with each loop.) I'd do it like this: MainThread: Prepare things [PWM ports, semaphore or reset events for synchronization] Create 2 threads; one to execute the dimming of LED 1, one to execute the dimming of LED 2 (possibly the same method but with invert parameter?) Methods loop forever just changing brightness of their LED. Start both threads. Thread.Sleep(Infinity); To prevent their timing from drifting use thread signaling. Have each thread block and wait at the end of their loop until the other thread also reaches their end before letting the loop restart. You could use two autoresetevents - one for each thread? I'm not sure if there's a potential for deadlock but I can't see how (assuming you call Set before Wait) but you could attempt to avoid it with a timeout in the wait.



#27558 Two Fading LED's

Posted by ErikN on 18 April 2012 - 04:11 PM in Netduino 2 (and Netduino 1)

Ah, I misunderstood. I thought you were trying to achieve the CW2's second timing diagram.



#27561 Two Fading LED's

Posted by ErikN on 18 April 2012 - 04:25 PM in Netduino 2 (and Netduino 1)

Also true. I'd thought about that this morning. I tend to over-complicate things I guess.



#27734 Netduino Go! RGB Umbrella

Posted by ErikN on 20 April 2012 - 06:14 PM in Project Showcase

I think you could pull off the dark wizard look quite easily! I'm interested to see what you come up with. I've seen the "Blade Runner" style umbrellas before but they've always seemed too weak to use in any sort of ambient light. As further ideas, I think having a button to immediately switch to a red and orange swirling pattern would be useful to you. When you get angry you can hold the button down and switch into this mode to look extra menacing. When you've calmed you can release and let the colors go back to swirling through a fuller range of color.



#27749 BlueSMiRF Silver (Bluetooth)

Posted by ErikN on 20 April 2012 - 09:03 PM in Netduino Plus 2 (and Netduino Plus 1)

I see from the datasheet a couple things. First, it looks like the default software mode speed is indeed 115,200,8,N,1 but there appears to be a dip switch as well that will set the speed to a fixed 9600.


"Baud Rate select - used to configure 9600 or software selected (default=115K ) baudrate. If the switch is
OFF, the stored baudrate setting will be used. When the switch is in the ON position, the baudrate will be set
to 9600 regardless of the software setting."



Can you check this and verify you're using the proper settings? I'd recommend turning this switch on and communicating via 9600 to ensure your code is working and then try again at 115,200 and ensure everything is still working. It might be that 115,200 is just too fast (seems unlikely).



#27761 Netduino Go! RGB Umbrella

Posted by ErikN on 20 April 2012 - 09:58 PM in Project Showcase

+eleventy



#27775 Google+ Plus Hangout Tonight

Posted by ErikN on 21 April 2012 - 12:36 AM in General Discussion

Short notice but I'm down for it. I won't have anything prepared to show though. I could talk about using NuGet though.



#27857 Asynchronous Delegates

Posted by ErikN on 21 April 2012 - 10:10 PM in General Discussion

NETMF uses software threading and from code I've written and what I've seen from others, you can do asynchronous programming. I haven't specifically used Begin- and EndInvoke rather using Thread and ThreadStart.



#27946 TRIAC's for switching 24VAC?

Posted by ErikN on 23 April 2012 - 02:31 PM in General Discussion

SparkFun has a couple EL Wire controller boards which use Triacs to switch high frequency AC from an inverter to the wire. One model has a microcontroller on board and the other is meant to be used as a shield.

I've never looked at the schematics to see how this differs from what I know about SSRs so this is presented as informational and entertainment purposes only. If you learn something it's your own fault.

Enjoy!



#28359 Bay Area Maker Faire Meetup Planning

Posted by ErikN on 30 April 2012 - 07:43 PM in General Discussion

But big chance I will be at maker faire NY in September!


Sweet! Or as they say in your language, dit is echt het meest opwindende nieuws!



#28721 DIY Go Cables

Posted by ErikN on 09 May 2012 - 03:39 PM in Netduino Go

I found the connectors but even in volume they were over $1 each, and you obviously need 2 of them, making them more pricey than buying assembled cables for the most part.


But the pre-assembled are in specific lengths. The OP isn't suggesting this would be cheaper but rather would lead to more custom lengths and would make use of the currently wasted ribbon cables.



#32750 Family Photo

Posted by ErikN on 27 July 2012 - 04:21 AM in Netduino Go

I'm constantly surprised how small and elegant these modules are!



#33140 Mars landing tonight -- meetup online and in Times Square

Posted by ErikN on 05 August 2012 - 08:40 PM in General Discussion

I'll be in Times Square! I'm looking forward to it - there's been some talk about people dressing up as Martians. I'm not sure how to go as fossilized remains so I might sit the cosplay out.



#33143 Mars landing tonight -- meetup online and in Times Square

Posted by ErikN on 05 August 2012 - 11:49 PM in General Discussion

I don't know if this'll put a damper on things - but it just opened up some heavy rain over my apartment! I'm 3 blocks away from the event location in Times Square.




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.