An updated guide/collection of guides on how to access JSON data with JavaScript
Original Question on Stack Exchange.
For reading the external Local JSON file (data.json) using java script
| let units = { | |
| "prozent": { | |
| "min": "0", | |
| "max": "100", | |
| "unit": "%", | |
| "value": "50" | |
| }, | |
| "mA": { | |
| "min": "4", |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-md-12"> | |
| <h2 class="display-6 text-center mb-3">Messbereich umwandeln</h2> | |
| <div class="row"> | |
| <table class="table table-hover"> | |
| <tbody> |
| // fancontrol - fan speed control by analog sensor input (light? heat? etc.) | |
| // (c) 2016 Martin Espinoza <martin.espinoza@gmail.com> | |
| // | |
| // sources: | |
| // http://arduino.stackexchange.com/questions/25609/need-help-to-set-pwm-frequency-to-25khz/25623#25623 | |
| // https://forum.arduino.cc/index.php?topic=209133.0 | |
| // http://www.instructables.com/id/Fan-RPM-With-Internal-Hall-Effect-Sensor-and-Ardui/?ALLSTEPS | |
| // | |
| // requires atmega168 or 328 at 16MHz (e.g. Nano) for 25 MHz PWM |
| var wifi = require("Wifi"); | |
| wifi.connect("AP", {password:"12345678"}, function(err){ | |
| console.log("connected? err=", err, "info=", wifi.getIP()); | |
| }); | |
| wifi.stopAP(); | |
| var ow = new OneWire(D15); | |
| var sensor = require("DS18B20").connect(ow); | |
| var history = new Float32Array(30); |
| Introduction⇠ | |
| This is a simple WiFi enabled thermometer. We'll get temperature using the DS18B20 and we'll store a few samples worth of history. | |
| There will be a WebServer on the CC3000, and when it is queried, a webpage will be displayed that shows a line graph of the temperature over time. | |
| You'll Need⇠ | |
| One Espruino Board | |
| A DS18B20 Temperature sensor and 4.7k resistor | |
| A CC3000 WiFi module | |
| Wiring Up⇠ |
| SPI1.setup({ baud: 1000000, sck:B3, mosi:B5 }); | |
| var ow = new OneWire(B13); | |
| var g, temp, history; | |
| function onInit() { | |
| clearInterval(); | |
| temp = require("DS18B20").connect(ow); | |
| g = require("PCD8544").connect(SPI1,B6,B7,B8, function() { |
| https://github.com/arendst/Tasmota/wiki/RCWL-0516 |
An updated guide/collection of guides on how to access JSON data with JavaScript
Original Question on Stack Exchange.
For reading the external Local JSON file (data.json) using java script