
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

SERVO = 17

GPIO.setup(SERVO, GPIO.OUT)

def moveDeg(i):
	val = 0.001 + (i * 0.002 / 180)
	for x in range(260):
		GPIO.output(SERVO, GPIO.HIGH)
		time.sleep(val)
		GPIO.output(SERVO, GPIO.LOW)
		time.sleep(val)

def closeBarrier():
	moveDeg(0)

def openBarrier():
	moveDeg(90)
	#################################################################
##           SERVO LIB for SMART TOLLBOOTH PROJECT             ##
#################################################################

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BOARDs)

SERVO = 11

GPIO.setup(SERVO, GPIO.OUT)

def moveDeg(i):
	val = 0.001 + (i * 0.002 / 180)
	for x in range(260):
		GPIO.output(SERVO, GPIO.HIGH)
		time.sleep(val)
		GPIO.output(SERVO, GPIO.LOW)
		time.sleep(val)

def closeBarrier():
	moveDeg(0)

def openBarrier():
	moveDeg(90)

Update pin to gpio.board (from gpio.bcm)
fix: Update pin to gpio.board (from gpio.bcm)

+ 	#################################################################
+ ##           SERVO LIB for SMART TOLLBOOTH PROJECT             ##
+ #################################################################
  
  import RPi.GPIO as GPIO
  import time
  
- GPIO.setmode(GPIO.BCM)
+ GPIO.setmode(GPIO.BOARDs)
  
- SERVO = 17
+ SERVO = 11
  
  GPIO.setup(SERVO, GPIO.OUT)
  
  def moveDeg(i):
  	val = 0.001 + (i * 0.002 / 180)
  	for x in range(260):
  		GPIO.output(SERVO, GPIO.HIGH)
  		time.sleep(val)
  		GPIO.output(SERVO, GPIO.LOW)
  		time.sleep(val)
  
  def closeBarrier():
  	moveDeg(0)
  
  def openBarrier():
  	moveDeg(90)
+ 
Update pin to gpio.board (from gpio.bcm)
## Code Before:

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

SERVO = 17

GPIO.setup(SERVO, GPIO.OUT)

def moveDeg(i):
	val = 0.001 + (i * 0.002 / 180)
	for x in range(260):
		GPIO.output(SERVO, GPIO.HIGH)
		time.sleep(val)
		GPIO.output(SERVO, GPIO.LOW)
		time.sleep(val)

def closeBarrier():
	moveDeg(0)

def openBarrier():
	moveDeg(90)
## Instruction:
Update pin to gpio.board (from gpio.bcm)
## Code After:
	#################################################################
##           SERVO LIB for SMART TOLLBOOTH PROJECT             ##
#################################################################

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BOARDs)

SERVO = 11

GPIO.setup(SERVO, GPIO.OUT)

def moveDeg(i):
	val = 0.001 + (i * 0.002 / 180)
	for x in range(260):
		GPIO.output(SERVO, GPIO.HIGH)
		time.sleep(val)
		GPIO.output(SERVO, GPIO.LOW)
		time.sleep(val)

def closeBarrier():
	moveDeg(0)

def openBarrier():
	moveDeg(90)
