Netduino否]; Console.WriteLine",控制台不会在目前的情况下存在 [英] Netduino no "Console.WriteLine", Console does not exist in current context

查看:155
本文介绍了Netduino否]; Console.WriteLine",控制台不会在目前的情况下存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法让我很简单netduino程序写入调试控制台; VS引发错误

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);
        }

    }

}
}

修改

Debug.Print 不工作

推荐答案

目前在嵌入式设备上没有控制台。因此,当你发现,你必须使用Debug.Print。

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

这篇关于Netduino否]; Console.WriteLine",控制台不会在目前的情况下存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆