I tried following these steps on this website:
http://adeneo-embedd...-framework.html
But I get this error:
An unhandled exception of type 'System.NotSupportedException' occurred in LEDInterop.dll
I'm not sure if I'm doing this right. Do you have any advice on this? Would this strategy increase the speed of the program?
Or if its easy enough, if somebody could translate this to native code for me
I see walkthroughs online, but can't seem to get them to work and none post the files to see how they actually did it.
Any help is appreciated. I need this done for my thesis due in a couple weeks!
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using System.IO;
namespace Thesis
{
class FlashUtility
{
public class Program
{
public static void Main()
{
// write your code here
using (var filestream = new FileStream(@"SDdata.txt", FileMode.Create))
{
const double maxVoltage = 3.3f;
const double maxAdcValue = 4095;
StreamWriter streamWriter = new StreamWriter(filestream);
var voltagePort = new AnalogInput(Cpu.AnalogChannel.ANALOG_1);
var lowPort = new OutputPort(Pins.GPIO_PIN_A0, false);
var highPort = new OutputPort(Pins.GPIO_PIN_A2, true);
var num = 0;
while (true)
{
double rawValue = voltagePort.ReadRaw();
if (rawValue > 500)
{
while (num < 30)
{
rawValue = voltagePort.ReadRaw();
double value = (rawValue * maxVoltage) / maxAdcValue;
Debug.Print(rawValue.ToString("f"));
Thread.Sleep(1000); // 1 seconds
num = num + 1;
streamWriter.WriteLine(value.ToString("f"));
}
streamWriter.Close();
break;
}
else
{
}
}
}
}
}
}
}