Posts

Cellular automation using an Arduino Uno and a Heltec I2C OLED display.

This project took a couple of iterations to create.  My original design for the program revolved around using the LolShield, and I wanted to recreate Conway's Game of Life on it, however I would be able to do little more than a simple glider on that display due to its size. I then took some of the concepts from that and applied it to the OLED display that I recently played around with.  This design revolved around using a two-dimensional array of structs to represent each pixel.  Each struct would have an x and y value to dictate its position on the board, then it would have variables to indicate its on/off state, whether or not the cell was "Alive" or "Dead", and another two-dimensional array of structs that functioned as an adjacency list. Two cell-state variables were used so that I could make the program pass through the array and change alive/dead states of the cells without the changes affecting each other on the same pass through. After one pass throu...

Using a small OLED I2C display with the Arduino Uno

Image
Today I decided I wanted to figure out how to use a small OLED display that I have, with an Arduino Uno.  I also partially followed this instructables article. So first I did some searching to figure out how I would go about connecting the display to the board.  I found out that I would have to use a breadboard and some wires, as its pin orientation doesn't allow it to directly connect to the board.  So with some additional searching, I found I had to connect the SCL pin on the display to the A5 pin on the board, and the SDA to A4, then VCC and GND to the appropriate 5V and Ground pins. Then, I plugged in the board to my computer and used the code found  here to make a quick sketch in the Arduino IDE to use as an I2C scanner to find the I2C address of the display. Now having found the address to be 0x3C, the next step was to install the necessary libraries. https://github.com/adafruit/Adafruit_SSD1306 (SSD1306 library) https://github.com/adaf...

More GPIO with a Raspberry Pi 2: Controlling a servo with PWM

Image
Today I wanted to make a servo run using the breadboard connected the GPIO on my Raspberry Pi 2, which while it isn't overly difficult, I had to do some research on controlling motors, and then how I would do that with my Pi. I started off by looking up how I would control the specific servo that I would be using, and as I had thought, I would need to do some pulse width modulation to control it.   After that, I connected the wires to the board, the control signal to a generic pin, the source voltage one to the 5V terminal, and the black one to ground.   Next, I had to find out how to generate PWM with the Pi.  I found that within the same library I used for the LED blinking, there was the capability to do PWM.  After a bit of research I figured out how to do the PWM with the library, but it didn't exactly do what I wanted it to.  I then realized that the servo motors only moved within 180 degrees of rotation.  So after some googli...

Getting started with some brief GPIO stuff with the Raspberry Pi 2

Image
Today I wanted to get into using the GPIO on my raspberry pi 2, so I found a nice little intro to it which used the Raspberry Pi GPIO Breakout Kit from CanaKit that I had.  Link to the tutorial. For now, all I would be doing is using the Raspberry Pi and its GPIO connected to a breadboard to make an LED blink repeatedly.  I did this following the tutorial linked and the code used is from the tutorial as well. I started by checking for updates and upgrades using "sudo apt-get update" and then "sudo apt-get upgrade".  Then I ran "sudo apt-get install rpi.gpio" to install whatever necessary files to use the GPIO.  Next, I went into the config to enable the I2C (Inter-integrated-circuit) and the SPI (serial to parallel interface), then rebooted the Pi. Here's where I ran into some issues:  I went to go and run the command "lsmod | grep i2c", except the keyboard wouldn't type the pipe.  So after some searching, I found out that this was ...

Scrolling designs with the Arduino Uno and Lol shield (LED shield)

Image
For this little project, the parts used were an Arduino Uno, the Lol Shield, a power cord for the Arduino, and a USB cable to connect it to my computer to program the board. To start off, I had to first download the  Arduino IDE so that I could program the Arduino board.  Then I downloaded the library needed to use the shield with the board from  this GitHub link and then extracted the file into the libraries section of the Arduino program files.  Then I plugged in the board and selected an example from the library then I uploaded it onto the board and checked the LED's. After checking, most of the LED's worked, but some didn't, and remained so despite re-soldering them. After looking at the code in the example and analyzing it based on what it shows, I found that it was essentially a sequence of sets, where each of the 9 elements in each set depicts a row, and the number for each row displays in a binary fashion across each row (i.e. 1 means the first...

Made an AirPlay receiver using a Raspberry Pi

This project was done using instructions from Make magazine volume 49, and with additional instructions which are laid out in this Raspberry Pi Airplay Tutorial.  In this post I will be showing the steps I took to make the AirPlay device work, along with some mistakes made in the process, as I had to redo the project due to some early mistakes. For this project I used a Raspberry Pi 2 with the NOOBS command line OS, though both sets of instructions have you download and use the Raspbian OS on your Pi. The first thing that I did before starting this project, was getting the Pi connected to my local WiFi using a USB WiFi module from CanaKit.  This was done using a brief tutorial from an adafruit article on how to set up WiFi using the command line.  In the command line, I entered the following command so that I may edit a file containing network information along with the SSID and Password of the internet connection I wanted to connect to. sudo nano /etc/network/in...