From 85732f2247d1669064e584ec9c99e5c7a5da4246 Mon Sep 17 00:00:00 2001 From: ckd2-elford <cosmo2.elford@live.uwe.ac.uk> Date: Fri, 27 Oct 2023 13:13:09 +0000 Subject: [PATCH] Update file README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84dab4c..a53c23e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,40 @@ GPIO.output(18,GPIO.HIGH) ## Task 3 +Code: +``` +import RPi.GPIO as GPIO +import time + +GPIO.setmode(GPIO.BCM) +GPIO.setwarnings(False) + +# Green +GPIO.setup(24,GPIO.OUT) + +# Yellow +GPIO.setup(8,GPIO.OUT) + +# Red +GPIO.setup(22,GPIO.OUT) + +while True: + GPIO.output(24,GPIO.HIGH) + time.sleep(0.1) + GPIO.output(24,GPIO.LOW) + time.sleep(0.1) + GPIO.output(8,GPIO.HIGH) + time.sleep(0.1) + GPIO.output(8,GPIO.LOW) + time.sleep(0.1) + GPIO.output(22,GPIO.HIGH) + time.sleep(0.1) + GPIO.output(22,GPIO.LOW) + time.sleep(0.1) +``` + <img src="Task2.JPG" width="30%"> -## Task 4 -[](http://www.youtube.com/watch?v=7xLNLzCIo9c) \ No newline at end of file +Video short: +[](http://www.youtube.com/watch?v=7xLNLzCIo9c) + -- GitLab