- Samsung Galaxy S24 - nos, Exynos
- Redmi Note 13 Pro+ - a fejlődés íve
- Samsung Galaxy Z Fold5 - toldozás-foldozás
- MG4 menetpróba
- Vodafone mobilszolgáltatások
- Ezek a OnePlus 12 és 12R európai árai
- Mi nincs, grafén akku van: itt a Xiaomi 11T és 11T Pro
- Magisk
- Samsung Galaxy S23 Ultra - non plus ultra
- Poco F3 - a mindenes, de nem mindenkinek
Hirdetés
-
A Coca-Cola következő nagy újítása az AI
it 1,1 milliárd dolláros üzletet kötött a Coca-Cola és a Microsoft, hogy előbbi használja majd a redmondi felhőt és AI-t.
-
Garmin Forerunner 165 - alapozó edzés
ma Leizzadtunk a Garmin legolcsóbb amoledes futóórájával.
-
Kulisszák mögötti videón a hamarosan megjelenő Stellar Blade
gp A kizárólag PlayStation 5-re szánt akciójáték alig két nap múlva debütál.
-
Mobilarena
Huawei P9-P9 Lite OFF topik
Új hozzászólás Aktív témák
-
petya220
senior tag
Valaki programozó közülünk rajtam, és Cunaján kívül?
Hogy tudok egy tömb-be parancsokat dobálni, értékek helyett?
Csak,hogy ne legyen ilyen hosszú a programom: (ez még hosszabb lesz...)
import time
import RPi.GPIO as GPIO
GPIO.cleanup()
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
channel = [17,18,22,27]
GPIO.setup(channel, GPIO.OUT)
time.sleep(0.5)
x=1
while True:
print "0"
GPIO.output(17, GPIO.LOW)
GPIO.output(18, GPIO.LOW)
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "1"
GPIO.output(17, GPIO.HIGH)
GPIO.output(18, GPIO.LOW)
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "2"
GPIO.output(17, GPIO.LOW)
GPIO.output(18, GPIO.HIGH)
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "3"
GPIO.output(17, GPIO.HIGH)
GPIO.output(18, GPIO.HIGH)
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "4"
GPIO.output(17, GPIO.LOW)
GPIO.output(18, GPIO.LOW)
GPIO.output(27, GPIO.HIGH)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "5"
GPIO.output(17, GPIO.HIGH)
GPIO.output(18, GPIO.LOW)
GPIO.output(27, GPIO.HIGH)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "6"
GPIO.output(17, GPIO.LOW)
GPIO.output(18, GPIO.HIGH)
GPIO.output(27, GPIO.HIGH)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "7"
GPIO.output(17, GPIO.HIGH)
GPIO.output(18, GPIO.HIGH)
GPIO.output(27, GPIO.HIGH)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
print "8"
GPIO.output(17, GPIO.LOW)
GPIO.output(18, GPIO.LOW)
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.HIGH)
time.sleep(0.5)
print "9"
GPIO.output(17, GPIO.HIGH)
GPIO.output(18, GPIO.LOW)
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.HIGH)
print "clean"
time.sleep(0.5)
GPIO.cleanup()Ezt a 4 sort:
GPIO.output(17, GPIO.LOW)
GPIO.output(18, GPIO.LOW)
GPIO.output(27, GPIO.LOW)
GPIO.output(22, GPIO.LOW)
time.sleep(0.5)
belerakni egy kis tömbbem és 4 sor helyett, csak egy tömb nvevet kellene meghívnom, sokkal jobb lenne. ötlet?[ Szerkesztve ]
"Neked is pörög az agyad a szarokon, amíg a mosoly a szádra kanyarodik."
Új hozzászólás Aktív témák
- Samsung Galaxy S24 - nos, Exynos
- Redmi Note 13 Pro+ - a fejlődés íve
- S.T.A.L.K.E.R.: Shadow of Chernobyl
- Mobilinternet
- Vezeték nélküli fülhallgatók
- S.T.A.L.K.E.R. Clear Sky
- bitpork: Fogyasztásra ítélve
- Samsung Galaxy Z Fold5 - toldozás-foldozás
- Ford topik
- Milyen billentyűzetet vegyek?
- További aktív témák...
- ZOTAC GeForce GTX 1080 AMP Edition 8GB GDDR5X 256bit
- Filmes gép gyűjtemény
- Nikon D5000 + AF-S DX NIKKOR 18-105 mm
- Bontatlan Seagate & Western Digital HDD-k 3TB - 12TB -ig - Számla + Garancia, Ár alatt! BeszámítOK!
- DJI Mini 4 pro FMC drón - 3 akku, RC2 táv, 2 táska, Filterek, 2025. decemberig garancia, DJI Care