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.
The most common way of driving a LED matrix is using shift registers 74HC595 (datasheet).
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.
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…
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.
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 cu.in. :
import pandas as pd
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.
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 of
redux-observable. The configuration is a bit complicated so I will explain piece by piece.
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.
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: https://github.com/charlee/todolist.