Upgrade to Pro — share decks privately, control downloads, hide ads and more …

InmunoGame: Cuando la Inmunología conoció a Jav...

InmunoGame: Cuando la Inmunología conoció a Javascript of things

Diapositivas de la charla impartida en Barcelona Software Crafters.

Azahara Fernández Guizán

October 05, 2019
Tweet

More Decks by Azahara Fernández Guizán

Other Decks in Programming

Transcript

  1. Copyright © Sngular. All rights reserved. 1 InmunoGame: Cuando la

    inmunología se une a JavaScript of Things.
  2. Copyright © Sngular. All rights reserved. Juan Manuel Rodríguez Pérez

    @juan_manuel_rp jmrp81 Azahara Fernández Guizán @Azahara_fergui azaharafernandezguizan
  3. Copyright © Sngular. All rights reserved. ¿Por qué Javascript of

    things? 4 Curva de aprendizaje Node modules Angular of Things
  4. Copyright © Sngular. All rights reserved. Recursos 6 Webs Jhonny

    Five: http://johnny-five.io/ Node y GPIO https://www.w3schools.com/nodejs/nod ejs_raspberrypi_gpio_intro.asp Raspberrry PI https://www.raspberrypi.org/
  5. Copyright © Sngular. All rights reserved. Recursos 7 Comunidad Nuria

    Prieto https://twitter.com/nuria_imeq Sergio Morcuende https://twitter.com/_serxius_ https://www.youtube.com/watch?v=girA0gsn-fs Programar es una mierda https://www.programaresunamierda.com/p/comunidad -en-slack.html Luis Llamas https://www.luisllamas.es/tutoriales-de-arduino/
  6. Copyright © Sngular. All rights reserved. Actualizar paquetes de la

    Raspberry Pi 12 $ sudo apt full-upgrade –y $ sudo apt-get update
  7. Copyright © Sngular. All rights reserved. Eliminar las versiones de

    Node que puedan existir 13 $ sudo apt-get remove nodered –y $ sudo apt-get remove nodejs nodejs-legacy –y
  8. Copyright © Sngular. All rights reserved. Descargar e instalar Node

    14 $ curl -sL http://deb.nodesource.com/setup_11.x | sudo bash - $ sudo apt-get install -y nodejs
  9. Copyright © Sngular. All rights reserved. INTERACCIÓN CON LOS COMPONENTES

    19 const Gpio = require('onoff').Gpio; // Led var turnOnLed = new Gpio(18, 'out'); var falseAnswerLed = new Gpio(20, 'out'); var trueAnswerLed = new Gpio(21, 'out'); // Buttons var questionButton = new Gpio(26, 'in', 'both'); var answerAButton = new Gpio(19, 'in', 'both'); var answerBButton = new Gpio(13, 'in', 'both'); var answerCButton = new Gpio(06, 'in', 'both');
  10. Copyright © Sngular. All rights reserved. INTERACCIÓN CON LOS COMPONENTES

    20 // actions turnOnLed.writeSync(1); questionButton.watch(function (error, value) { if (error) { console.log('error' + error); return; } if (value === 1) { // pulsado currentQuestion = gameService.GetQuestion(); picoSpeakerService.speakText(currentQuestion.text); });
  11. Copyright © Sngular. All rights reserved. TEXT TO SPEECH 21

    PICO SPEAKER const picoSpeaker = require('pico-speaker'); var picoConfig = { LANGUAGE: 'es-ES' }; picoSpeaker.init(picoConfig); module.exports = { speakText: function (textToSpeak) { picoSpeaker.speak(textToSpeak).then( function() { }.bind(this)); } }
  12. Copyright © Sngular. All rights reserved. ➢ Autenticación con JWT

    ➢ Tests con Mocha ➢ Gráficos con Chart.js ➢ Conexión a la api y cálculo de los algoritmos