我似乎无法将非常简单的 netduino 程序写入调试控制台; VS 抛出错误
The name 'Console' does not exist in the current context
有什么想法可能会导致它不存在吗?
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);
}
}
}
}
编辑
Debug.Print
有效
最佳答案
嵌入式设备上没有控制台。因此,正如您所发现的,您必须使用 Debug.Print。
关于.net - Netduino no "Console.WriteLine",控制台在当前上下文中不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14250645/