O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Nodebot:
Arduino + Javascript
Desiree Santos
@desisant
•
Consultora ThoughtWorks Brasil
•
Open hardware desde 2009
•
Hobby #1 objetos interativos
•
Coordena (arduinrio...
@desisant
Agenda
•
IDE Sublime + Stino
•
IDE Arduino
•
Instalar nodejs
•
Download john-Five
Desenvolvimento:
100% prática:...
@desisant
Expectativa
Explorar meios diferentes para controlar o arduino
Utilizando ferramentas que aumentam a nossa produ...
@desisant
Arduino is an open-source electronics
platform based on easy-to-use
hardware and software.
It's intended for any...
@desisant
Arte de controlar arduino utilizando a linguaguem Javascript
@desisant
Montar o ambiente:
1) Baixar IDE arduino
→ www.arduino.cc/ → menu Download
2) Sublime Text → http://www.sublimet...
@desisant
Blink – Piscar Led
2 pin (digital)
5mm LED
330 ohm resistor (orange-orange-brown)
jumper wires
@desisant
var five = require("johnny-five");
var myBoard, myLed;
myBoard = new five.Board();
myBoard.on("ready", function(...
@desisant
Semáforo
3 pin (digital)
5mm LED
330 ohm resistor (orange-orange-brown)
jumper wires
@desisant
var five = require("johnny-five");
var board, leds=[], ledPins = [2,3,4,5,6,7,8,9];
board = new five.Board();
bo...
@desisant
•
2 pin header x 4
•
Piezo element
•
jumper wires
Música
@desisant
var five = require("johnny-five");
five.Board().on("ready", function() {
var piezo = new five.Piezo(9);
var val ...
@desisant
• 2 pin header x 4
• 5mm LED
• Pushbutton x 2
• 330 ohm resistor (orange-orange-brown)
• 10k Ohm Resistor (brown...
@desisant
var five = require("johnny-five"),
onButton, offButton, led;
five.Board().on("ready", function() {
onButton = ne...
@desisant
• 2 pin header x 4
• Potentiometer 10k ohm
• 5mm LED
• 330 ohm resistor (orange-orange-brown)
• jumper wires
Pot...
@desisant
var five = require("johnny-five"),
board, myPotentiometer;
board = new five.Board();
board.on("ready", function(...
@desisant
• 2 pin header x 4
• TMP36 Temperature sensor
• jumper wires
Temperatura
@desisant
var five = require("johnny-five");
five.Board().on("ready", function(){
var tempSensor = new five.Sensor("A0");
...
@desisant
@desisant
desisantos.wordpress.com
Dúvidas, suporte para projetos :
Próximos SlideShares
Carregando em…5
×

Nodebot: Arte de controlar arduino com javascript

1.449 visualizações

Publicada em

Workshop hands on no evento mundial Arduino Day(28/03/2015) mostrando na prática como controlar o arduino programando 100% em javascript. Utilizando apenas nodejs + Johnny-five.

Publicada em: Dispositivos e hardware
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • So good, greetings!
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui

Nodebot: Arte de controlar arduino com javascript

  1. 1. Nodebot: Arduino + Javascript Desiree Santos
  2. 2. @desisant • Consultora ThoughtWorks Brasil • Open hardware desde 2009 • Hobby #1 objetos interativos • Coordena (arduinrio) • Modera arduinoBrasil • Hackerspace
  3. 3. @desisant Agenda • IDE Sublime + Stino • IDE Arduino • Instalar nodejs • Download john-Five Desenvolvimento: 100% prática: • Javascript • Eletrônica • Analógico • Digital Referência: node-ardx.org
  4. 4. @desisant Expectativa Explorar meios diferentes para controlar o arduino Utilizando ferramentas que aumentam a nossa produtividade Extrair o melhor que o arduino proporciona Alavancar aprendizado com JS + arduino para desenvolver projetos Javascript é meio e não fm, não é ofcina de javascript Sim Não Não se preocupe, haverá suporte para todos fcarem na mesma página
  5. 5. @desisant Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended for anyone making interactive projects. By Massimo Banzi
  6. 6. @desisant Arte de controlar arduino utilizando a linguaguem Javascript
  7. 7. @desisant Montar o ambiente: 1) Baixar IDE arduino → www.arduino.cc/ → menu Download 2) Sublime Text → http://www.sublimetext.com/2 3) Instalar plugin STINO no sublime text → https://github.com/Robot-Will/Stino 4) Instalar nodejs https://nodejs.org/
  8. 8. @desisant Blink – Piscar Led 2 pin (digital) 5mm LED 330 ohm resistor (orange-orange-brown) jumper wires
  9. 9. @desisant var five = require("johnny-five"); var myBoard, myLed; myBoard = new five.Board(); myBoard.on("ready", function() { myLed = new five.Led(13); myLed.strobe( 1000 ); // make myLED available as "led" in REPL this.repl.inject({ led: myLed }); // try "on", "off", "toggle", "strobe", "stop" (stops strobing) }); blink.js
  10. 10. @desisant Semáforo 3 pin (digital) 5mm LED 330 ohm resistor (orange-orange-brown) jumper wires
  11. 11. @desisant var five = require("johnny-five"); var board, leds=[], ledPins = [2,3,4,5,6,7,8,9]; board = new five.Board(); board.on("ready", function() { // initialize LEDs using a for loop for (var i = 0; i < ledPins.length; i++){ var myLed = new five.Led(ledPins[i]); leds.push(myLed); } function allOn(){ for (var i = 0; i < leds.length; i++) { leds[i].on(); } } function allOff(){ for (var i = 0; i < leds.length; i++) { leds[i].off(); } } function oneAfterAnother() { var delay = 1; board.counter = 0; for (var i = 0; i < leds.length; i++) { var led = leds[i]; board.wait(delay,function(){ console.log(this.counter + " on"); leds[this.counter].on(); }); board.wait(delay + 200,function(){ console.log(this.counter + " off"); leds[this.counter].off(); this.counter = (this.counter + 1) % leds.length; }); delay += 500; } } // allOn(); // board.wait(1000,allOff); oneAfterAnother(); semaforo.js
  12. 12. @desisant • 2 pin header x 4 • Piezo element • jumper wires Música
  13. 13. @desisant var five = require("johnny-five"); five.Board().on("ready", function() { var piezo = new five.Piezo(9); var val = 0; this.loop(200, function() { if (val ^= 1) { // Play note a4 for 1/5 second piezo.frequency(five.Piezo.Notes["a4"], 200); } }); }); Music.js
  14. 14. @desisant • 2 pin header x 4 • 5mm LED • Pushbutton x 2 • 330 ohm resistor (orange-orange-brown) • 10k Ohm Resistor (brown-black-orange) x 2 • jumper wires Push Button
  15. 15. @desisant var five = require("johnny-five"), onButton, offButton, led; five.Board().on("ready", function() { onButton = new five.Button(2); led = new five.Led(13); onButton.on("down", function(value){ led.on(); }); }); Button.js
  16. 16. @desisant • 2 pin header x 4 • Potentiometer 10k ohm • 5mm LED • 330 ohm resistor (orange-orange-brown) • jumper wires Potenciômetro
  17. 17. @desisant var five = require("johnny-five"), board, myPotentiometer; board = new five.Board(); board.on("ready", function() { myPotentiometer = new five.Sensor({ pin: "A0", freq: 250 }); myLed = new five.Led(9); myPotentiometer.on("read", function() { var rawValue = this.raw; myLed.brightness(Math.floor(rawValue / 4)); }); }); Potenciometro.js
  18. 18. @desisant • 2 pin header x 4 • TMP36 Temperature sensor • jumper wires Temperatura
  19. 19. @desisant var five = require("johnny-five"); five.Board().on("ready", function(){ var tempSensor = new five.Sensor("A0"); tempSensor.on("read", function(err, value){ var cel = (100 * (value / 1000) - 50).toFixed(2); console.log("temp is " + cel); }); }); Temperatura.js
  20. 20. @desisant @desisant desisantos.wordpress.com Dúvidas, suporte para projetos :

×