{"id":16239505,"url":"https://github.com/nopnop2002/raspberry-ssd1306","last_synced_at":"2025-10-07T09:17:12.254Z","repository":{"id":47731964,"uuid":"85706586","full_name":"nopnop2002/Raspberry-ssd1306","owner":"nopnop2002","description":"ssd1306 Command Line Tool for Raspberry Pi","archived":false,"fork":false,"pushed_at":"2024-08-14T05:42:03.000Z","size":3335,"stargazers_count":50,"open_issues_count":4,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T19:18:38.277Z","etag":null,"topics":["i2c","oled","raspberrypi","sh1106","spi","ssd1306"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nopnop2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-21T13:41:36.000Z","updated_at":"2025-03-24T16:49:58.000Z","dependencies_parsed_at":"2024-08-14T06:51:27.165Z","dependency_job_id":null,"html_url":"https://github.com/nopnop2002/Raspberry-ssd1306","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nopnop2002/Raspberry-ssd1306","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2FRaspberry-ssd1306","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2FRaspberry-ssd1306/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2FRaspberry-ssd1306/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2FRaspberry-ssd1306/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/Raspberry-ssd1306/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2FRaspberry-ssd1306/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278748166,"owners_count":26038861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i2c","oled","raspberrypi","sh1106","spi","ssd1306"],"created_at":"2024-10-10T13:43:55.358Z","updated_at":"2025-10-07T09:17:12.237Z","avatar_url":"https://github.com/nopnop2002.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry-ssd1306\nssd1306 Command Line Tool for RaspberryPi.   \nThis may works with other boards like OrangePi/NanoPi.   \n\nYou can operate from command line.  \nYou can choose Hardware-SPI/Software-SPI/I2C Interface.  \n\n# Software requirement   \n- WiringPi Library   \n This project uses the wiringPiSetup() function to initialize GPIOs.   \n If you use it on a board other than the RPI board, you may need to change the WiringPi number.   \n As far as I know, there are these libraries.   \n\t- WiringPi for OrangePi   \n\t- WiringPi for BananaPi   \n\t- WiringPi for NanoPi   \n\t- WiringPi for Pine-64   \n\n# Command line parameters\n+1 String : String for #1 line(Use External Font)  \n+2 String : String for #2 line(Use External Font)  \n+3 String : String for #3 line(Use External Font)  \n+4 String : String for #4 line(Use External Font)  \n+a String : String for #1 line(Use Internal Font)  \n+b String : String for #2 line(Use Internal Font)  \n+c String : String for #3 line(Use Internal Font)  \n+d String : String for #4 line(Use Internal Font)  \n-1 : delete #1 line  \n-2 : delete #2 line  \n-3 : delete #3 line  \n-4 : delete #4 line  \n+R n : Set inverse mode #n Line  \n-R n : Unset inverse mode #n Line  \n+U n : Set underline mode #n Line  \n-U n : Unset underline mode #n Line  \n+L   : Scroll Up 1Line  \n-L   : Scroll Down 1Line  \nP1 n : Set start colum n to line#1  \nP2 n : Set start colum n to line#2  \nP3 n : Set start colum n to line#3  \nP4 n : Set start colum n to line#4  \nr  : remove all string  \ns  : show display  \n\nYou can use within script.  \n#!/bin/bash  \n./oled r  \n./oled +1 \"ABCDEFG\"  \n./oled +2 \"abcdefg\"  \n./oled +3 \"1234567\"  \n./oled +4 \"Hello World!!\"  \nsudo ./oled s  \n\n---\n\n# Wire connection for Hardware SPI\n\n|OLED||RPi|Pin#|WiringPi#|\n|:-:|:-:|:-:|:-:|:-:|\n|Gnd|--|Gnd|||\n|VCC|--|3.3V|||\n|D0|--|SCLK|#23||\n|D1|--|MOSI|#19||\n|RES|--|GPIO18|#12|1(*)|\n|DC|--|GPIO17|#11|0(*)|\n|CS|--|CS0|#24||\n\n(*)You can change to another pin.   \n#define RST  1  // You can change   \n#define DC   0  // You can change   \n\n---\n\n# Wire connection for Software SPI\n\n|OLED||RPi|Pin#|WiringPi#|\n|:-:|:-:|:-:|:-:|:-:|\n|Gnd|--|Gnd||||\n|VCC|--|3.3V|||\n|D0|--|SCLK|#23|14(*)|\n|D1|--|MOSI|#19|12(*)|\n|RES|--|GPIO18|#12|1(*)|\n|DC|--|GPIO17|#11|0(*)|\n|CS|--|CS0|#24|10(*)|\n\n(*)You can change to another pin.   \n#define MOSI 12 // You can change   \n#define SCLK 14 // You can change   \n#define RST   1 // You can change   \n#define DC    0 // You can change   \n#define CS   10 // You can change   \n\n---\n\n# Wire connection for I2C\n\n|OLED||RPi|Pin#|\n|:-:|:-:|:-:|:-:|\n|Gnd|--|Gnd||\n|VCC|--|3.3V||\n|SCK|--|SCL|#5|\n|SDA|--|SDA|#3|\n\n---\n\n# Install SSD1306 for Hardware SPI (128x64)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DSPI\nbash ./test.sh\n```\n\n![OLED-128x64](https://user-images.githubusercontent.com/6020549/106347419-a4723f80-6301-11eb-97cd-1f8311c0e179.JPG)\n\n---\n\n# Install SSD1306 for Hardware SPI (128x32)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DSPI -DX32\n```\n\nThe number of lines which can be indicated is only 2 lines.   \n![OLED-128x32](https://user-images.githubusercontent.com/6020549/106347297-cdde9b80-6300-11eb-9646-a7bd3b9ea466.JPG)\n\n---\n\n# Install SH1106 for Hardware SPI (128x64)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DSPI -DOFFSET=2\nbash ./test.sh\n```\n\nLeft:1.3 inch SH1106   \nRight:0.96 inch SSD1306   \n![OLED-SH1106](https://user-images.githubusercontent.com/6020549/106369496-5c046180-6395-11eb-8f36-376474120047.JPG)\n\n---\n\n# Install SSD1306 for Software SPI (128x64)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DSOFT_SPI\nbash ./test.sh\n```\n\n---\n\n# Install SSD1306 for Software SPI (128x32)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DSOFT_SPI -DX32\n```\n\n---\n\n# Install SH1106 for Software SPI (128x64)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DSOFT_SPI -DOFFSET=2\nbash ./test.sh\n```\n\n\n---\n\n# Install SSD1306 for I2C (128x64)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DI2C\nbash ./test.sh\n```\n\n![OLED-1](https://user-images.githubusercontent.com/6020549/82557232-50c22a80-9ba6-11ea-8636-b00e0a950b0b.JPG)\n\n---\n\n# Install SSD1306 for I2C (128x32)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DI2C -DX32\n```\n\nThe number of lines which can be indicated is only 2 lines.   \n![oled-3](https://user-images.githubusercontent.com/6020549/44244307-4a06c680-a20e-11e8-986f-6d0db5edeb2b.JPG)\n\n---\n\n# Install SH1106 for I2C (128x64)\n```\ngit clone https://github.com/nopnop2002/Raspberry-ssd1306\ncd Raspberry-ssd1306\ncc -o oled oled.c fontx.c -lwiringPi -lpthread -DI2C -DOFFSET=2\nbash ./test.sh\n```\n\nLeft:1.3 inch SH1106   \nRight:0.96 inch SSD1306   \n![OLED-SH1106](https://user-images.githubusercontent.com/6020549/106369513-8b1ad300-6395-11eb-9653-26b470829de2.JPG)\n\n\n# Font File   \nThis tool uses the following as default fonts:   \n- fontx/ILGH16XB.FNT // 8x16Dot Gothic\n- fontx/ILMH16XB.FNT // 8x16Dot Mincyo\n\nChanging this file will change the font.\n```\n  // You can change font file\n  Fontx_init(fx,\"./fontx/ILGH16XB.FNT\",\"./fontx/ILGZ16XB.FNT\"); // 16Dot Gothic\n  //Fontx_init(fx,\"./fontx/ILMH16XB.FNT\",\"./fontx/ILMZ16XB.FNT\"); // 16Dot Mincyo\n```\n\nYou can add your original fonts.   \nThe format of the font file is the FONTX format.   \nYour font file is put in fontx directory.   \n\nPlease refer [this](http://elm-chan.org/docs/dosv/fontx_e.html) page about FONTX format.   \n\n# Font File Editor(FONTX Editor)   \n[There](http://elm-chan.org/fsw/fontxedit.zip) is a font file editor.   \nThis can be done on Windows 10.   \nDeveloper page is [here](http://elm-chan.org/fsw_e.html).   \n\n![fontx-editor-1](https://github.com/user-attachments/assets/76a8c96f-74c3-4583-a4f1-5664f0e81f3a)\n\n\n# Convert from TTF font to FONTX font  \nstep1)   \nDownload WFONTX64.exe from [here](https://github.com/nemuisan/WFONTX64/releases).\nDeveloper page is [here](https://github.com/nemuisan/WFONTX64).   \n\nstep2)   \nSelect ttf font.   \n___Please note that if you select a proportional font, some fonts may not convert correctly.___   \nIf you select a proportional font, some fonts will need to be modified using fontxedit.exe.   \nMonospaced fonts can be converted correctly.   \n![Algerian16-1](https://github.com/user-attachments/assets/cb8b0d4b-fe91-420c-8778-6f7a044ca78a)\n\nstep3)   \nEnter Height, Width, FontX2 name.   \nSpecify half of Height for Width.   \nSpecify your favorite font name in the FontX2 name field using up to 8 characters.   \n![Algerian16-2](https://github.com/user-attachments/assets/57035c25-2337-45c8-839a-0310410e6c01)\n\n\nstep4)   \nSpecify the file name to save.   \n![Algerian16-3](https://github.com/user-attachments/assets/face29c3-1cf6-4e9c-85c0-7dfc9bcf3aad)\n\nstep5)   \nSpecify the font style as required.   \n![Algerian16-4](https://github.com/user-attachments/assets/8e8a13e5-5283-4341-8ef4-2292650afab1)\n\nstep6)   \nPress the RUN button to convert TTF fonts to FONTX format.   \n![Algerian16-5](https://github.com/user-attachments/assets/cc36c27d-6eb2-4286-8870-33c393dad9c8)\n\nstep7)   \nupload your font file to $HOME/Raspberry-ssd1306/fontx directory.   \n\nstep8)   \nadd font to use   \n```\n  // You can change font file\n  //Fontx_init(fx,\"./fontx/ILGH16XB.FNT\",\"./fontx/ILGZ16XB.FNT\"); // 16Dot Gothic\n  //Fontx_init(fx,\"./fontx/ILMH16XB.FNT\",\"./fontx/ILMZ16XB.FNT\"); // 16Dot Mincyo\n  Fontx_init(fx,\"./fontx/Algerian16.FNT\",\"\"); // 16Dot Algerian\n```\n\n![Algerian16-6](https://github.com/user-attachments/assets/9d5e1432-bb01-4571-a085-e86a62bfe24f)\n\n---\n\nLeft  : OrangePi + SPI Module  \nRight : RaspberryPi + I2C Module  \n![oled-2](https://user-images.githubusercontent.com/6020549/28252021-b1a9ff4a-6ac5-11e7-9265-b757e4b3cf1d.JPG)\n\n---\n\n![OLED-1](https://user-images.githubusercontent.com/6020549/82556597-07251000-9ba5-11ea-9658-84e21e635273.JPG)\n\n![OLED-2](https://user-images.githubusercontent.com/6020549/82556776-5f5c1200-9ba5-11ea-914e-e94744ceebf9.jpg)\n\nLine1-2 : External Font  \nLine3-4 : Internal Font  \n![OLED-4](https://user-images.githubusercontent.com/6020549/82556641-1efc9400-9ba5-11ea-9928-5b3f3988cc5f.JPG)\n\nUnderline and Invert   \n![OLED-5](https://user-images.githubusercontent.com/6020549/82556679-2de34680-9ba5-11ea-9f9b-1314b84069c0.JPG)\n\nSet start colum  \n![OLED-6](https://user-images.githubusercontent.com/6020549/82556897-9c280900-9ba5-11ea-9c0b-b341931e9a98.JPG)\n\n![OLED-7](https://user-images.githubusercontent.com/6020549/82556916-a518da80-9ba5-11ea-95c2-627ec1b96d8f.JPG)\n\n---\n\nRaspberryPi ZERO HAT + OLED   \n![RaspberryPi-ZERO](https://user-images.githubusercontent.com/6020549/67628271-a438f800-f8a5-11e9-8af8-99964ebaae8e.JPG)\n\nOrangePi ZERO HAT + OLED  \n![zero-hat-7](https://user-images.githubusercontent.com/6020549/28547249-00f71026-7109-11e7-9a11-0bbb95423381.JPG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fraspberry-ssd1306","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fraspberry-ssd1306","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fraspberry-ssd1306/lists"}