{"id":24347691,"url":"https://github.com/pymongo/saks","last_synced_at":"2025-04-09T19:16:10.892Z","repository":{"id":57666199,"uuid":"314721061","full_name":"pymongo/saks","owner":"pymongo","description":"Rust library for Swiss Army Knife Shield for Raspberry Pi","archived":false,"fork":false,"pushed_at":"2021-07-11T03:57:33.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T19:16:00.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/pymongo.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}},"created_at":"2020-11-21T03:03:21.000Z","updated_at":"2021-07-11T03:57:35.000Z","dependencies_parsed_at":"2022-09-26T20:31:35.883Z","dependency_job_id":null,"html_url":"https://github.com/pymongo/saks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fsaks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fsaks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fsaks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fsaks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pymongo","download_url":"https://codeload.github.com/pymongo/saks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094988,"owners_count":21046770,"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":[],"created_at":"2025-01-18T11:19:33.032Z","updated_at":"2025-04-09T19:16:10.860Z","avatar_url":"https://github.com/pymongo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SAKS hat for raspberry_pi\n\nSAKS = Swiss Army Knife Shield for Raspberry Pi\n\n![](https://shumeipai.nxez.com/wp-content/uploads/2015/03/20180301135557875.jpg)\n\n## examples\n\n### turn on buzzer by saks::Saks lib\n\n```rust\nuse saks::{Saks, SaksPins, VoltageLevel};\n\nfn main() {\n    // Saks lib would automatic set buzzer pin to Output mode,\n    // and turn off buzzer when deconstruct\n    let saks_gpio = Saks::new();\n    saks_gpio.set_level(SaksPins::Buzzer, VoltageLevel::Low);\n    std::thread::sleep(std::time::Duration::from_millis(2000));\n}\n```\n\n### turn on buzzer via command line\n\n\u003e raspi-gpio set 12 op\n\u003e \n\u003e raspi-gpio set 12 dl\n\n---\n\n## How other library control GPIO\n\nwiringpi system but uses the /sys/class/gpio interface **rather than accessing the hardware directly**(softPwmWrite)\n\n[sprintf(fName, \"/sys/class/gpio/gpio%d/value\", i)](https://github.com/WiringPi/WiringPi/blob/093e0a17a40e064260c1f3233b1ccdf7e4c66690/gpio/gpio.c#L428)\n\n1. /sys/class/gpio: sysfs_gpio(deprecated), gpio(deprecated), maybe not working in pi4B\n2. /dev/gpiomem or /dev/gpiochip0: rppal, wiringpi, gpio-cdev\n3. /dev/pigpio and pigpio daemon process: pigpio\n\n## Some questions need to solve\n\n- [ ] Why gpio access from /dev/gpiomem via mmap syscall is faster than `format!(\"/sys/class/gpio/gpio{}/active_low\", gpio_num)`\n- [ ] Why gpio pin number has three encoding?(BOARD, BCM, wiringpi)\n- [ ] About the onboard_led(/sys/class/leds/led0/) like arduino's LED_BUILTIN\n\n---\n\n## My raspberry_pi notes\n\n### CPU temperature\n\n\u003e vcgencmd measure_temp\n\n### Setup raspberry_pi\n\nHow to connect raspberry_pi without internet/display/GUI Desktop? \n\n1. put empty ssh file to SD card root directory in order to enable SSH on first time boot\n2. SSH to pi via ethernet cable or serial(RS-232 with RXD+TXD+GND, don't connect 5V pin!) port\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymongo%2Fsaks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpymongo%2Fsaks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymongo%2Fsaks/lists"}