import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)

dc = 5

servo = GPIO.PWM(11,50)
servo.start(10)
print('***Connect Battery & Press ENTER to start')
res = raw_input()
servo.ChangeDutyCycle(dc) #servo.ChangeDutyCycle(5)
print('***Press ENTER to start')
res = raw_input()

print ('increase > a | decrease > z | save Wh > n | set Wh > h|quit > 9')

cycling = True
try:
    while cycling:
        servo.ChangeDutyCycle(dc)
        res = raw_input()
        if res == 'a':
            dc = dc + 0.05
        if res == 'z':
            dc = dc - 0.05
        if res == 'h':
            mymotor.setWh()
        if res == '9':
            cycling = False
finally:
    # shut down cleanly
    servo.stop()
    print ("dc var setting is: ")
    print (dc)


print('***Press ENTER to quit')
res = raw_input()
servo.stop()
GPIO.cleanup()

@@ -1,8 +1,26 @@
+#!/usr/bin/python%0A
 import R
@@ -114,17 +114,19 @@
 .PWM(11,
-5
+100
 0)%0Aservo
@@ -132,18 +132,18 @@
 o.start(
-10
+dc
 )%0Aprint(
@@ -143,19 +143,16 @@
 %0Aprint('
-***
 Connect 
@@ -231,42 +231,16 @@
 (dc)
- #servo.ChangeDutyCycle(5)
 %0Aprint('
 ***P
@@ -227,35 +227,32 @@
 ycle(dc)%0Aprint('
-***
 Press ENTER to s
@@ -285,17 +285,17 @@
 print ('
-i
+I
 ncrease 
@@ -300,17 +300,17 @@
 e %3E a %7C 
-d
+D
 ecrease 
@@ -315,17 +315,17 @@
 e %3E z %7C 
-s
+S
 ave Wh %3E
@@ -329,17 +329,17 @@
 h %3E n %7C 
-s
+S
 et Wh %3E 
@@ -343,10 +343,12 @@
  %3E h
-%7Cq
+ %7C Q
 uit 
@@ -674,17 +674,17 @@
   # 
-s
+S
 hut down
  cle
@@ -683,16 +683,8 @@
 down
- cleanly
 %0A   
@@ -751,19 +751,15 @@
 c)%0A%0A
-%0A
 print('
-***
 Pres
@@ -821,9 +821,8 @@
 leanup()
-%0A

edit src files