From 833094a27d592a8d406ca12edd04fc0425a073c6 Mon Sep 17 00:00:00 2001 From: starcalc Date: Sun, 27 Feb 2022 15:32:47 +0000 Subject: [PATCH] =?UTF-8?q?Pi=20im=20Standard=20und=20Ausgabe=20versch?= =?UTF-8?q?=C3=B6nert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pi/s.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Pi/s.py b/Pi/s.py index 3b8cde4..5de7961 100755 --- a/Pi/s.py +++ b/Pi/s.py @@ -4,8 +4,8 @@ import serial import pygame serialmode=True #True for Raspberry Pi with Arduino connected, False for testing with keyboard -#serialport="/dev/ttyS0" # Raspberry Pi -serialport="/dev/ttyUSB0" +serialport="/dev/ttyS0" # Raspberry Pi +# serialport="/dev/ttyUSB0" pygame.mixer.pre_init(buffer=32) pygame.init() @@ -89,13 +89,21 @@ while True: Sound[i].stop() Sound[i].play() Soundplaying[i]=True - print("play "+str(i)) + #print(str(i), end='') i+=1 else: #changed to 0 if Soundplaying[i]: #Sound[i].stop() Sound[i].fadeout(500) Soundplaying[i]=False - print("stop "+str(i)) + # print("stop "+str(i), end='') + + for i in range(8): + if Soundplaying[i]: + print(str(i), end='') + else: + print(" ", end='') + print("", end='\r') oldrcv = rcv +