This is a demo application to access and control hardware on the reTerminal. Here you can view the accelerometer data, light intensity data, button presses and control the onboard LEDs and also interact with the touch panel!
Here I have used Electron to build the app. Electron is an open-source framework for creating native desktop applications (Windows, Mac, Linux) with web technologies like HTML, CSS and JavaScript. This means if you can build a website, you can build a desktop app!
Also, npm-reterminal package is used in this demo to load the reTerminal npm library.
First, we will install Node.js along with npm on the reTerminal. npm is a package manager for Node.js packages.
-
Step 1. Access reTerminal using the onboard LCD, external display or SSH as explained here
-
Step 2. Update the package list
sudo apt update
- Step 3. Download the script to install Node.js
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
- Step 4. Install Node.js
sudo apt install -y nodejs
Node.js is now installed on the reTerminal. To check whether the installation is sucessful, run the following commands to check the version of Node.js and npm
node -v
npm -v
- Step 1. Clone this repo
git clone https://github.com/lakshanthad/Electron_reterminal_hardware
- Step 2. Navigate to the Electron_reterminal_hardware directory
cd Electron_reterminal_hardware
- Step 3. Install the app with the necessary libraries included
npm install
- Step 4. Launch the app on the reTerminal
npm test