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.Netduino;
namespace hallopachube
{
public class Program
{
public static void Main()
{
// write your code here
const string apikey = "your pachube api key";
const string feedid = "your pachube feed id";
const int samplingperiod = 20000;
const double maxvoltage = 3.3;
const int maxadcvalue = 1023;
var voltageport = new AnalogInput(Pins.GPIO_PIN_A1);
var lowport = new OutputPort(Pins.GPIO_PIN_A0, false);
var highport = new OutputPort(Pins.GPIO_PIN_A2, true);
while (true)
{
waituntilnextperiod(samplingperiod);
int rawvalue = voltageport.Read(500);
double value = (rawvalue * maxvoltage) / maxadcvalue;
string sample = "voltage," + value.ToString("f");
Debug.Print("new message: " + sample);
PachubeClient.send(apikey, feedid, sample);
}
}
static void waituntilnextperiod(int period)
{
long now = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
var offset = (int)(now % period);
int delay = period - offset;
Debug.Print("sleep for " + delay + " ms/r/n");
Thread.Sleep(delay);
}
}
}
im getting errors
if annyone could please help