2013年10月18日 星期五

Chrome App (1) - Arduino LED

Chrome App から Arduino を制御
Chrome App to control Arduino
以Chrome App 控制 Arduino

I used to spend quite a lot of time on driver development and embedded system development for both my day job and hobby, but not web development. It doesn't  mean I don't like web development, I just didn't find a good motivation. Actually, more and more of my friends "switch" to web based development that make me feel I should start playing web programming.

Recently, I find that Chrome App provide USB and Serial API, which mean I can access hardware from web program (or browser), that is really attractive to me, I think there will be a lot of interesting embedded system project I can do with Chrome App, and may be even Cloud applications.

I'm familiar with C/C++,  but not Javascript. So this is actually a Javascript learning exercise, well, an embedded system approach.

My code is mainly based on the following two Chrome App sample,
https://github.com/GoogleChrome/chrome-app-samples/tree/master/serial/ledtoggle
https://github.com/GoogleChrome/chrome-app-samples/tree/master/servo

and API reference from
http://developer.chrome.com/apps/serial.html

The ledtoggle sample code from the Google, is already a Chrome-app to Arduino applications, I just simplify it, and combine some code from the servo sample (mainly the Port builder part).

For the Arduino code, it is almost the same as the one in ledtoggle, except that I change the LED port to the pin 13(on board LED of UNO).

You can find my sample code here
https://github.com/winghackerspace/chromeapp_sample/tree/master/arduino_test_led

沒有留言:

張貼留言