File: pwm-zero.py

package info (click to toggle)
expeyes 5.3.4%2Brepack-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,612 kB
  • sloc: python: 36,039; ansic: 9,754; xml: 1,010; makefile: 784; sh: 581; asm: 202; javascript: 46; php: 1
file content (17 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#PB3 is OC0, connected to the RED of RGB LED

import time
from kuttyPy import *

setReg(DDRB,255)
csb = 1 		# Clock select bits uint8_t
WGM01=3
WGM00=6
COM01=5
setReg( TCCR0 , (1 << WGM01) | (1 << WGM00) | (1 << COM01) | csb )

while 1:
	setReg(OCR0 , 50)
	time.sleep(0.5)
	setReg(OCR0 , 200)
	time.sleep(0.5)