TeddyIP
Posts: 22
Joined: Fri Jul 20, 2018 9:47 am

Python 3.5.3

Fri Jul 20, 2018 10:43 am

Hello everyone,
I just got my hands on a Rsapberry IP 3. I am trying to use RPi.GPIO. I started trying to write a quick code to test RPi.GPIO with my oscilloscope. I haven't attached anything to the Raspberry apart from the oscilloscope at the moment, I can't see any change in pins 7,11,12,13,15,18,22,24,26 default values. I have noticed that on Run Module I receive a message " RESTART: home/pi/Osc.py".

So my question is what could cause this:
Has the program ran and stopped straight away?

Code: Select all

import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7,GPIO.OUT)

def Set_Output():
	Output_Channels = (7,11,12,13,15,16,18,22,24,26)
	GPIO.setup(Output_Channels,GPIO.OUT,initial=0)
	
	Input_Channels = (29,31,32,35,36,37,38,40)
	GPIO.setup(Input_Channels,GPIO.OUT,initial=1)
	
	FREQ=GPIO.PWM(7,5.0)
	func=GPIO.gpio_function(7)
	print (func)
	return

Return to “Beginners”