Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from master #28

Merged
merged 18 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions lessons/lesson_1/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

"""
Raspberry Pi Pico W LESSON 1: Write Your First Program for Absolute Beginners
https://www.youtube.com/watch?v=SL4_oU9t8Ss&list=PLGs0VKk2DiYz8js1SJog21cDhkBqyAhC5
Expand All @@ -11,14 +12,23 @@
IS_ON = 0


def toggle_led(IS_ON) -> None:
def toggle_is_on(val: int) -> int:
"""
Update ISA_ON value
"""
return 1 if val == 0 else 0


def toggle_led(val: int) -> None:

"""
Toggle LED
"""
LED.value(IS_ON)
LED.value(val)


if __name__ == '__main__':
while True:
toggle_led(IS_ON)
time.sleep(0.3
IS_ON = 1 if IS_ON == 0 else 1
time.sleep(0.3)
IS_ON = toggle_is_on(IS_ON)
5 changes: 2 additions & 3 deletions tests/lesson_1_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

import unittest
from unittest.mock import MagicMock
from lessons.lesson_1.main import ( # pylint: disable=import-error
LED
)
# pylint: disable=import-error
from lessons.lesson_1.main import LED


class Lesson1TestCase(unittest.TestCase):
Expand Down
Loading