Traceback (most recent call last):
File "py02.py", line 8, in <module>
import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'
:-\[code][ 36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[ 36.176536] pcm512x 1-004d: Failed to get supplies: -517
[ 36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]
[ 36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[ 36.176536] pcm512x 1-004d: Failed to get supplies: -517
[ 36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517
tc@box:~$ python3 py02.py
Traceback (most recent call last):
File "py02.py", line 8, in <module>
import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'
Ooops sorry ! ...Not a problem.
... Is this correct? ...Yes it is. Don't worry about the newbielink label that's there. It will automatically go away after you make a few more posts.
... Forgive my learning curveNone of us were born with the knowledge we have. We acquired it over time.
$ tce-load -i python3.8-rpi-gpio
$ python3.8
>>> import sys
>>> import RPi.GPIO as GPIO
>>>
#!/usr/bin/env python3.8
#WOW this works
import time
import serial
#configure the serial connections (the parameters differs on the device you are connecting to)
ser = serial.Serial(
port='/dev/ttyUSB0',
#port='Com8',
baudrate=9600,
parity=serial.PARITY_ODD,
stopbits=serial.STOPBITS_TWO,
bytesize=serial.SEVENBITS
)
s="--"
ser.isOpen()
print ('Enter your commands below.\r\nInsert "exit" to leave the application.')
while 1 :
# get keyboard input
s = input(">pp> ")
if s == 'exit':
ser.close()
exit()
else:
# send the character to the device
ser.write(s.encode())
out=""
# wait one second before reading output (let's give device time to answer)
time.sleep(1)
while ser.inWaiting() > 0:
out += ser.read(1).decode()
if out != '':
print (out)
import RPi.GPIO as GPIO
import time
#blink_interval commented out just to see how fast it will all go
# Configure the PIN # 8
GPIO.setmode(GPIO.BOARD)
GPIO.setup(8, GPIO.OUT)
GPIO.setwarnings(False)
# Blink Parameters
#blink_interval = .05 #Time interval in Seconds
blink_Count = 400
# Blinker Loop
for i in range(0,blink_Count):
GPIO.output(8, True)
#time.sleep(blink_interval)
GPIO.output(8, False)
#time.sleep(blink_interval)
# Release Resources
GPIO.cleanup()
print("Done")