This JS file demonstrate how open a serial port to read it, and display read value over HTTP server.
Copy/Paste the script will display value at : http://localhost:3000 enjoy.
yarn add serialport
yarn add express
/** | |
* @author http://servuc.github.io | |
* | |
* This code is in public domain | |
* It's was create for the instructable : | |
* | |
* http://www.instructables.com/id/Arduino-Shutter-Opener | |
*/ | |
#define SWITCH_DOWN_PIN 2 | |
#define SWITCH_UP_PIN 3 |
license: gpl-3.0 |
license: gpl-3.0 |
license: gpl-3.0 |
license: mit |
//Global variable (like static) | |
App = { | |
value: 1 | |
}; | |
/* | |
* Mother class constructor | |
*/ | |
function ClassA() { | |
this.value = 1; |
license: mit |
#define SENSOR_PIN A0 | |
void setup() { | |
pinMode( SENSOR_PIN, INPUT ); | |
Serial.begin(9600); | |
} | |
void loop() { | |
Serial.println( analogRead( SENSOR_PIN ) ); | |
delay(2500); |
This JS file demonstrate how open a serial port to read it, and display read value over HTTP server.
Copy/Paste the script will display value at : http://localhost:3000 enjoy.
yarn add serialport
yarn add express
FROM debian:latest | |
RUN apt-get update && apt-get upgrade -y && apt-get install -y php-cli && \ | |
mkdir /monDossier && mkdir /monDossier/share | |
COPY monScript.php /monDossier | |
ADD http://proof.ovh.net/files/1Mb.dat /monDossier | |
RUN mv /monDossier/monScript.php /monDossier/index.php |