Skip to content

Instantly share code, notes, and snippets.

var SerialPort = require('serialport');
const Readline = SerialPort.parsers.Readline;
try {
var port = new SerialPort('/dev/ttyUSB0'); // default port for Zbee Explorer
// As I sent line separation message
const parser = new Readline();
port.pipe(parser);
#include <OneWire.h>
/**
* Get temperature
* And communicate through zbee S1
* On Arduino Leonardo
*/
int Temp_Pin = 2;
int outputPins[] = {10, 11, 12};
@vuongngo
vuongngo / .cc
Last active August 3, 2017 23:39
Arduino Temperature Light
#include <OneWire.h>
int Temp_Pin = 2;
int outputPins[] = {10, 11, 12};
OneWire ds(Temp_Pin);
void setup() {
Serial.begin(9600);
for (int i = 0; i < 3; i++) {