Pycharm Counting

 My Robot ELFS knows how to count from 1 to 10 ...

This robot can count the number of blinks out loud as he watches the led turn on and off.



import pyttsx3
import serial
import time
vspeaker = pyttsx3.init()
# arduino = serial.Serial('COM#', 9600)
# while 1:
for i in range(11):
with serial.Serial('COM#', 9600, timeout=1) as arduino:
time.sleep(0.5)
arduino.write(b'1')
time.sleep(0.5)
arduino.write(b'0')
print(i)
vspeaker.say(i)
vspeaker.runAndWait()

arduino.close()
print("done")
vspeaker.say("done")
vspeaker.runAndWait()
exit()

import pyttsx3
spk = pyttsx3.init()
spk.say("Hi there ... I am a Gnorics")
spk.say("I can react to you like a human being.")
spk.runAndWait()


Disclaimer:  We shall not be liable for any loss or damage of whatever nature - direct, indirect, consequential, or otherwise - which may arise as a result of your use of any information on this website. However, if you are interested in using any of the projects for personal or educational purposes, please inform the author by email for guidance and technical support.


Public Domain Notice: Copyright (c) 1988. All rights reserved. This article is part of a book entitled Autognorics. Copies are welcome to be shared or distributed publicly as long proper citations are observed. Please cite as follows: Inscription by Design, Joey Lawsin, 1988, USA.

================================================================== 
Biognorics®  Gnos® Gnorics® ELFS® logos are registered trademarks.
Copyright Autognorics© Inc. iHackRobot®. All Rights Reserved.
Patent Pending. 2000 © ®
A  L.A.W.S.I.N. Educational Production
 ================================================================== 



Comments

Popular Posts