diff --git a/Code/Server/servo.py b/Code/Server/servo.py index 8f16e6b..4990953 100644 --- a/Code/Server/servo.py +++ b/Code/Server/servo.py @@ -27,9 +27,18 @@ class Servo: # Main program logic follows: if __name__ == '__main__': + print("Now servos will rotate to 90°.") + print("If they have already been at 90°, nothing will be observed.") + print("Please keep the program running when installing the servos.") + print("After that, you can press ctrl-C to end the program.") pwm=Servo() - pwm.setServoPwm('0',90) - pwm.setServoPwm('1',90) + while True: + try : + pwm.setServoPwm('0',90) + pwm.setServoPwm('1',90) + except KeyboardInterrupt: + print ("\nEnd of program") + break diff --git a/Code/setup.py b/Code/setup.py index 7978f39..5f8d52a 100644 --- a/Code/setup.py +++ b/Code/setup.py @@ -9,14 +9,10 @@ for x in range(1,4): flag=flag | 0x01 break for x in range(1,4): - if os.system("sudo pip3 install rpi_ws281x") == 0: + if os.system("sudo apt-get install -y python3-dev python3-pyqt5 ") == 0: flag=flag | 0x02 break -for x in range(1,4): - if os.system("sudo apt-get install -y python3-dev python3-pyqt5 ") == 0: - flag=flag | 0x04 - break -if flag==0x07: +if flag==0x03: print("\nNow the installation is successful.") else: print ("\nSome libraries have not been installed yet. Please run 'sudo python setup.py' again")