I am using a G120 module with .Net Micro Framework 4.2.
I am trying to use G120 PINS P1.21 and P1.22 as digital inputs.
From the documentation and the forum I am aware that these are also used for the LCD, so I tried setting the configuration up as “headless” but it didn’t work for me.
This is the code example:
Configuration.LCD.Configurations lcdConfig = new Configuration.LCD.Configurations();
lcdConfig = Configuration.LCD.HeadlessConfig;
if (Configuration.LCD.Set(lcdConfig))
{
PowerState.RebootDevice(false);
}
InputPort ThisPort = new InputPort(Pin.P1_21, true, Port.ResistorMode.PullUp);
I am using these references:
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.IO;
using Microsoft.SPOT.Hardware;
using GHI.Hardware.G120;
using GHI.Premium.Hardware;
This is the exception:
#### Exception System.ArgumentException - 0xfd000000 (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::.ctor [IP: 0000] ####
#### Microsoft.SPOT.Hardware.InputPort::.ctor [IP: 0008] ####
#### Obscured.DigitalSensors::Init [IP: 0022] ####
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
If anyone has successfully used these G120 module ports as digital inputs I would appreciate any advice.