{"id":24664914,"url":"https://github.com/tempehs/micropython_oop_mini_project","last_synced_at":"2025-03-21T09:43:37.704Z","repository":{"id":273505480,"uuid":"919921496","full_name":"TempeHS/MicroPython_OOP_Mini_Project","owner":"TempeHS","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-21T09:38:20.000Z","size":3155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-21T10:31:46.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TempeHS.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":"2025-01-21T08:54:38.000Z","updated_at":"2025-01-21T09:38:24.000Z","dependencies_parsed_at":"2025-01-21T10:42:42.010Z","dependency_job_id":null,"html_url":"https://github.com/TempeHS/MicroPython_OOP_Mini_Project","commit_stats":null,"previous_names":["tempehs/micropython_oop_mini_project"],"tags_count":0,"template":false,"template_full_name":"TempeHS/TempeHS_Pi_Pico_Boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2FMicroPython_OOP_Mini_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2FMicroPython_OOP_Mini_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2FMicroPython_OOP_Mini_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2FMicroPython_OOP_Mini_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TempeHS","download_url":"https://codeload.github.com/TempeHS/MicroPython_OOP_Mini_Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776270,"owners_count":20508503,"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-26T06:14:36.668Z","updated_at":"2025-03-21T09:43:37.679Z","avatar_url":"https://github.com/TempeHS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TODO\n\n- Test and refine buzzer\n- Controller class\n- Implement state machine in controller class\n- Refine variables, methods and class names\n- Add documentation\n\n# Learn MicroPython Raspberry Pi Pico\n\nThis repository is a mini OOP based project to explicitly teach Object Oriented Paradigm programming concepts specifically in the microcontroller context.\n\nStudents will be recreating a model of the pedestrian crossing on Unwins Bridge Road out the front of Tempe High School.\n\n![A street view image of the system we will be modeling](/images/real_world_situation.png \"The traffic lights, pedestrian warning lights, pedestrian button and control system.\")\n\nFrom the above real world control system we will model:\n\n- Overloading and overriding polymorphism\n- Inheritance, multilevel inheritance and multiple class inheritance\n- Abstraction\n- Decomposition and composition\n- Generalisation\n- Encapsulation\n- Object instantiation, objects as instance variables\n\n## Wire your system\n\n![A prototype of the model](/images/prototype_model.png \"Use the below components to wire this model.\")\n\n### Components\n\n- Breadboard\n- Momentary switch\n- 5x LED\n- 1x Piezo buzzer\n- 5x 220Ω resistors\n- Jumper leads\n- Pi Pico\n\n### Pin allocation\n\n| Pin  |                      |\n| ---- | -------------------- |\n| GP3  | Red LED              |\n| GP4  | Keyboard Interrupt   |\n| GP5  | Amber LED            |\n| GP7  | Red LED              |\n| GP17 | Flashing Green LED   |\n| GP19 | Flashing Red LED     |\n| GP22 | Button signal        |\n| GP27 | Piezo Buzzer         |\n| GND  | Circuit Ground       |\n| 3V3  | Button logic voltage |\n\n## UML Diagram\n\n```mermaid\nclassDiagram\n    PIN \u003c|-- Button : Inheritance\n    PIN \u003c|-- Led_Light : Inheritance\n    PWM \u003c|-- Buzzer : Inheritance\n    Led_Light \u003c|-- Flashing_Light : Inheritance\n    Buzzer \u003c|-- Flashing_Light : Inheritance\n    Button --* Pedestrian_Crossing : Composition\n    Led_Light --* Pedestrian_Crossing : Composition\n    Flashing_Light --* Pedestrian_Crossing : Composition\n    class PIN{\n\n    }\n    class Led_Light{\n        obj Servo\n        get_pos()\n        set_rot_cw(count)\n        set_rot_ccw(count)\n    }\n    class Flashing_Light{\n        obj Servo\n        int start_angle\n        int min_set_angle\n        int max_set_angle\n        get_angle()\n        set_angle(angle)\n    }\n    class Button{\n        obj Servo\n        int open_angle\n        int closed_angle\n        bool claw_state\n        set_open()\n        set_closed()\n        get_state()\n    }\n    class Pedestrian_Crossing{\n        obj Claw\n        obj Base\n        obj Elbow\n        obj Elbow\n        pick_cube()\n        place_cube()\n    }\n```\n\n\u003e [!Note]\n\u003e Inheritance and association labels are note required in a UML diagram but have been added for understanding.\n\n## Versions\n\n| Version | Notes                                                                                                                     |\n| ------- | ------------------------------------------------------------------------------------------------------------------------- |\n| v01.py  | Basic \"Blink\" Program (the Hello World of mechatronics).                                                                  |\n| v02.py  | Test wiring and use basic methods from parent `Pin` class.                                                                |\n| v03.py  | Implement a child class of MicroPython `Pin` class for the traffic lights, demonstrating Inheritance and Polymorphism.    |\n| v04.py  | Move the `Led_Light` class to a separate file, demonstrating abstraction.                                                 |\n| v05.py  | Write a `Button` class and test it by instantiating it and controlling the `red_light` instance of the `Led_Light` class. |\n| v06.py  | Implement a Event Trigger for when the button has been pressed.                                                           |\n| v07.py  | Demo code only of Multiple Inheritence.                                                                                   |\n\n\u003cp xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dct=\"http://purl.org/dc/terms/\"\u003e\u003ca property=\"dct:title\" rel=\"cc:attributionURL\" href=\"https://github.com/TempeHS/TempeHS_PI_Pico_Boilerplate\"\u003eTempeHS Pi Pico Boilerplate\n\u003c/a\u003e by \u003ca rel=\"cc:attributionURL dct:creator\" property=\"cc:attributionName\" href=\"https://github.com/benpaddlejones\"\u003eBen Jones\u003c/a\u003e is licensed under \u003ca href=\"https://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display:inline-block;\"\u003eCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International\u003cimg style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1\" alt=\"\"\u003e\u003cimg style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1\" alt=\"\"\u003e\u003cimg style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1\" alt=\"\"\u003e\u003cimg style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1\" alt=\"\"\u003e\u003c/a\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftempehs%2Fmicropython_oop_mini_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftempehs%2Fmicropython_oop_mini_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftempehs%2Fmicropython_oop_mini_project/lists"}