{"id":25980403,"url":"https://github.com/leon-anavi/rpi-examples","last_synced_at":"2025-06-26T09:40:25.713Z","repository":{"id":72547698,"uuid":"54158139","full_name":"leon-anavi/rpi-examples","owner":"leon-anavi","description":"Raspberry Pi examples","archived":false,"fork":false,"pushed_at":"2022-08-20T17:01:50.000Z","size":110,"stargazers_count":149,"open_issues_count":0,"forks_count":84,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-07T23:27:05.958Z","etag":null,"topics":["examples","hacktoberfest","i2c","raspberry-pi","rpi"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leon-anavi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-03-17T23:26:16.000Z","updated_at":"2024-09-23T15:25:46.000Z","dependencies_parsed_at":"2023-06-03T12:00:32.507Z","dependency_job_id":null,"html_url":"https://github.com/leon-anavi/rpi-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leon-anavi/rpi-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-anavi%2Frpi-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-anavi%2Frpi-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-anavi%2Frpi-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-anavi%2Frpi-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leon-anavi","download_url":"https://codeload.github.com/leon-anavi/rpi-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-anavi%2Frpi-examples/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262040145,"owners_count":23249348,"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","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":["examples","hacktoberfest","i2c","raspberry-pi","rpi"],"created_at":"2025-03-05T07:34:43.626Z","updated_at":"2025-06-26T09:40:25.705Z","avatar_url":"https://github.com/leon-anavi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpi-examples\n\nThis repository provides various examples for using peripheral devices such as sensors, buzzers, relays and add-on boards on Raspberry Pi single board computers written in popular programming languages C, C++, Python, etc. All examples are available under MIT license.\n\nThese examples are appropriate for beginners. Hopefully, they will encourage more developers to join the Raspberry Pi community and to help them get started easily with various peripheral devices for both professional and hobby and DIY projects.\n\n# Videos\n\n* Buzzer: https://www.youtube.com/watch?v=j8HnKM58QXk\n* LM75A: https://www.youtube.com/watch?v=pyg27uj0Xns\n* HTU21D: https://www.youtube.com/watch?v=A_yruJtYUwE\n\n# Notes\n\nIf you are interested in running any of the examples for I2C written in C/C++ as a regular user (not root) perform the following steps:\n* Remove line \"wiringPiSetup();\" in \"HTU21D_test.c\"\n* Add your user in \"i2c\" group\n\n## Buzzer\n\n### C\n\n#### Beep\n\nSimple application to test if a piezo buzzer attached to pin 11 is working.\n\nInstall [wiringPi](http://wiringpi.com/download-and-install/) and after that execute the following command to build the application:\n\n```\ncd buzzer/c/\ngcc beep.c -o beep -lwiringPi -std=c99\n```\n\nExecute the following command to run the application:\n```\nsudo ./beep\n```\n\n#### Star Wars\n\nImplementation of the Imperial March from Star Wars.\n\nInstall [wiringPi](http://wiringpi.com/download-and-install/) and after that execute the following command to build the application:\n\n```\ncd buzzer/c/\ngcc starwars.c -o starwars -lwiringPi -std=c99\n```\n\nExecute the following command to play the Imperial March:\n```\nsudo ./starwars\n```\n\n#### TSL2561\n\nInstall i2c tools:\n```\nsudo apt-get install i2c-tools\n\n```\n\nEnable i2c on Raspberry Pi with Raspian GNU/Linux distribution:\n```\nsudo raspi-config\n```\n\nGo to Advanced Options \u003e A7 I2C and reboot the board\n\nVerify that TSL2561 is detected on i2c address 39 on bus 1:\n```\npi@raspberrypi:~ $ i2cdetect -y 1\n     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n00:          -- -- -- -- -- -- -- -- -- -- -- -- -- \n10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n30: -- -- -- -- -- -- -- -- -- 39 -- -- -- -- -- -- \n40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n70: -- -- -- -- -- -- -- --\n```\n\nBuild and run the source code\n```\ncd TSL2561/c/\nmake\n./TSL2561_test\n```\n\n## MAX44009 Ambient Light Sensor Module\n\nBuild and run the source code\n```\ncd MAX44009/c/\nmake\n./MAX44009_test\n```\n\nThe example written in the C programming language has been cotributed by Pixel_K.\n\n## PN532 NFC Module\n\n* Install Adafruit Python PN532:\n\n```\nsudo apt-get update\nsudo apt-get install build-essential python-dev git\ncd ~\ngit clone https://github.com/adafruit/Adafruit_Python_PN532.git\ncd Adafruit_Python_PN532\nsudo python setup.py install\n```\n\n* Clone rpi-examples:\n\n```\ncd ~\ngit clone https://github.com/leon-anavi/rpi-examples.git\n```\n\n* Save data to RFID/NFC card\n\n```\ncd ~/rpi-examples/PN532/python\nsudo python rfid-save.py\n```\n\n* Listen and scan for RFID/NFC cards\n\n```\ncd ~/rpi-examples/PN532/python\nsudo python rfid-scan.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon-anavi%2Frpi-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleon-anavi%2Frpi-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon-anavi%2Frpi-examples/lists"}