未加星标

Diving into Javascript on Microcontrollers

字体大小 | |
[前端(javascript) 所属分类 前端(javascript) | 发布者 店小二04 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏
Diving into javascript on Microcontrollers using thingsSDK with AndrewChalkley

Andrew Chalkley is the host of That Maker Show , Project Lead of @thingsSDK , and a Teacher @treehouse . Hosting the interview is Taron Foxworth , the Developer Evangelist at Losant.


Diving into Javascript on Microcontrollers

In this conversation, we focused on thingsSDK , which is a set of tools for web developers to create internet-connected hardware projects using Javascript. We also cover:

How Andrew got started with hardware The 3 fundamental problems when it comes to hardware and the internet of things Why you should use Javascript when building an app for IoT The challenges when building a Javascript platform for hardware How you can get started and contribute to thingsSDK Andrew, could you give a little background about yourself?

Taron Foxworth:Before we dive into thingsSDK, could you give a little background about yourself?

Andrew Chalkley:Sure. By day I teach at online school Treehouse where I teach JavaScript and SQL among other things. By night, I’m tinkering:) I host That Maker Show , which aims to break down the barriers to entry into the Maker Movement. I’m also the project lead of thingsSDK.

I’ve been working with computers for most all of my professional life. I’m self-taught, and had development jobs inphp, Ruby, Java and Objective-C. I’m currently stabilized around JavaScript:)

Taron Foxworth:The self-taught jack of all trades! For the record, That Maker Show is awesome! The Introduction to 3D Printing episode is what got me hooked on 3D printing.

What made you interested in becoming amaker?

Andrew Chalkley:I’ve learned so many programming languages over the years. It didn’t feel challenging to me anymore. The excitement of pushing pixels on a screen had lost it’s appeal.

So I wanted to stretch myself and get involved with hardware. I feel that I thrive the most at the edge of my current limits. And hardware was a that outlet.

Taron Foxworth:So, you turned to the physical world. Nice

What hardware or framework did you startwith?

Andrew Chalkley:I started with an Arduino . The way I learn the best is to immerse myself in the language of the thing I’m trying to learn. I watched a ton of Adafruit videos and other maker videos online.

Then, I did a write up “ The Absolute Beginner’s Guide to Arduino ”. It still gets lots of traffic and people love it and it seems to resonate with the beginner ― because I was a beginner too:)

Taron Foxworth:Yes! I love that. Beginners should write too. It sounds like Arduino + Adafruit is a perfect hardware starter kit. This leads us now to thingsSDK.

Can you tell us what thingsSDK is, and how you came up with theidea?

Andrew Chalkley:There are 3 fundamental problems when it comes with hardware and the internet of things.

Firstly, the cost of these development boards are quite high ― especially if you want to connect an Arduino to the internet. Anywhere between $50 and $90 dollars. Secondly, the programming languages aren’t that user friendly. C and C++ have a lot of challenges to new hardware enthusiasts even if you’ve been programming in a more modern language. Thirdly, even if you could get a programming language on the device, there were no modern developer workflows for the professional developer. You had to use clunky IDEs.

Out of this frustration came thingsSDK. I run a JavaScript and Internet of Things group in Portland, OR. We around 500 people on the books with 30 40 people turn up every month. At the end of one our meetups, I was venting my frustration about the points above. And a close friend of mine, Craig Dennis , offered to help tackle this problem with me.

The first problem ― cost. We wanted to be able open this up to as many people as possible. The ESP8266 is a cheap microcontroller module with wifi built in. Costs between $2 ― $4 for a development board!

The ESP8266 can run Lua and can have Arduino sketches flashed to it. Around this time last year Micropython was doing a Kickstarter to be ported to the boards. And Gordon Williams, of Espruino , started distributing his runtime binaries for the ESP8266. You can think of the Espruino as the Node of microcontrollers.

We created a GUI called Flasher.js to have a one click install for your ESP8266 based development boards, like the NodeMCU and the Adafruit Feather HUZZAH.

Flasher.js reduced the amount of time and friction developers had to spend getting JavaScript on the device.

To solve the third and final problem, the modern work flow, I wanted to create a CLI utility that was opinionated enough that it would be easy for current JavaScript web developers. They didn’t have to learn anything new, all they need to know is Node and npm. By simply issuing one command you can deploy modern ES2015 JavaScript to a microcontroller.

I put a short video together showing off the tools here:

Taron Foxworth:Oh so beautiful. You’re bringing the power of a convenient toolchain to the physical world. It looks like we have a question from a community member:

Why should I use Javascript for doingIoT?

Why should I use Javascript for doing IoT?

- Martin Bavio

Andrew Chalkley:Great question. Because it’s not C. I jest. JavaScript is great for event-driven programming. It’s asynchronous too. You don’t have to keep checking on the state of a button. You can implement a handler for when a button presses. When someone presses the button it triggers the code. Same goes for HTTP requests. While data is loading, you can display things on a screen. Writing non-blocking C code is possible but is challenging. To a JavaScript developer, it’s second nature. JavaScript as meant for hardware!

I have a story about how Marvell (a chip manufacturer) was building an eReader with Sony. In Japan, the firmware and UI were written in C. In the US the UI was written in JavaScript. When compa

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

主题: JavaJavaScriptArduinoLuaPHPObjective-CC++RubySQLCU
分页:12
转载请注明
本文标题:Diving into Javascript on Microcontrollers
本站链接:http://www.codesec.net/view/532587.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 前端(javascript) | 评论(0) | 阅读(77)