{"id":19554152,"url":"https://github.com/berndporr/alphabot","last_synced_at":"2026-01-24T04:36:04.842Z","repository":{"id":41401888,"uuid":"354257435","full_name":"berndporr/alphabot","owner":"berndporr","description":"C++ API to control the functionality of a heavily customised Alphabot with a Raspberry PI","archived":false,"fork":false,"pushed_at":"2022-07-07T22:05:49.000Z","size":594,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T00:04:54.654Z","etag":null,"topics":["alphabot","pwm","robot","robotics","robotics-programming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/berndporr.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}},"created_at":"2021-04-03T10:03:05.000Z","updated_at":"2024-09-10T00:10:04.000Z","dependencies_parsed_at":"2022-08-28T18:02:34.844Z","dependency_job_id":null,"html_url":"https://github.com/berndporr/alphabot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndporr%2Falphabot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndporr%2Falphabot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndporr%2Falphabot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berndporr%2Falphabot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berndporr","download_url":"https://codeload.github.com/berndporr/alphabot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249749736,"owners_count":21320019,"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":["alphabot","pwm","robot","robotics","robotics-programming"],"created_at":"2024-11-11T04:26:06.101Z","updated_at":"2026-01-24T04:36:04.837Z","avatar_url":"https://github.com/berndporr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ Alphabot API for the Raspberry PI\n\nThis page provides instructions how to customise the alphabot so that it's actually\nusable for research and it provides a C++ API with proper setters and callbacks.\n\n![alt tag](robot.jpg)\n\nC++ class to control the basic functionality of a customised Alphabot\n(https://www.waveshare.com/wiki/AlphaBot) with a Raspberry PI:\n\n - Motor control (using the Parallax Continuous Rotation Servo)\n - Battery voltage\n\n## Hardware mods\n\n### Parallax Continuous Rotation Servos\n\nThrow the original DC motors in the bin and fit the [Parallax Continuous Rotation Servo](https://www.parallax.com/product/parallax-continuous-rotation-servo/) with 90deg brackets. Plug them into the servo ports S1 and S2.\n\nWire up the pin header:\n\n![alt tag](header.jpg)\n\n```\nGPIO18 / PWM2 = S1 = Motor left\nGPIO19 / PWM3 = S2 = Motor right\n```\n\n### Voltage regulator\n\nDe-solder the LM2596 and throw it in the bin. It supposed to have a dropout voltage of 1V so that the 7-7.2V from the battery\nshould be fine but it seems to be more 2V. It's not even recommended by TI who recommend the LMR33630 for new designs.\n\nReplace the LM2596 with a [MGS100505](https://onecall.farnell.com/cosel/mgs100505/dc-dc-converter-5v-2a/dp/4296076). Just glue it upside down on the PCB and run 4 wires to Vin and +5V.\n\n## Software prerequisites\n\nAdd to `/boot/firmware/config.txt`:\n\n```\ndtoverlay=pwm-2chan\n```\n\nand reboot.\n\nCheck with:\n\n```\npinctrl -p\n```\n\nthat you see:\n\n```\n12: a3    pd | lo // GPIO18 = PWM0_CHAN2\n35: a3    pd | lo // GPIO19 = PWM0_CHAN3\n```\n\nwhich corresponds to the sysfs files:\n\n```\n/sys/class/pwm/pwmchip0/pwm2: GPIO18 \n/sys/class/pwm/pwmchip0/pwm3: GPIO19\n```\n\n### libgpiod\n\nThe GPIO pins are accessed via the C++ API of the `libgpiod`:\n\n```\napt-get install libgpiod-dev\n```\n\n### ncurses\nThe demo programs below display the sensor\nreadings with the ncurses library. Install\nit with\n```\napt-get install libncurses-dev\n```\n\n## Building\n\nThe built system is `cmake`. Just type:\n```\ncmake .\nmake\nsudo make install\n```\n\n## Usage\n\nThe online documentation is here: https://berndporr.github.io/alphabot/\n\n### Start/stop\n\nStart the callback reporting the battery voltage.\n```\nstart()\n```\n\nStop the callback.\n```\nstop()\n```\n\n### Motor speed\n\nSetting the speeds of the left/right wheels:\n```\nsetLeftWheelSpeed(float speed);\nsetRightWheelSpeed(float speed);\n```\nwhere speed is between -1 and +1.\n\n### Callback\n\nThere is a callback which reports the battery voltage.\n\n## Demo programs\n\n![alt tag](testIO.png)\n\n`testIO` is a simple test program which displays the battery voltage and you can test the motors. It also shows\nhow the callback is used to display the battery voltage.\n\n`testMotor` ramps up the motor speed and back again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberndporr%2Falphabot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberndporr%2Falphabot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberndporr%2Falphabot/lists"}