All Projects → doodlewind → React Ssd1306

doodlewind / React Ssd1306

📟 A React Renderer for SSD1306 OLED chip on Raspberry Pi.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to React Ssd1306

Imodels
Interpretable ML package 🔍 for concise, transparent, and accurate predictive modeling (sklearn-compatible).
Stars: ✭ 194 (-28.94%)
Mutual labels:  tutorial, demo
Smoothscrollanimations
Demo of a tutorial on how to add smooth page scrolling with an inner image animation
Stars: ✭ 238 (-12.82%)
Mutual labels:  tutorial, demo
Web Push Book
Web Push Book
Stars: ✭ 199 (-27.11%)
Mutual labels:  tutorial, demo
Golang For Nodejs Developers
Examples of Golang compared to Node.js for learning
Stars: ✭ 2,698 (+888.28%)
Mutual labels:  tutorial, demo
Routerypi
📶 RouteryPi is a simple WiFi access point made out of any Raspberry Pi 🥧
Stars: ✭ 113 (-58.61%)
Mutual labels:  raspberry-pi, tutorial
Interactive Repulsive Effect
🍫 An interactive repulsion effect of grid items as seen in BestServedBold's Dribbble shot "Holographic-Interactions".
Stars: ✭ 141 (-48.35%)
Mutual labels:  tutorial, demo
Caffe2 Ios
Caffe2 on iOS Real-time Demo. Test with Your Own Model and Photos.
Stars: ✭ 221 (-19.05%)
Mutual labels:  tutorial, demo
Godot Demos
Godot demos and tutorials
Stars: ✭ 88 (-67.77%)
Mutual labels:  tutorial, demo
Pendulum
ROS, ROS2, real-time, control, pendulum
Stars: ✭ 37 (-86.45%)
Mutual labels:  raspberry-pi, demo
Raspchat
A chat server that can run on Raspberry Pi
Stars: ✭ 418 (+53.11%)
Mutual labels:  raspberry-pi, demo
Webpack Demo
webpack 4 config. demo ⚙️
Stars: ✭ 131 (-52.01%)
Mutual labels:  tutorial, demo
Lightpack Docs
The most complete Lightpack project documentation
Stars: ✭ 120 (-56.04%)
Mutual labels:  raspberry-pi, tutorial
Git Cheats
Git Cheats - Interactive Cheatsheet For Git Commands
Stars: ✭ 124 (-54.58%)
Mutual labels:  tutorial, demo
Laravel Scaffold
The base for developing awesome projects
Stars: ✭ 142 (-47.99%)
Mutual labels:  tutorial, demo
Circleci Demo Python Django
Example Django application running on CircleCI
Stars: ✭ 100 (-63.37%)
Mutual labels:  tutorial, demo
Knative Tutorial
https://dn.dev/master A practical guide to get started with Knative. Knative concepts are explained simple and easy way with lots of demos and exercises.
Stars: ✭ 219 (-19.78%)
Mutual labels:  tutorial, demo
K8sdemo
Kubernetes demo
Stars: ✭ 53 (-80.59%)
Mutual labels:  tutorial, demo
Expo Three Demo
🍎👩‍🏫 Collection of Demos for THREE.js in Expo!
Stars: ✭ 76 (-72.16%)
Mutual labels:  tutorial, demo
Rust Raspberrypi Os Tutorials
📚 Learn to write an embedded OS in Rust 🦀
Stars: ✭ 7,275 (+2564.84%)
Mutual labels:  raspberry-pi, tutorial
Raspberry Pi Os
Learning operating system development using Linux kernel and Raspberry Pi
Stars: ✭ 11,000 (+3929.3%)
Mutual labels:  raspberry-pi, tutorial

React SSD1306

A React Renderer for SSD1306 OLED chip on Raspberry Pi

For those who doesn't have the device, a canvas-based web emulator is also included!

Introduction

This project demonstrates how to:

  • Use React together with QuickJS on Raspberry Pi.
  • Develop basic C module for QuickJS.
  • Build a custom "native & dynamic" renderer for React.

Checkout the Tutorial, or my Chinese blog post for details.

Getting Started

This project is originally designed to work on Raspberry Pi, but a web emulator is also available and works out of the box. Notice that no matter you run it on web or native, the whole React-related codebase is exactly the same.

Web Approach

You can try out the reconciler example, even if you don't have a Raspberry Pi. In this way only Node.js and ParcelJS are required:

cd react-ssd1306/app
parcel src/index.html

Then just open https://localhost:1234 to see the emulator.

Native Approach

Connect the chip, make sure you have QuickJS and Node.js installed on your Raspberry Pi, with I2C interface enabled. Few extra packages are also required:

sudo apt-get install i2c-tools libi2c-dev

Node.js is only required for JS module bundling and package management here.

Init the project:

cd react-ssd1306/app
npm install && cd ..
npm run build # build JS and C modules
npm start # start the compiled binary

Usage

Simply edit ./app/index.js as main entrance:

import './polyfill.js'
import React from 'react'
import { SSD1306Renderer, Text, Pixel } from './renderer.js'

class App extends React.Component {
  constructor () {
    super()
    this.state = { hello: 'Hello React!', p: 0 }
  }

  render () {
    const { hello, p } = this.state
    return (
      <React.Fragment>
        <Text row={0} col={0}>{hello}</Text>
        <Text row={1} col={0}>Hello QuickJS!</Text>
        <Pixel x={p} y={p} />
      </React.Fragment>
    )
  }

  componentDidMount () {
    // XXX: Emulate event driven update
    setTimeout(() => this.setState({ hello: 'Hello Pi!', p: 42 }), 2000)
    setTimeout(() => this.setState({ hello: '', p: -1 }), 4000)
  }
}

SSD1306Renderer.render(<App />)

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].