The code is in Go. It could be easily ported to other languages. Did you know that you can bitshift a number to the left or right by multiplying a number by 2 or dividing(integer division) a number by 2 respectively? Anyway, let’s start by getting the least significant bit of a number: Then let’s…
All posts tagged golang
A shift register abstraction in Golang
This builds up on the Golang ar150gpio package I made for accessing the GPIOs of the GL.iNet AR-150 router. If you are interested, here is the blog entry for it. As the number of outputs of the router is limited, I decided to write an abstraction for use with the shift register 74HC595N to expand…
A Go package repository for GL.iNet AR-150 GPIO control
I have a GL.iNet AR-150 router that I bought from here. It is running OpenWrt. The variant that I chose is the one with an external antenna. I did write a shell script for manipulating the GPIOs. But I lost it(lol). I even implemented an abstraction for the shift register(74HC595). The idea is that the…