VS2017 remote debugging LattePanda (C #)

reason

LattePanda is a credit card sized board running Win10 system development and integration of a microcontroller Arduino Leonardo, various sensors can be extension of the module. After re-installation of the system to streamline the Win10 disk 6G occupy much space. To save space, do not intend to install the Visual Studio development environment in the development board, the use of remote debugging methods.

1

Ready to work

The machine download and install the free Community Edition of Visual Studio 2017 (address: https://visualstudio.microsoft.com/zh-hans/downloads/?rr=https%3A%2F%2Fcn.bing.com%2F )

Download Visual Studio 2017 Remote Tools x64 version (at the above address, you can do)

Download LattePanda.Firmata class library (address: https://github.com/LattePandaTeam/LattePanda-Development-Support )

LattePanda download and install Arduino IDE (address: https://www.arduino.cc/en/Main/Software?setlang=cn )

The machine and are mounted LattePanda TeamViewer, facilitate remote control and file transfer

LattePanda

Use a debug build directory, such as C: \ demo, and share

Record ip address

Run Arduino IDE, find sample StandardFirmata

Development Board select Arduino Leonardo, the corresponding COM port selection

Click Upload, the code is compiled and downloaded to the controller in LattePanda onboard Arduion, close Arduino IDE window

Install Visual Studio 2017 remote tools, or directly to native Visual Studio 2017 directory of remote copy tool inside the LattePanda

Run x64 directory of msvsmon.exe, start the remote debugger

In Tools - Options, recognizing the need windows authentication, idle time is set to 0

The machine

Running VS2017, create a new C # console application

Right project name, select Add Existing Item

Select LattePanda.Firmata directory of Arduino class files

Open and modify the project file Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Threading;
using LattePanda.Firmata;

namespace ConsoleApp1
{
    class Program
    {
        static Arduino arduino = new Arduino();

        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            arduino.pinMode(13, Arduino.OUTPUT);

            while (true)
            {
                arduino.digitalWrite(13, Arduino.HIGH); //蓝灯亮
                Thread.Sleep(1000);
                arduino.digitalWrite(13, Arduino.LOW); //灭
                Thread.Sleep(1000);
            }
        }
    }
}

Open the project properties are modified using the generated output path bar and debug remote computer

Click Start, shared directory in LattePanda generate exe executable file and run, you can see LattePanda board blue led flashes at 1 second intervals

The first remote login LattePanda, you need to enter a user name and password

Using VS2017, C # debugging LattePanda end of the experiment

 

Guess you like

Origin blog.csdn.net/mcubbs/article/details/86682778