Following my previous LED matrix project I wanted to make a larger LED matrix. I have some 7cm x 9cm single sided perfboards in my inventory which look like this:

There are plenty of LED matrix tutorials but most of them are using Arduino. Since Raspberry Pi Pico is a smaller microcontroller and it is relatively cheap, I decided to create a LED matrix with it instead.

Hardware Plan

The most common way of driving a LED matrix is using shift registers 74HC595 (datasheet).

My CO Alarm expired recently so I decided to disassemble it and see what components I could get.

The model number of the CO Alarm is KN-COPP-3-RC, made in August 2013.

Recently I am working on a small hardware project with Raspberry Pi. I want to use Raspberry Pi 3 B+ as an indoor monitor. It should be able to detect the brightness and turn on the light when it is getting dark; it should also be able to remind me to close the window when the room temperature gets too low. Therefore, a light sensor and a temperature sensor are required.

Choose the Sensors

Generally, there are two ways to add sensors: purchase pre-built sensor modules or build your own sensors from parts.

Pre-built sensors are very easy to use and are preferable…

I’ve been learning Flutter and Dart language recently and they really impressed me. Flutter is greatly inspired by React and many concepts are already familiar: stateful/stateless, render function, component hierarchy, etc. As for Dart language which backs Flutter, it inherits numerous of the best features from other languages while keeping off from the bad things, so if you already know python, JavaScript, C++, you can pick up Dart very quickly.

Okay, let’s go back to the main topic of this article: creating a stopwatch app. …

Introduction to Machine Learning:

Linear regression is one of the simplest machine learning algorithms. In this post I will guide you step by step creating a Linear Regression model from scratch.

What is Linear Regression?

Let’s start with some data. Suppose we measured different car models and collected some data with respect to their fuel effeciency and engine size. (If you wonder, this is the mtcars dataset in R language.) Let’s load the data and shows the first 5 rows of the data, in which mpg is the fuel efficiency in Miles per Gallon and disp is the engine size in :

import pandas as pd
import numpy…

In previous post we demonstrated how to use TypeScript with Redux and related libraries. And in this post we will talk about routing, an essential part that almost any React applications have to deal with.

Previous articles:


The most common approach is using react-router-dom. To use it we have to install the types as well:

$ npm install --save react-router-dom @types/react-router-dom

I’ll skip the basic setup part since it is very straightforward (see manual). The only thing I want to show is, when we need…

In previous articles we have already explained how to use TypeScript in regular React and with Material-UI. In this article I will show the most important and difficult part: redux.

Previous articles can be found here:

The packages used in this articles are:

$ npm install --save redux react-redux typesafe-actions \
rxjs redux-observable lodash reselect \

The common and recommended way of using redux is with the combination ofredux + typesafe-actions + redux-observable. The configuration is a bit complicated so I will explain piece by piece.

Basic Concepts

In this tutorial I will…

This series focus on how to correctly use TypeScript in React application. The previous article explained some details in typing React itself, so this article will focus on Material-UI, one of the most popular UI library.

Previous articles:

Adding Material UI is as easy as npm install --save @material-ui/core. Generally speaking Material UI is well typed so there should be no problem using it in TypeScript. The only challenge is the CSS-in-JS. If you are using Material UI 3.x, probably you have to use the Higher Order Component way to integrate styles into your component:

TypeScript has been increasingly popular. The typing system helps eliminate most of the coding errors at compile time. Generally, TypeScript costs you a significant amount of time on coding and typing, but later on i will save you much more time on debugging.

This series attempts to facilitate the painful efforts of typing, especially when you are not quite familiar with TypeScript. Thus we will focus on typing and nothing else — anything not specifically related to TypeScript, such as the usage of redux, will be ignored.

The demo project for this series can be downloaded at my GitHub:

Create a Project

Charlee Li

Full stack engineer & Tech writer @ Toronto.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store