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.

vader7071

Member Since 19 Nov 2013
Offline Last Active Dec 20 2019 07:39 PM
-----

Topics I've Started

Sub routines with LED flash

04 October 2016 - 01:15 AM

Here is the issue I have,  I am using a Netduino 1 to control (4) LEDs.

 

I need each LED to flash at a different rate.

 

Below is the code I have created so far.

 

Here is my issue.  The brth() Thread.sleep(x) seems to be controlling everything.  I need to run each of these subs independently so if I adjust brth() it won't affect tLed(), mLed(), or bLed(), or where none of the others affect each other.

The bottom line question. What did I do wrong?

 

Thank you in advance for your help.

Oh, forgot to mention the bad news.  I need this working in 2 days.  Yeah.  I just had this idea.  I'm an idiot.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
 
namespace VaderChestBox
{
  public class Program
  {
    // Variables
 
    //Digital Inputs
 
    //Digital Outputs
    static OutputPort led1 = new OutputPort(Pins.GPIO_PIN_D1, true);
    static OutputPort led2 = new OutputPort(Pins.GPIO_PIN_D2, false);
    static OutputPort led3 = new OutputPort(Pins.GPIO_PIN_D3, true);
    static OutputPort breath = new OutputPort(Pins.GPIO_PIN_D4, false);
 
    //Analog Inputs
 
    //Analog Outputs
 
    public static void Main()
    {
      // write your code here
 
      while (true)
      {
        tLed();
        mLed();
        bLed();
        brth();
      }
    }
 
    public static void tLed()
    {
      // flash Top LED (LED1).  1.5 second cycle 50% duty.
      led1.Write(!led1.Read());
      Thread.Sleep(750);
    }
 
    public static void mLed()
    {
      // flash Middle LED (LED2).  3.7 second cycle 50% duty.
      led2.Write(!led2.Read());
      Thread.Sleep(1850);
    }
 
    public static void bLed()
    {
      // flash Bottom LED (LED3).  2.35 second cycle 50% duty.
      led3.Write(!led3.Read());
      Thread.Sleep(1175);
    }
 
    public static void brth()
    {
      // Trigger Breath Module.  5.1 second cycle 2% duty.
      breath.Write(true);
      Thread.Sleep(100);
      breath.Write(false);
      Thread.Sleep(5000);
    }
  }
}

Ham Radio Repeater Controller

16 June 2016 - 12:29 AM

I am interested in making a repeater controller for my ham radio gear,

 

I have a Netduino 1.  The way this woks, I will have 2 radios connected to this "controller".  Radio 1 and Radio 2

 

When radio 1 receives a signal, the controller will key up the transmit on radio 2 and the audio from radio 1 will be sent into the "mic" of radio 2.

 

Then when radio 2 receives a signal, the controller will key up the transmit on radio 1 and the audio from radio 2 will be sent into the "mic" of radio 1.

 

There are more safeties and controls that need to be added, but that is the general premise.  Has anyone tried this before? 


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.