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.

chungenhung

Member Since 09 Jul 2012
Offline Last Active Jun 04 2013 03:28 PM
-----

Posts I've Made

In Topic: IC or transistor to act as relay switch

03 June 2013 - 07:39 PM

Couldn't you hard reset your PC by holding the power button until it turns off, waiting 10 seconds, then turning it on again? Or do you need to automate this?

I neede a way to do this when I am away from the PC.


In Topic: IC or transistor to act as relay switch

31 May 2013 - 10:06 PM

I would recommend getting a bag of pnp and npn transistors, a bread board and following some tutorials before you start trying to interface with pc hardware. Out of interest why are you trying to replicate switch functionality when you could use wake on lan to do the same thing?

Only reason I want this is b/c what if the PC got a hard freeze, and need a hard reset.

WOL can only wake up a PC when it is OFF. In the case that the PC freezes, it would still be considered ON.

Let me know if there are other easier way around this.


In Topic: Servos in NETMF 4.2

21 September 2012 - 02:51 AM

In "Public class Program", I have "static Microsoft.SPOT.Hardware.PWM _servo;".
In "public static void Main()", I have "_servo = new Microsoft.SPOT.Hardware.PWM(PWMChannels.PWM_PIN_D10, 20000, 1500, PWM.ScaleFactor.Microseconds, false);"
In "static void button_OnInterrupt", I have "_servo.duration = 1500;". Now it's complaining about "duration".
Error message "Microsoft.SPOT.Hardware.PWM does not contain a definition for duration."

Nevermind. The error is gone now.
Thanks!

In Topic: Servos in NETMF 4.2

21 September 2012 - 02:50 AM

In "Public class Program", I have "static Microsoft.SPOT.Hardware.PWM _servo;". In "public static void Main()", I have "_servo = new Microsoft.SPOT.Hardware.PWM(PWMChannels.PWM_PIN_D10, 20000, 1500, PWM.ScaleFactor.Microseconds, false);" In "static void button_OnInterrupt", I have "_servo.duration = 1500;". Now it's complaining about "duration". Error message "Microsoft.SPOT.Hardware.PWM does not contain a definition for duration."

In Topic: Servos in NETMF 4.2

21 September 2012 - 02:24 AM

Now I have new errors.

namespace NetduinoPlusApplication1
{
    public class Program
    {
        var servo; //ERROR "The type or namespace name 'var' could not be found."

        public static void Main()
        {
            //********************************************************
            // Row pins. The keypad have 4 rows.
            Cpu.Pin[] RowPins = { Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D4 };

            // Col pins. The keypad have 3 columns.
            Cpu.Pin[] ColPins = { Pins.GPIO_PIN_D3, Pins.GPIO_PIN_D2, Pins.GPIO_PIN_D1 };

            // Initializes the new keypad
            MatrixKeyPad kb = new MatrixKeyPad(RowPins, ColPins);

            // Bind both events
            kb.OnKeyDown += new NativeEventHandler(kb_OnKeyDown);
            kb.OnKeyUp += new NativeEventHandler(kb_OnKeyUp);


            InterruptPort button = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh); //On Board Button. Interrrupt when buttom is pressed down.
            button.OnInterrupt += new NativeEventHandler(button_OnInterrupt);

            //SERVO. ERROR "An object reference is required for the non-static field, method, or property 'NetduinoPlusApplication1.Program.servo' ".
            servo = new Microsoft.SPOT.Hardware.PWM(PWMChannels.PWM_PIN_D10, 20000, 1500, PWM.ScaleFactor.Microseconds, false); //Declare servo. 20,000 means 20ms, 1500 means the starting position. 
            //The servo have a range of 750-2250ms.    

            // Lets wait forever for events to occur
            Thread.Sleep(Timeout.Infinite);
        }


        static void button_OnInterrupt(uint data1, uint data2, DateTime time)
        {

            Debug.Print("OnBoard Button Pressed");
            servo.Duration = 1500; //THIS DOESN'T WORK.
            servo.start(); //THIS DOESN'T WORK.
        }

    }

}

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.