10
int value = board.potentiometer.read();
Potentiometer / read
Slide 11
Slide 11 text
11
int value = board.potentiometer.scaleTo(0,99);
Potentiometer / scaleTo
Slide 12
Slide 12 text
12
int value = board.ldr.read();
LDR / read
Slide 13
Slide 13 text
13
int value = board.ldr.scaleTo(0,99);
LDR / scaleTo
Slide 14
Slide 14 text
14
board.buzzer.playTone(440);
Buzzer / playTone
Slide 15
Slide 15 text
15
board.rgb.on();
LED RGB / on
Slide 16
Slide 16 text
16
board.rgb.off();
LED RGB / off
Slide 17
Slide 17 text
17
board.rgb.setColor(255, 0, 0);
LED RGB / setColor
Slide 18
Slide 18 text
18
board.rgb.setColor(“FF0000”);
LED RGB / setColor
Slide 19
Slide 19 text
19
board.rgb.setIntensity(25);
LED RGB / setIntensity
Slide 20
Slide 20 text
20
board.ledmatrix.print(“Hola”);
LED Matrix / print
Slide 21
Slide 21 text
21
board.servos.goForward();
Servos / goForward
Slide 22
Slide 22 text
22
board.servos.goBackward();
Servos / goBackward
Slide 23
Slide 23 text
23
board.servos.goRight();
Servos / goRight
Slide 24
Slide 24 text
24
board.servos.goLeft();
Servos / goLeft
Slide 25
Slide 25 text
25
int value = board.ultrasound.pingCm();
Ultrasound / pingCm
Slide 26
Slide 26 text
26
Example
Slide 27
Slide 27 text
27
Slide 28
Slide 28 text
28
Slide 29
Slide 29 text
29
Android App
Slide 30
Slide 30 text
30
Slide 31
Slide 31 text
31
Android App
Slide 32
Slide 32 text
32
Android App
Slide 33
Slide 33 text
Example
Slide 34
Slide 34 text
34
Slide 35
Slide 35 text
35
Slide 36
Slide 36 text
36
NanoPlayBoard ❤ MQTT
Slide 37
Slide 37 text
37
Slide 38
Slide 38 text
38
Firmata
• Firmata is a protocol for communicating with microcontrollers from
software on a computer (or smartphone/tablet, etc).
• Firmata is based on the MIDI message format.
• Firmata client libraries:
• Processing
• Python
• Perl
• Ruby
• Javascript
https://github.com/firmata
• Java
• .NET
• PHP
• Haskell
• iOS
• Dart
• Max/MSP
• Elixir
• golang
• Qt/QML
Slide 39
Slide 39 text
39
Johnny-Five
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
var led = new five.Led.RGB([9,10,11]);
led.on();
led.color("#0000FF");
led.blink(1000);
});
Slide 40
Slide 40 text
40
Slide 41
Slide 41 text
41
Python client library
#!/usr/bin/python
from nanoplayboard.nanoplayboard import NanoPlayBoard
board = NanoPlayBoard()
def loop():
board.rgb.on()
board.sleep(1)
board.rgb.off()
board.sleep(1)
if __name__ == "__main__":
while True:
loop()
45
Contributing
We always welcome contributions to help make
NanoPlayBoard better.
Please feel free to post questions or comments in the
HackLab Almería Forum.