---
# System prepended metadata

title: Untitled

---

```pyhton
import colorsys
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)

green = 27
red = 17
blue = 22

GPIO.setup(red, GPIO.OUT)
GPIO.setup(green, GPIO.OUT)
GPIO.setup(blue, GPIO.OUT)

Freq = 100

RED = GPIO.PWM(red, Freq)
GREEN = GPIO.PWM(green, Freq)
BLUE = GPIO.PWM(blue, Freq)

try:
  RED.start(0)
  GREEN.start(0)
  BLUE.start(0)
  while True:
    for x in range(0,999):
      i=float(x)/1000
      test_color = colorsys.hsv_to_rgb(i,1,1)
      #print(i,test_color)

      RED.ChangeDutyCycle(test_color[0]*100)
      GREEN.ChangeDutyCycle(test_color[1]*100)
      BLUE.ChangeDutyCycle(test_color[2]*100)
      time.sleep(0.005)
except KeyboardInterrupt:
  print('User stopped')
finally:
  GPIO.cleanup()

```