--micro_out=._.NET Micro Framework-适用于软件人员的硬件-程序员宅基地

技术标签: python  java  字符串  人工智能  大数据  

--micro_out=.

--micro_out=.

I'm definitely a software person. I took EE in school and made an LED class, then a small computer like everyone else, and I know my volts and my amps for the most part, but that's about it. The limits of my skills are somewhere around adding an LED and some resistors to leech power off a USB adapter (which I recently did while working on the Hanselcade retro arcade build).

我绝对是软件人。 我在学校上了EE,并开了LED课,然后像其他所有人一样参加了一台小型计算机,我基本上了解我的伏特和安培,但是仅此而已。 我的技能极限是在添加LED和一些电阻器以关闭USB适配器的电源方面(我最近在进行Hanselcade复古街机构建时做了此操作)。

I look at hardware guys like Clint Rutkas in awe. I mean, seriously, who builds a T-shirt cannon from scratch for fun? Amazing.

敬畏地看着像Clint Rutkas这样的硬件专家。 我的意思是说,认真地说,谁从头开始建造T恤大炮是为了娱乐? 惊人。

Clint sent me a "Netduino" board today. It's similar to an Arduino board, except it uses the .NET Micro Framework. Micro you say? That's techie-speak for "tiny ass framework." I spoke to Colin Miller about this earlier in the year on video at Channel 9.

克林特今天给我寄了一个“ Netduino”板。 除了使用.NET Micro Framework之外,它类似于Arduino板。 微你说? 那是“小屁股框架”的技术代表。 我在今年早些时候通过第9频道的视频Colin Miller进行了交谈。

Remember my SPOT watch from 2004? That's Smart Personal Objects Technology, which is marketing-speak for "tiny ass framework." That watch is six years old (and still running nicely, sitting on my desk, in fact) and ran .NET.

还记得2004年的SPOT手表吗? 那就是Smart Personal Objects Technology,它在市场上被称为“小屁股框架”。 那只手表已经六岁了(实际上仍然很好地运行,坐在我的桌子上),并且运行.NET

Fast forward to today and I find myself plugging in this Netduino board to my computer and following Pete's Hello World Tutorial and I'm looking at this namespace.

快进到今天,我发现自己将这个Netduino板插入到我的计算机中,并遵循Pete的Hello World Tutorial ,我正在寻找这个名称空间。

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

使用Microsoft.SPOT; 使用Microsoft.SPOT.Hardware;

It's back!

回来了!

Ok, putting it all together in context. The Netduino is a board that's mostly Arduino compatible and has a published schematic (PDF here) so you could make one yourself, if you wanted. The .NET Micro Framework (or TinyCLR as some folks have called it) is literally that - it's a tiny CLR that runs .NET byte code. You can write C# and it'll run on tiny CPUs with tiny amounts of memory (like 64k or something similarly smallish.) It's been with us all this time, and there is an enthusiastic community built around it.

好的,将它们放在上下文中。 Netduino是一个与Arduino基本兼容的电路板,并具有已发布的原理图(此处为PDF ),因此您可以根据需要自己制作。 .NET Micro Framework(或某些人称为TinyCLR)的字面意义是-它是运行.NET字节码的微型CLR。 您可以编写C#,它将在具有少量内存(例如64k或类似的较小内存)的微型CPU上运行。这一直伴随着我们,并且围绕它建立了一个热情的社区。

The .NET Micro Framework 4.1 source is available, it's Open Source under the Apache 2.0 License. (Ya, the new Microsoft is freaking me out also. There's a lot of source that's quietly making its way out under increasingly liberal licenses.) There's lots of great details at Pete's blog.

可以使用.NET Micro Framework 4.1源,根据Apache 2.0许可,它是开放源。 (是的,新的Microsoft也在吓我一跳。在越来越自由的许可下,有很多消息来源悄悄地将其淘汰。) Pete的博客中有很多重要细节

Here's what a Netduino looks like:

Netduino的外观如下:

I'm going to think of some hardware ideas that I can build with this. I also have a more capable and fancy Tahoe II with a touch-screen, accelerometer, buttons and more. If you're looking to prototype something quick, or even build a complete system with an off-the-shelf board, do check it out! Here's what a Tahoe II looks like. Remember, all these boards use C# and .NET. It's amazing writing something for hardware using a language and framework I already know how to use. It literally gets me 80% of the way there from a learning curve perspective.

我将考虑一些可以以此为基础的硬件思想。 我还拥有功能更强大,更漂亮的Tahoe II ,配备触摸屏,加速度计,按钮等。 如果您希望快速制作原型,或者甚至使用现成的板构建完整的系统,请进行检查! 这就是Tahoe II的外观。 请记住,所有这些开发板都使用C#和.NET。 使用我已经知道如何使用的语言和框架为硬件编写一些东西真是太神奇了。 从学习曲线的角度来看,从字面上看,它可以让我80%地达到目标。

There's also the GHI Electronics EMX Development system, so there's a lot of choices.

还有GHI Electronics EMX开发系统,因此有很多选择。

With each of these boards (and others) you just need to get the Micro Framework 4.1, then the SDK for that specific board. It integrates into Visual Studio 2010. If you want to change the product, they are taking proposals in the .NETMF Forums.

对于这些板(和其他板),您只需要获取Micro Framework 4.1 ,然后获取该特定板的SDK。 它已集成到Visual Studio 2010中。如果要更改产品,他们将在.NETMF论坛中提出建议

Directly from Pete's blog:

直接来自Pete的博客

入门 (Getting Started)

What you'll need:

您需要什么:

  • Netduino (Scott: or some other .NET Micro Framework board)

    Netduino (斯科特:或其他一些.NET Micro Framework板)

  • USB Cable (early Netduino units come with the USB cable) (Scott: Usually a micro- or mini-USB)

    USB电缆(早期Netduino设备随附USB电缆) (斯科特:通常为微型USB或微型USB)

  • Visual Studio 2010 and the .NET Micro Framework 4.1 SDK  (you can use C# Express 2010 if you don't have Visual Studio)

    Visual Studio 2010和.NET Micro Framework 4.1 SDK (如果没有Visual Studio,则可以使用C#Express 2010)

  • Netduino SDK in 32 bit or 64 bit, depending on your host OS.

    Netduino SDK( 32位64位) ,具体取决于您的主机操作系统。

  • Optional: shields and starter kits to do cool things with netduino. Existing Arduino shields are compatible. A shield is just an add-on card that fits the pins on the board.

    可选:防护罩和入门套件,用于使用netduino进行散热。 现有的Arduino防护板兼容。 屏蔽层只是适合主板上引脚的附加卡。

The SDK installs a device driver for talking to the Netduino. Make sure you select the one with the appropriate bitness, and that you install it before connecting the Netduino to the PC. I installed the VS2010 bits before the SDK, but it shouldn't matter.

SDK安装了用于与Netduino对话的设备驱动程序。 将Netduino连接到PC之前,请确保选择具有适当位数的适配器,并进行安装。 我在SDK之前安装了VS2010,但没关系。

Once you plug in the Netduino, using the USB cable, you should see the device driver get installed, and the power LED on the board light up.

使用USB电缆插入Netduino后,应该会看到设备驱动程序已安装,并且板上的电源LED点亮。

莫尔斯电码的Hello World (Hello World with Morse Code)

Now I just have the Netduino for now, so I haven't got any attachments. If I was a hardware guy, I'm sure I'd go try to take apart a toaster or remote control and declare something like "this toaster just needs a one OHM resister on pin-out 5A so I can invert the voltage and it'll toast bread over Bluetooth" but I have no idea what that means. All I can do with the Netduino out of the box to flash its LED, as Pete points out:

现在我现在只有Netduino,所以没有任何附件。 如果我是硬件人员,我敢肯定,我会尝试拆开烤面包机或遥控器,并声明类似“此烤面包机只需要在引脚5A上安装一个OHM电阻器,这样我就可以反转电压了“将通过蓝牙烤面包”,但我不知道那是什么意思。 正如Pete所指出的,我可以使用Netduino开箱即用的所有功能来闪烁其LED。

public static void Main() 
{
OutputPort onboardLed = new OutputPort(Pins.ONBOARD_LED, false);

while (true)
{
onboardLed.Write(true);
Thread.Sleep(500);

onboardLed.Write(false);
Thread.Sleep(500);
}
}

Let's make it fancier. How about outputting string using Morse Code? Wikipedia says a dot is 100ms long and a dash is 300ms. How hard can it be?

让我们变得更奇特。 使用摩尔斯电码输出字符串怎么样? 维基百科说一个点长100毫秒,一个破折号长300毫秒。 它能有多难?

I could go to StackOverflow as they had a contest to see who could make the SMALLEST implementation that would take a string and output Morse Code. They have an extremely optimized (for lines of code) solution. But it's extremely silly. Certainly no more silly than me making an LED blink Morse Code as well, but I'd like to be able to actually read my code. ;)

我可以去StackOverflow,因为他们有一个竞赛,看谁可以做一个最小的实现,该实现需要一个字符串并输出莫尔斯电码。 他们有一个非常优化的(针对代码行)解决方案。 但这非常愚蠢。 当然,也比让我让LED闪烁摩尔斯电码更傻,但是我希望能够真正读取我的代码。 ;)

So, here's a naive 10 minutes solution using this guys' two arrays because I'm too lazy to type up the Morse myself. I could have use a Hashtable also, but two parallel arrays was fine too. The .NET Micro Framework, being micro, doesn't have everything the full framework has. However, being open source, it has taken contributions and version 4.1 includes a Hashtable implementation.

因此,这是一个使用这两个人的数组的10天幼稚解决方案,因为我太懒了,无法自己输入摩尔斯电报。 我也可以使用Hashtable,但是两个并行数组也可以。 微型的.NET Micro Framework并不具备完整框架的所有功能。 但是,它是开源的,它已经做出了贡献,并且4.1版包含一个Hashtable实现。

I can even debug directly connected to the board!

我什至可以直接将调试连接到板上!

Here's my sad little program (it was very easy!)

这是我悲伤的小程序(非常简单!)

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.Text;
using System.Collections;

namespace NetduinoApplication1
{
public class Program
{
public static void Main()
{
OutputPort onboardLed = new OutputPort(Pins.ONBOARD_LED, false);

while (true)
{
onboardLed.Write(false);

foreach (char c in " hello scott hanselman ")
{
string morse = ConvertTextToMorse(c);
Debug.Print(c + " = " + morse);
TransmitDotOrDash(onboardLed, morse);
}

}
}

private static Char[] Letters = new Char[] {'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', ' '};

private static String[] MorseCode = new String[] {".-", "-...", "-.-.",
"-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..",
"--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-",
"...-", ".--", "-..-", "-.--", "--..", "-----", ".----", "..---",
"...--", "....-", ".....", "-....", "--...", "---..", "----.", " "};

public static String ConvertTextToMorse(char c)
{
int index = -1;
index = Array.IndexOf(Letters, c);
if (index != -1)
return MorseCode[index];
return string.Empty;
}


public static void TransmitDotOrDash(OutputPort port, string dotordash)
{
foreach (char c in dotordash)
{
TransmitDotOrDash(port, c);
}
Thread.Sleep(300); //gap between letters
}

public static void TransmitDotOrDash(OutputPort port, char dotordash)
{
if (dotordash == ' ')
{
port.Write(false);
Thread.Sleep(700); //gap between words
}
else //it's something
{
port.Write(true);
if (dotordash == '.')
Thread.Sleep(100); //dot
else
Thread.Sleep(300); //dash
port.Write(false);
}
}
}
}

Here's the debug output as I flash "hello scott hanselman" from the board.

这是我从板上刷新“ hello scott hanselman”时的调试输出。

Debug Output from the Netduino Board

All it all, it really couldn't be much easier. Next I'll try to get the Tahoe II working and maybe make a game for the boys. Perhaps hook up a speaker and a proximity sensor and see if they can sneak up on it.

所有这一切,真的很容易。 接下来,我将尝试使Tahoe II正常工作,并可能为男孩们制作游戏。 也许挂上扬声器和接近传感器,看看它们是否可以潜入其上。

Related Links

相关链接

翻译自: https://www.hanselman.com/blog/the-net-micro-framework-hardware-for-software-people

--micro_out=.

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/cunfuxiao7305/article/details/109082245

智能推荐

分布式光纤传感器的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告_预计2026年中国分布式传感器市场规模有多大-程序员宅基地

文章浏览阅读3.2k次。本文研究全球与中国市场分布式光纤传感器的发展现状及未来发展趋势,分别从生产和消费的角度分析分布式光纤传感器的主要生产地区、主要消费地区以及主要的生产商。重点分析全球与中国市场的主要厂商产品特点、产品规格、不同规格产品的价格、产量、产值及全球和中国市场主要生产商的市场份额。主要生产商包括:FISO TechnologiesBrugg KabelSensor HighwayOmnisensAFL GlobalQinetiQ GroupLockheed MartinOSENSA Innovati_预计2026年中国分布式传感器市场规模有多大

07_08 常用组合逻辑电路结构——为IC设计的延时估计铺垫_基4布斯算法代码-程序员宅基地

文章浏览阅读1.1k次,点赞2次,收藏12次。常用组合逻辑电路结构——为IC设计的延时估计铺垫学习目的:估计模块间的delay,确保写的代码的timing 综合能给到多少HZ,以满足需求!_基4布斯算法代码

OpenAI Manager助手(基于SpringBoot和Vue)_chatgpt网页版-程序员宅基地

文章浏览阅读3.3k次,点赞3次,收藏5次。OpenAI Manager助手(基于SpringBoot和Vue)_chatgpt网页版

关于美国计算机奥赛USACO,你想知道的都在这_usaco可以多次提交吗-程序员宅基地

文章浏览阅读2.2k次。USACO自1992年举办,到目前为止已经举办了27届,目的是为了帮助美国信息学国家队选拔IOI的队员,目前逐渐发展为全球热门的线上赛事,成为美国大学申请条件下,含金量相当高的官方竞赛。USACO的比赛成绩可以助力计算机专业留学,越来越多的学生进入了康奈尔,麻省理工,普林斯顿,哈佛和耶鲁等大学,这些同学的共同点是他们都参加了美国计算机科学竞赛(USACO),并且取得过非常好的成绩。适合参赛人群USACO适合国内在读学生有意向申请美国大学的或者想锻炼自己编程能力的同学,高三学生也可以参加12月的第_usaco可以多次提交吗

MySQL存储过程和自定义函数_mysql自定义函数和存储过程-程序员宅基地

文章浏览阅读394次。1.1 存储程序1.2 创建存储过程1.3 创建自定义函数1.3.1 示例1.4 自定义函数和存储过程的区别1.5 变量的使用1.6 定义条件和处理程序1.6.1 定义条件1.6.1.1 示例1.6.2 定义处理程序1.6.2.1 示例1.7 光标的使用1.7.1 声明光标1.7.2 打开光标1.7.3 使用光标1.7.4 关闭光标1.8 流程控制的使用1.8.1 IF语句1.8.2 CASE语句1.8.3 LOOP语句1.8.4 LEAVE语句1.8.5 ITERATE语句1.8.6 REPEAT语句。_mysql自定义函数和存储过程

半导体基础知识与PN结_本征半导体电流为0-程序员宅基地

文章浏览阅读188次。半导体二极管——集成电路最小组成单元。_本征半导体电流为0

随便推点

【Unity3d Shader】水面和岩浆效果_unity 岩浆shader-程序员宅基地

文章浏览阅读2.8k次,点赞3次,收藏18次。游戏水面特效实现方式太多。咱们这边介绍的是一最简单的UV动画(无顶点位移),整个mesh由4个顶点构成。实现了水面效果(左图),不动代码稍微修改下参数和贴图可以实现岩浆效果(右图)。有要思路是1,uv按时间去做正弦波移动2,在1的基础上加个凹凸图混合uv3,在1、2的基础上加个水流方向4,加上对雾效的支持,如没必要请自行删除雾效代码(把包含fog的几行代码删除)S..._unity 岩浆shader

广义线性模型——Logistic回归模型(1)_广义线性回归模型-程序员宅基地

文章浏览阅读5k次。广义线性模型是线性模型的扩展,它通过连接函数建立响应变量的数学期望值与线性组合的预测变量之间的关系。广义线性模型拟合的形式为:其中g(μY)是条件均值的函数(称为连接函数)。另外,你可放松Y为正态分布的假设,改为Y 服从指数分布族中的一种分布即可。设定好连接函数和概率分布后,便可以通过最大似然估计的多次迭代推导出各参数值。在大部分情况下,线性模型就可以通过一系列连续型或类别型预测变量来预测正态分布的响应变量的工作。但是,有时候我们要进行非正态因变量的分析,例如:(1)类别型.._广义线性回归模型

HTML+CSS大作业 环境网页设计与实现(垃圾分类) web前端开发技术 web课程设计 网页规划与设计_垃圾分类网页设计目标怎么写-程序员宅基地

文章浏览阅读69次。环境保护、 保护地球、 校园环保、垃圾分类、绿色家园、等网站的设计与制作。 总结了一些学生网页制作的经验:一般的网页需要融入以下知识点:div+css布局、浮动、定位、高级css、表格、表单及验证、js轮播图、音频 视频 Flash的应用、ul li、下拉导航栏、鼠标划过效果等知识点,网页的风格主题也很全面:如爱好、风景、校园、美食、动漫、游戏、咖啡、音乐、家乡、电影、名人、商城以及个人主页等主题,学生、新手可参考下方页面的布局和设计和HTML源码(有用点赞△) 一套A+的网_垃圾分类网页设计目标怎么写

C# .Net 发布后,把dll全部放在一个文件夹中,让软件目录更整洁_.net dll 全局目录-程序员宅基地

文章浏览阅读614次,点赞7次,收藏11次。之前找到一个修改 exe 中 DLL地址 的方法, 不太好使,虽然能正确启动, 但无法改变 exe 的工作目录,这就影响了.Net 中很多获取 exe 执行目录来拼接的地址 ( 相对路径 ),比如 wwwroot 和 代码中相对目录还有一些复制到目录的普通文件 等等,它们的地址都会指向原来 exe 的目录, 而不是自定义的 “lib” 目录,根本原因就是没有修改 exe 的工作目录这次来搞一个启动程序,把 .net 的所有东西都放在一个文件夹,在文件夹同级的目录制作一个 exe._.net dll 全局目录

BRIEF特征点描述算法_breif description calculation 特征点-程序员宅基地

文章浏览阅读1.5k次。本文为转载,原博客地址:http://blog.csdn.net/hujingshuang/article/details/46910259简介 BRIEF是2010年的一篇名为《BRIEF:Binary Robust Independent Elementary Features》的文章中提出,BRIEF是对已检测到的特征点进行描述,它是一种二进制编码的描述子,摈弃了利用区域灰度..._breif description calculation 特征点

房屋租赁管理系统的设计和实现,SpringBoot计算机毕业设计论文_基于spring boot的房屋租赁系统论文-程序员宅基地

文章浏览阅读4.1k次,点赞21次,收藏79次。本文是《基于SpringBoot的房屋租赁管理系统》的配套原创说明文档,可以给应届毕业生提供格式撰写参考,也可以给开发类似系统的朋友们提供功能业务设计思路。_基于spring boot的房屋租赁系统论文