From 0d4efc19d993f22be5e3e61a3204fed864fae522 Mon Sep 17 00:00:00 2001 From: nihonium Date: Mon, 7 Mar 2022 10:02:16 +0300 Subject: [PATCH] 2 --- 1/1.py | 17 +++++++++++++++++ 1/2.py | 13 +++++++++++++ 2/2-3-aux.py | 19 +++++++++++++++++++ 2/data.txt | 3 +++ 4 files changed, 52 insertions(+) create mode 100644 1/1.py create mode 100644 1/2.py create mode 100644 2/2-3-aux.py diff --git a/1/1.py b/1/1.py new file mode 100644 index 0000000..f8f94e2 --- /dev/null +++ b/1/1.py @@ -0,0 +1,17 @@ +#!/bin/python3 + +import RPi.GPIO as GPIO +from time import sleep + +GPIO.setwarnings(False) + +GPIO.setmode(GPIO.BCM) +GPIO.setup(14, GPIO.OUT) + +GPIO.output(14, 1) +sleep(2) +GPIO.output(14, 0) +sleep(2) +GPIO.output(14, 1) +sleep(2) +GPIO.output(14, 0) diff --git a/1/2.py b/1/2.py new file mode 100644 index 0000000..85e2c8a --- /dev/null +++ b/1/2.py @@ -0,0 +1,13 @@ +#!/bin/python3 + +import RPi.GPIO as GPIO +from time import sleep + +GPIO.setwarnings(False) + +GPIO.setmode(GPIO.BCM) +GPIO.setup(14, GPIO.OUT) +GPIO.setup(15, GPIO.IN) + +GPIO.output(14, GPIO.input(15)) + diff --git a/2/2-3-aux.py b/2/2-3-aux.py new file mode 100644 index 0000000..1572d06 --- /dev/null +++ b/2/2-3-aux.py @@ -0,0 +1,19 @@ +#!/bin/python3 + +import RPi.GPIO as GPIO +import time + +GPIO.setwarnings(False) + +GPIO.setmode(GPIO.BCM) +leds = [21, 20, 16, 12, 7, 8, 25, 24] +aux = [22, 23, 27, 18, 15, 14, 3, 2] + +GPIO.setup(leds, GPIO.OUT) +GPIO.setup(aux, GPIO.IN) + +GPIO.output(leds, 0) + +for i in range(len(leds)): + GPIO.output(leds[i], GPIO.input(aux[i])) + diff --git a/2/data.txt b/2/data.txt index a7208d4..2e39472 100644 --- a/2/data.txt +++ b/2/data.txt @@ -2,3 +2,6 @@ 255 3.241 127 1.619 64 0.819 +32 0.415 +5 0.076 +0 0.0125