File: digitalRead.py

package info (click to toggle)
expeyes 5.3.4%2Brepack-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, 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 (14 lines) | stat: -rw-r--r-- 224 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#Connect switches from PC0..PC7 to Ground via 5k resistors

import time
from kuttyPy import *

setReg(DDRB,255)
setReg(DDRC,0)
setReg(PORTC,255)

while 1:
	val = getReg(PINC)
	print (val)
	setReg(PORTB, val)
	time.sleep(.1)