{"id":15020593,"url":"https://github.com/ajaxxishere/raspberrypi-mastermind","last_synced_at":"2026-02-14T16:32:18.480Z","repository":{"id":228140444,"uuid":"772509741","full_name":"AjaxxIsHere/RaspberryPi-MasterMInd","owner":"AjaxxIsHere","description":"Creating a mini-game using C and arm-ASM with a raspberryPi 3","archived":false,"fork":false,"pushed_at":"2024-04-04T17:16:33.000Z","size":1059,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T09:42:28.875Z","etag":null,"topics":["assembly","c","make","physical-computing","raspberry-pi-3"],"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/AjaxxIsHere.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":"2024-03-15T10:32:33.000Z","updated_at":"2024-03-30T01:18:16.000Z","dependencies_parsed_at":"2024-10-11T02:01:59.697Z","dependency_job_id":"0da3b2ae-909a-45f5-bb2c-6c5876b6875e","html_url":"https://github.com/AjaxxIsHere/RaspberryPi-MasterMInd","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"9d3ace66ae41e21f617322297c9ee81b0e8da63e"},"previous_names":["ajaxxishere/raspberrypi-mastermind"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjaxxIsHere%2FRaspberryPi-MasterMInd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjaxxIsHere%2FRaspberryPi-MasterMInd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjaxxIsHere%2FRaspberryPi-MasterMInd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjaxxIsHere%2FRaspberryPi-MasterMInd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AjaxxIsHere","download_url":"https://codeload.github.com/AjaxxIsHere/RaspberryPi-MasterMInd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239686132,"owners_count":19680463,"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":["assembly","c","make","physical-computing","raspberry-pi-3"],"created_at":"2024-09-24T19:55:18.575Z","updated_at":"2025-09-21T22:18:25.547Z","avatar_url":"https://github.com/AjaxxIsHere.png","language":"C","readme":"# f28hs-2023-24-cwk2-sys\n\nCoursework 2 in F28HS \"Hardware-Software Interface\" on Systems Programming in C and ARM Assembler\n\nThe [CW specification is here](http://www.macs.hw.ac.uk/~hwloidl/Courses/F28HS/Coursework_F28HS_CW2_2024.pdf)\n\nLinks:\n- You can use any machine with an installation of the `gcc` C compiler for running the C code of the game logic\n- Template for the C program: [master-mind.c](master-mind.c)\n- Template for the ARM Assembler program: [mm-matches.s](mm-matches.s)\n\n## Contents\n\nThis folder contains the following CW2 specification template files for the source code and for the report:\n- `master-mind.c` ... the main C program for the CW implementation, and most aux fcts\n- `mm-matches.s`  ... the matching function, implemented in ARM Assembler\n- `lcdBinary.c`   ... the low-level code for hardware interaction with LED, button, and LCD;\n                      this should be implemented in inline Assembler; \n- `testm.c`       ... a testing function to test C vs Assembler implementations of the matching function\n- `test.sh`       ... a script for unit testing the matching function, using the -u option of the main prg\n\n## Gitlab usage\n\n**Fork** and **Clone** this gitlab repo to get started on the coursework.\n\nComplete the functions in `master-mind.c` and in `lcdBinary.c`. Initially, you can implement these as C\nfunctions. However, for the final implementation, the low-level functions for controlling LED, button, and\nLCD display should be implemented in inline Assembler (in `lcdBinary.c`). Note that the **matching function**,\nfor calculating the number of exact and approximate matches also needs to be implemented in ARM Assembler.\nThe file `mm-matches.s` contains a template this Assembler code.\n\nYou can test basic functionality by using the `testm.c` C function and the `test.sh` shell script (see below).\n\n**Push** to the repo and ask questions in the comments box to get help.\n\n## Building and running the application\n\nYou can build the main C program (in `master-mind.c`), and the `testm.c` testing function, by typing\n\u003e make all\n\nand run the Master Mind program in debug mode by typing\n\u003e make run\n\nand do unit testing on the matching function\n\u003e make unit\n\nor alternatively check C vs Assembler version of the matching function\n\u003e make test\n\nFor the Assembler part, you need to edit the `mm-matches.s` file, compile and test this version on the Raspberry Pi.\nSee the test input data in the `secret` and `guess` structures at the end of the file, for testing.\n\nAfter having tested the components separately, integrate both so that the C program (in `master-mind.c`)\ncalls the ARM Assembler code (in `mm-matches.s`) for the matching function.\nFor controlling the external devices of LED, LCD and button use inline Assembler code, as discussed in\nthe matching lecture in the course.\n\nThe final version of the code should be pushed to this repo, and also submitted through Canvas, together with the report and video.\n\nA test script is available to do unit-testing of the matching function. Run it like this from the command line\n\u003e sh ./test.sh\n\nTo test whether all tests have been successful you can do\n\u003e echo $?\n\nwhich should print `0`.\n\nIf you picked up the `.gitlab-ci.yml` file in this repo, this test will be done automatically when uploading the file and you will get either a Pass or Fail in the CI section of the gitlab-student server.\n\n## Unit testing\n\nThis is an example of doing unit-testing on 2 sequences (C part only):\n```\n\u003e ./cw2 -u 121 313\n0 exact matches\n1 approximate matches\n```\n\nThe general format for the command line is as follows (see template code in `master-mind.c` for processing command line options):\n```\n./cw2 [-v] [-d] [-s] \u003csecret sequence\u003e [-u \u003csequence1\u003e \u003csequence2\u003e]\n```\n\n## Wiring\n\nAn **green LED**, as output device, should be connected to the RPi2 using **GPIO pin 13.**\n\nA **red LED**, as output device, should be connected to the RPi2 using **GPIO pin 5.**\n\nA **Button**, as input device, should be connected to the RPi2 using **GPIO pin 19.**\n\nAn **LCD display**, with a potentiometer to control contrast, should be wired to the\nRaspberry by as shown in the Fritzing diagram below.\n\nYou will need resistors to control the current to the LED and from the Button. You\nwill also need a potentiometer to control the contrast of the LCD display.\n\nThe Fritzing diagram below visualises this wiring. \n\n![Fritzing Diagram](fritz_CW2_2020_bb.png \"Fritzing Diagram with LED and Button\")\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaxxishere%2Fraspberrypi-mastermind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajaxxishere%2Fraspberrypi-mastermind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaxxishere%2Fraspberrypi-mastermind/lists"}