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.
Photo

RC5 I/O problems


  • Please log in to reply
2 replies to this topic

#1 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 08 June 2012 - 10:31 AM

Hi I have recently upgraded to RC5 but I can't get some basic functionality to work.


AnalogInput analogInput1 = new AnalogInput(Cpu.AnalogChannel.ANALOG_0);
    	AnalogInput analogInput2 = new AnalogInput(Cpu.AnalogChannel.ANALOG_0, 8);

I keep getting the following exception.

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll
An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll


Any ideas?

Also does somebody have an RC5 pwm example? I am not sure of the mapping between the Netduino Pin numbers and the SPOT pins.
STEFF Shield High Powered Led Driver shield.

#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 08 June 2012 - 11:09 AM

For analog inputs I'm using:
static SecretLabs.NETMF.Hardware.AnalogInput accX = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A1);

Here is something I'm using for changing the background color of an RGB 4x20 LCD display in RC5. Works great. You should be able to extract what you need from the example. (Note, the PWM pins are 5,6,9,10)

    	// LCD RGB LED Constants
    	const Cpu.Pin LCD_LED_RED = Pins.GPIO_PIN_D10;
    	const Cpu.Pin LCD_LED_GREEN = Pins.GPIO_PIN_D6;
    	const Cpu.Pin LCD_LED_BLUE = Pins.GPIO_PIN_D5;

    	// The LCD's RGB LED (True for LCD, False for an RGB LED)
    	public static RGBLed Led = new RGBLed(LCD_LED_RED, LCD_LED_GREEN, LCD_LED_BLUE, true);

	public class RGBLed
	{
    	/// <summary>Reference to the red pin</summary>
    	private PWM _Red;
    	/// <summary>Reference to the green pin</summary>
    	private PWM _Green;
    	/// <summary>Reference to the blue pin</summary>
    	private PWM _Blue;
    	/// <summary>True when it's common anode, false if it's common cathode</summary>
    	private bool _CommonAnode;

    	public RGBLed(Cpu.Pin RedPin, Cpu.Pin GreenPin, Cpu.Pin BluePin, bool CommonAnode = true)
    	{
        	this._Red = new PWM(RedPin);
        	this._Green = new PWM(GreenPin);
        	this._Blue = new PWM(BluePin);
        	this._CommonAnode = CommonAnode;
    	}

	}


#3 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 08 June 2012 - 11:28 AM

HI Dave But I could no longer see the SecretLabs Libraries so I assumed stupidly that they had rolled them into the Spot libraries. I am just installing the latest SDK now. Thanks for putting me on the right track. Yeah, all back up and running, no code changes thankfully.
STEFF Shield High Powered Led Driver shield.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.