Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.

Overview

ESP-TypeScript

Version License: ISC Twitter: skittleson nycrc config on GitHub

Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.

Install

npm install

Usage

Adjust port used in package.json then:

npm run-script transpile

Permanently save transpile code on device.

npm run-script commit

Monitor serial responses

npm run-script monitor

Run tests

npm test

Code coverage in coverage/index.html

Example

The simplest example in blinky.ts. Blink a LED.

const BUILTIN_LED = 2;
export function blinkly(intervalMs: number = 2000, pin: number = BUILTIN_LED) {
  let toggleStatus = false;
  setInterval(function () {
    toggleStatus = !toggleStatus;
    digitalWrite(pin, toggleStatus);
  }, intervalMs);
}

More advance example using a class, properties, testing using mocks and type checking: AdvanceBlinky class in advanceBlinky.ts with test at test/blinky.spec.ts.

In depth documentation about Espruino JavaScript API and flashing

Road map

  • Transpile TypeScript to Espruino flavor of JavaScript
  • Example usage of typed code
  • Short commands to build, upload, and monitor
  • Unit testing
  • Firmware guidance docs
  • Integration testing

Devices

Firmware selections

ESP8266 Wemos D1 mini ESP8266

ESP32 Wemos ESP32

These devices are also know to work: https://templates.blakadder.com/

Author

👤 Spencer Kittleson

Show your support

Give a ⭐️ if this project helped you!

You might also like...

[ThatProject] ESP32 LoRa GPS Data Viewer

[ThatProject] ESP32 LoRa GPS Data Viewer

Map Viewer for MCU with LoRa & GPS Data ThatProject Channel LoRa module has caught the attention of many people for a number of reasons. Being able to

Aug 7, 2022

Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

Jan 3, 2023

A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects.

A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects.

🌍 typesafe-i18n A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects. Advantages 🐤 lightwe

Jan 4, 2023

Framework agnostic CLI tool for routes parsing and generation of a type-safe helper for safe route usage. 🗺️ Remix driver included. 🤟

Framework agnostic CLI tool for routes parsing and generation of a type-safe helper for safe route usage. 🗺️ Remix driver included. 🤟

About routes-gen is a framework agnostic CLI tool for routes parsing and generation of a type-safe helper for safe route usage. Think of it as Prisma,

Jan 2, 2023

In this project, you will restructure your Awesome books app code. The goal is to make it more organized by using modules and also practice the ES6 syntax.

Awesome-books-with-ES6 In this project, I restructured Awesome books app code. The goal is to make it more organized by using modules and also practic

Sep 16, 2022

In this project, I will restructure Awesome books app code. The goal is to make it more organized by using modules.

Awesome Books ES6 In this project, In this project I built Awesome books app code. The goal was to make it more organized by using modules. Built With

Jun 16, 2022

In this project, you will restructure your Awesome books app code. The goal is to make it more organized by using modules. You will also practice the ES6 syntax that you have learned.

Awesome books: with ES6 In this project, you will restructure your Awesome books app code. The goal is to make it more organized by using modules. You

Oct 10, 2022

This project is a boilerplate for Next and TypeScript projects. This template was built with Vite, TypeScript and Stitches.

This project is a boilerplate for Next and TypeScript projects. This template was built with Vite, TypeScript and Stitches.

Awesome Template Stitches — NextJS, TypeScript, Stitches and Design Tokens Summary About this template Avaliale scripts Other scripts available Main t

Dec 29, 2022

Restructure my Awesome books app code. The goal is to make it more organized by using modules and also practice the ES6 syntax.

Awesome Book In this project, I rebuild a basic website that allows users to add/remove books from a list using ES6 Built With HTML CSS Javascript Get

Aug 15, 2022
Owner
Spencer Kittleson
Software engineer, database designer, and a Maker!
Spencer Kittleson
Transpile TypeScript on the fly and deliver it from your server as ES Modules.

ts-serve TypeScript + ES Modules Transpile TypeScript on the fly and serve it from your server as ES Modules. import { serve } from "https://deno.land

ayame113 28 Aug 15, 2022
This document introduces an early implementation of the Node-RED runtime that runs on resource-constrained microcontrollers (MCUs).

Node-RED MCU Edition Copyright 2022, Moddable Tech, Inc. All rights reserved. Peter Hoddie Updated June 25, 2022 Introduction This document introduces

Peter Hoddie 53 Jan 3, 2023
Set up and build a Node.js REST API using Typescript, Express, Mongoose with a maintainable and scalable structure.

Introduction Create a maintainable and scalable Node.js REST API with TypeScript, Express and Mongoose. The project structure is based on MVC and foll

Adam Khomsi 16 Nov 18, 2022
Create a maintainable and scalable Node.js GraphQL API with TypeScript, Express, Mongoose and Apollo Server.

Set up and build a Node.js GraphQL API using Typescript, Express, Mongoose with a maintainable and scalable structure

Adam Khomsi 7 Nov 4, 2022
Minimalistic configuration for TS to only extend JS with types. No TS features, no bundling. Readable maintainable code after compilation.

ts-guideline Minimalistic configuration for TS to only extend JS with types. No TS-scpecific features, no bundling. Readable maintainable code after c

Georg Oldenburger 41 Dec 22, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
In this project, I restructure my previous Awesome books app code. The goal is to practice ES6 syntax and also make the code more organized by using ES6 modules.

Awesome Books In this project, I will restructure my previous Awesome books app code. The goal is to make it more organized by using modules. I will a

Sidney Kaguli 9 Aug 23, 2022
Blockchain, Smart Contract, Ganache, Remix, Web3, Solidity, Java Script, MQTT, ESP32, RFID, DHT11,

Blockchain, Smart Contract, Ganache, Remix, Web3, Solidity, Java Script, MQTT, ESP32, RFID, DHT11,

Hajar OUAAROUCH 5 May 24, 2022
Create testable, reproduceable documentation with Jupyter notebooks

Create Testable, Reproduceable Docs and Blogs With Notebooks Never copy and paste code into documentation again! ?? See a live example of a post made

Outerbounds 29 Dec 8, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022