Avatar for callummclu

callummclu

Member since Oct 2022 • Last active Nov 2022
  • 2 conversations
  • 2 comments

Most recent activity

  • in Projects
    Avatar for callummclu

    Espruino Tools

    Hi everybody,

    Ive been working on a few npm packages and an npx tool to ease the development of espruino devices using typescript.

    currently we have

    @espruino-tools/uart

    This package is a reimplementation of the espruino-ble-uart package.

    So far this package has been edited to have an overall nicer modal and typing made in typescript.

    There are plans to revamp this to improve the syntax to conform to more current ecma script standards such as using classes

    @espruino-tools/core

    This package provides all the basic features anybody could want to get started working with an espruino device, with the ability to easily create custom devices and expand functionality.

    Some notable features include:

    • Callable device functions through a method which runs any time code is changed on the device, this then populates an object which contains all the functions present on the connected device.
    • syntax that can be easier understood by beginners such as

      import { Puck } from '@espruino-tools/core';
      
      let puck = new Puck();
      
      device.onPress(function(){
      puck.LED.toggle("red");
      })
      

    other syntax and a getting started guide can be found on the documentation site here

    @espruino-tools/peer

    This package utilises peerjs to create easy peer to peer connection between a host computer and a connector computer (such as a mobile), this is especially useful for controlling espruino devices from a mobile device or sending video feeds to determine what an espruino device can do.

    create-espruino-app

    This is probably the most exciting addition, this NPX tool allows for espruino development to be started by running a single command npx create-espruino-app myapp.

    This has some benefits:

    • by running npm start within the directory a development localhost server will be run allowing for easy development.
    • a preset build command npm build that will compile your project into a single index.html and main.js file allowing for hosting on github pages for free.

    This also incorporates some tags:

    • --template This tag allows for a default project to be made with javascript, typescript, react or vue using npx create-espruino-tools appname --template typescript
    • --clean-install remove any junk ive added to make the landing page more presentable.
    • --peer initialise an espruino app with the peer package.

    There are plans to improve these packages further, for example:

    • utilising unpkg for non node development
    • refining the npx package generated directory
    • and much more.

    You can find the code here, dont hesitate to send me a message with any feedback it would be much appreciated.

    currently there are no demos but this will change in the future

  • in Puck.js, Pixl.js and MDBT42
    Avatar for callummclu

    Whilst working on an addition ontop of UART.js ive found that digitalRead(LED) will turn off LED is this a bug or intended?

Actions