Posts

Showing posts from April, 2018

matplotlib and Raspberry Pi 3 - show my 'Hello world!'

Image
17 April 2018 Here it is: I have tried to do simple plot using matplotlib on freshly installed Raspbian (jessy). Way to accomplish this seemingly easy task is quite bumpy thou. This post serves to document the steps i have done to see the plot first time. 1. grab a Raspberry Pi and all peripherals 2. If you have an NOOBS SD card, install Raspbian, if not, visit  https://www.raspberrypi.org/downloads/noobs/  and  download NOOBS, follow the installation procedure. 3. Raspbian installed? Great. This is Linux named Debian, to quickly check what you have installed open terminal and type lsb_release -a  As answer you obtain something like: Distributor ID: Raspbian Description:     Raspbian GNU/Linux9.4 (stretch) Release:           9.4 Codename:      stretch Start from typing a command: sudo apt-get update Check the python version you have by typing in terminal  python or  python3 first line appearing after this command tells about installed version(s) of python. N

Rule the pins of Raspberry Pi 3

Image
To easily drive the pins of RPi use library named bcm2835. It will work with Raspberry Pi 3 despite the fact this model uses BCM2837 chip. Visit  http://www.airspayce.com/mikem/bcm2835/ Check the latest version of bcm2835 library. Open terminal and do what is below. wget command will fetch the choosen version of the library, say bcm2835-1.55.tar.gz and the others commands will unpack it and install: wget http://www.open.com.au/mikem/bcm2835/bcm2835-1.xx.tar.gz tar zxvf bcm2835-1.xx.tar.gz cd bcm2835-1.xx ./configure make sudo make check sudo make install It is time to test the library now. Using Geany (should be installed by default) go to File -> New and place the code which could be find on http://www.airspayce.com/mikem/bcm2835/blink_8c-example.html The below example has some modification to work with RPi3: instead of original #define PIN RPI_GPIO_P1_11 there is #define PIN RPI_BPLUS_GPIO_J8_11 what is a correct PIN definition when using RPi 3. To check how correc