{"id":13750660,"url":"https://github.com/akiray03/mruby-WiringPi","last_synced_at":"2025-05-09T16:31:30.130Z","repository":{"id":6224891,"uuid":"7456343","full_name":"akiray03/mruby-WiringPi","owner":"akiray03","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-19T08:29:58.000Z","size":176,"stargazers_count":10,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T08:02:34.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/akiray03.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":"2013-01-05T14:47:20.000Z","updated_at":"2021-11-09T13:31:22.000Z","dependencies_parsed_at":"2022-09-15T12:40:37.921Z","dependency_job_id":null,"html_url":"https://github.com/akiray03/mruby-WiringPi","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/akiray03%2Fmruby-WiringPi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiray03%2Fmruby-WiringPi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiray03%2Fmruby-WiringPi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiray03%2Fmruby-WiringPi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akiray03","download_url":"https://codeload.github.com/akiray03/mruby-WiringPi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224869033,"owners_count":17383306,"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":"2024-08-03T08:00:43.727Z","updated_at":"2024-11-16T02:31:26.881Z","avatar_url":"https://github.com/akiray03.png","language":"C","readme":"mruby-WiringPi\n=========\n\n## How to use\n - checkout mruby\n\n```bash\ngit clone https://github.com/mruby/mruby.git  # original mruby\n  # or\ngit clone https://github.com/iij/mruby.git    # iij extended mruby (File, IO, Socket, ... extend)\n```\n\n  - edit `build_config.rb`\n\n```ruby\nMRuby::Build.new do |conf|\n\n    # ... (snip) ...\n\n    conf.gem :git =\u003e 'https://github.com/akiray03/mruby-WiringPi.git'  # add this line\n    conf.gem :git =\u003e 'https://github.com/matsumoto-r/mruby-sleep.git'  # add this line\nend\n```\n\n - build `ruby ./minirake`\n - exec `sudo ./bin/mruby build/mrbgems/mruby-WiringPi/sample/sample.rb`\n\n## Pin Mapping\n\n| wiringPi | GPIO (Pin#) | Name   |\n|:--------:|:----:|:------:|\n|      0   |  17  | GPIO 0 |\n|      1   |  18  | GPIO 1 |\n|      2   |  27  | GPIO 2 |\n|      3   |  22  | GPIO 3 |\n|      4   |  23  | GPIO 4 |\n|      5   |  24  | GPIO 5 |\n|      6   |  25  | GPIO 6 |\n|      7   |   4  | GPIO 7 |\n|      8   |   2  | SDA    |\n|      9   |   3  | SCL    |\n|     10   |   8  | CE0    |\n|     11   |   7  | CE1    |\n|     12   |  10  | MOSI   |\n|     13   |   9  | MISO   |\n|     14   |  11  | SCLK   |\n|     15   |  14  | TxD    |\n|     16   |  15  | RxD    |\n|     17   |  28  | GPIO 8 |\n|     18   |  29  | GPIO 9 |\n|     19   |  30  | GPIO10 |\n|     20   |  31  | GPIO11 |\n\n## sample\n\n```ruby\nio = WiringPi::GPIO.new\npin = 0\nio.mode(pin, WiringPi::OUTPUT)\n\n5.times do\n  puts \"pin:#{pin} set high\"\n  io.write(pin, WiringPi::HIGH)\n  sleep 1\n  puts \"pin:#{pin} set low\"\n  io.write(pin, WiringPi::LOW)\n  sleep 1\nend\nio.read(pin)\n```\n\n - WiringPi::Serial is not tested...\n\n## sample (LCD)\n\n - LCD control sample code for SC1602 http://akizukidenshi.com/catalog/g/gP-00038/\n\n| wiringPi | GPIO (Pin#) | Name   | LCD Port |\n|:--------:|:----:|:------:|:------:|\n|      0   |  17  | GPIO 0 |  DB0 |\n|      1   |  18  | GPIO 1 |  DB1 |\n|      2   |  27  | GPIO 2 |  DB2 |\n|      3   |  22  | GPIO 3 |  DB3 |\n|      4   |  23  | GPIO 4 |  DB4 |\n|      5   |  24  | GPIO 5 |  DB5 |\n|      6   |  25  | GPIO 6 |  DB6 |\n|      7   |   4  | GPIO 7 |  DB7 |\n|     12   |  10  | MOSI   | Enable |\n|     13   |   9  | MISO   | Register Select |\n\n - The Read/Write pin must be connected to 0V/Ground.\n\n```ruby\nlcd = LCD.new rows: 18, cols: 2, bits: 8, rs: 13, strb: 12, dpin: [0,1,2,3,4,5,6,7]\n\nlcd.lcd_pos 0, 0\nlcd.lcd_puts \"Hello, mruby\"\nlcd.lcd_pos 0, 1\nlcd.lcd_puts \"Hi, Raspberry Pi\"\n```\n\n\n## TODO\n\n - cross build support\n\n## License\nThis software is licensed under the same license terms of WiringPi (https://github.com/WiringPi/WiringPi).\n\n","funding_links":[],"categories":["System"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakiray03%2Fmruby-WiringPi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakiray03%2Fmruby-WiringPi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakiray03%2Fmruby-WiringPi/lists"}