Skip to main content

Posts

Showing posts with the label javascript

Build your own IoT Device Hub | Bluetooth | LoRaWAN | Tutorial

In this video I show how easy it is to build an Internet of Things device hub using only a Pixl.js and a little bit of Javascript code. To demonstrate I control a few devices using Bluetooth Low Energy and LoRa ( Lo ng Ra nge radio).

Getting Started with GPS Modules | Tracking Device | Tutorial

Today I took a GPS module and a microcontroller for a walk in the park and wrote a few lines of code to show my GPS coordinates in real-time.

Concurrency on the Internet of Things (Arduino, MicroPython, Espruino)

In this presentation I talk about what concurrency actually is, why it matters for Internet of Things applications, and which platforms are best at handling it.

LoRa IoT Network Programming | RYLR896

Hey everyone, so I just got some LoRa modules from REYAX to experiment with long range network applications and these things are so cool! So far I've made a long range security alarm, a button to water plants on the other side of my property, and some bridge code to interact with IP and BLE networks. Just thought I'd do a quick video update on this stuff: The module I wrote is part of the Espruino collection now:  https://www.espruino.com/RYLR I got these LoRa devices from REYAX:  https://reyax.com/products/rylr896/ They seem to only sell them on e-bay right now:  RYLR896

Internet of Things Development Board: FireBeetle ESP32

This is an IoT development board for the ESP32 that can be programmed using the Arduino IDE , MicroPython , or JavaScript using Espruino .

Halloween Strategy Game

As a fun little side project to kick off the season I decided to write a Halloween themed strategy game (in the style of the tower defense genre). Appropriate for children (there is no gore or violence) although it may be a bit challenging for young ones. Click Here  to play! As the narrator explains... Monsters appear every Halloween night and take all of your candy. It's up to you to build spooky decorations to scare them off as they get progressively more difficult to frighten. It was written from scratch in Javascript leveraging HTML Canvas , jQuery , and UnderscroreJS . I took most of the images from google image search. If you own any of them and would either like credit or want them removed, contact me immediately! Happy Halloween!

Quantum Circuit Simulator

All I wanted for Christmas was a quantum circuit simulator. So I wrote one in Javascript using NumericJS . Check it out: http://www.davyw.com/quantum For a good "Hello world" circuit, here's the diagram for a Bell State ... Try evaluating it yourself and see that |00> or |11> are the only possible outcomes. You can even compile your own circuits into gates to use in other circuits. Construct a circuit that transforms a single qubit into |0> with 75% probability and |1> with 25% probability, such as: Then compile that into gate "F" and use it to create a superposition of |00> with 75% prob and |11> with 25% prob, like this: Let me know if you find any use out of this. And definitely let me know if you find any bugs.

NumericJS Logistic Regression Classifier

The other day I post ed about numericjs and provided a simple PCA implementation using it. Today I rewrote my logistic regression classifer using numericjs. Below is the commented sourcecode and demo in jsFiddle. For the demo, you click on the large square (in the "Result" panel) to add a point. The dropdown box labeled "group" allows you to select the color of point to add. You can change the learning rate (alpha) and the regularization parameter (lambda) to see how it changes the classification. In case you're using a feed reader and can't see the box below, click here . ​

Numeric Javascript

I just recently found this javascript library. So far it's looking pretty good. I've always wanted some sort of Javascript equivalent to NumPy and while this isn't anywhere near that extreme, it does offer some pretty handy features . Here's a jsFiddle I put together to show it performing a simple implementation of PCA (Principle Component Analysis) on a fictional dataset. The first component should have a slope of approximately 0.357 Here's a quick snippet, the actual PCA function using numericjs... function  pca ( X )  {      /*          Return matrix of all principle components as column vectors      */              var  m  =  X . length ;      var  sigma  =  numeric . div ( numeric . dot ( numeric . transpose ( X ) ,  X ) ,  m ) ;      return  numeric . svd ( sigma ) . U ; }