Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netduino no "Console.WriteLine", Console does not exist in current context

I cannot seem to get my very simple netduino program to write to the debug console; VS throws an error

The name 'Console' does not exist in the current context

Any ideas what might cause it to not exist?

using System;
using System.Text;
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;

namespace LumenReader
{
public class Program
{
    public static void Main()
    {

        AnalogInput photoResistor = new AnalogInput(Pins.GPIO_PIN_A0);
        int photoVolt;
        while (true)
        {
            photoVolt = photoResistor.Read();
            Console.WriteLine(photoVolt);
        }

    }

}
}

Edit

Debug.Print does work

like image 596
wmarbut Avatar asked Jan 10 '13 04:01

wmarbut


1 Answers

There is no Console on embedded devices. Hence, as you found, you must use Debug.Print.

like image 191
kfuglsang Avatar answered Oct 27 '22 01:10

kfuglsang