Python Text to Speach

We use python module gTTS to convert any text to speech. This module uses Google text to speech engine to convert text to an mp3 file. Then we play the saved mp3 using the omxplayer. Installing gTTS This step is required only once. Go to the linux terminal window and...

Lesson 11

Instant Challenges IC1. Get 2 integers and multiply Get two integers from user and print the product of the two numbers. Enter the first number: 3 Enter the second number 2: 5 Result: 15 IC2. Get 2 decimal values and multiply IC1 will fail, if you enter a decimal...

Raspberry Pi Python Challenges

Some of these challenges will only involve writing python program, while others require building circuits as well. Difficulty level: Easy. Write a program that gets a string as input and prints the length of the string. Refer to https://w3cloud.com/academy/lesson-2/...

Lesson 5

In the previous lesson, you leaned about building a LED circuit and controlling it from your python code. We even made the LED blink. Python Functions You can build your own functions and call it from multiple places. Breaking down into functions, improve the...

lesson 4

Connecting LED   Turn on a LED import RPi.GPIO as GPIO import time ledPin=40 GPIO.setmode(GPIO.BOARD) GPIO.setup(ledPin, GPIO.OUT) GPIO.output(ledPin, GPIO.HIGH) time.sleep(5) GPIO.output(ledPin, GPIO.LOW) GPIO.cleanup() Blink an LED 20 times import RPi.GPIO as...