Hello world, you know.

Source: Internet
Author: User

. Net MF series Directory: http://www.cnblogs.com/lscy/archive/2012/08/23/2651768.html

 

In the previous article, we will install the development environment and create an MF console project.CodeWrite: Hello world.

Not to mention, add the code first.

View code

UsingSystem;UsingMicrosoft. spot;/// <Summary>///Print Hello World/// </Summary>Private Static VoidHelloworld () {Debug. Print ("Hello world !~");}

 

In MF, no moreConsole, The output information can only beDebug. PrintThe code is quite simple.

Next, set the project properties, as shown in the figure:

The target framework is. Net micro framework 4.2Instead. Netframework. Then, set the code deployment method to compile the code and write it to Explorer 1.

 

Control Panel wiring:

The USB connector is directly connected to the USB port of the computer. The USB driver will provide a download link later.

COM1 is connected to the serial port of the computer. If your computer does not have a serial port, use USB to 232. If you want to use it, go to du Niang.

Note: USB cables are mainly usedProgramDeployment, COM1 is used for debugging information output, and com2 next to it does not seem to work very well. I don't know why. (Hardware is not understood, so it is a cup)

Episode: Do you still remember this figure?

Open this EXE file.

This is the built-in Deployment Tool of. Net MF. It has many features and I will only use one: Ping. I hope you will discover it together and teach me more.

Select according to the above method, and then click the ping button

If tinyclr appears, Explorer 1 is connected successfully. If no information is returned or no data response is returned, the connection fails. Check your connection.

After the connection is successful, this tool can be disabled. Of course, there are some other features in it. You can explore and share it yourself. I have limited capabilities (I really can't understand what it is ).

The episode ends.

Are you quite familiar with this? Select the transmission mode and device, save the project properties, and the preparation is complete.

Compile:

The generation is the same as that of the. NET project.

Deployment:

Then, pay attention to the status bar below

Start preparing deployment status:

Deployment successful status

Next, "Explorer 1" can output "Hello world !~" .

How to view debugging information:

COM1 is used to output debugging information. Connect COM1 to your computer and open the serial port debugging tool. Here, I use the big silly serial port debugging tool and select the serial port number. The baud rate is fixed to 115200bps.

Refer to settings and open the serial port.

The last step was an exciting moment. Press the reset key on Explorer 1 to start the program.

The output information is as follows:

. netmf v4.2.0.0

newlife_tracker1, build Date:

Jul 28 2012 21:38:11

arm compiler version 410894

tinyclr (build 4.2.0.0)

starting...

created ee.

started hardware.

NO debugger!

Create ts.

loading start at 8031818, end 8043b98

Assembly: mscorlib (4.2.0.0)

Assembly: Microsoft. Spot. Native (4.2.0.0)

Assembly: Microsoft. Spot. Hardware (4.2.0.0)

Assembly: Microsoft. Spot. Update (4.2.0.0)

Assembly: mfupdate (4.2.0.0)

Assembly: Microsoft. Spot. Hardware. PWM (4.2.0.1)

Assembly: Microsoft. Spot. Hardware. SerialPort (4.2.0.0)

Assembly: Microsoft. Spot. Hardware. USB (4.2.0.0)

loading deployment assemblies.

attaching deployed file.

Assembly: mfconsoleapplication1 (1.0.0.0)

resolving.

ready.

Hello world !~

done.

waiting for debug commands...

The black text is the output information of our code. You can view the other content by yourself.

Code 2:

Code 3:

Resource file:

Chinese characters cannot be output due to the lack of Chinese character libraries. Wait for @ to improve !~~

Reminder:

When deploying a program, you cannot press the reset key of Explorer 1, which may cause a blue screen or restart the computer.

 

Download: Explorer USB driver

 

Related Resources:

1. QQ group: 1600838. 2. Blog: http://www.cnblogs.com/nnhy/ 3. Forum: http://www.53wb.com/

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.