Hi Guys,
my program shows a flaw but i dont know where.
depending on the press of a button at GPIO.1 a led should flash defferent at GPIO.0.
************************************************** **************
'* Name : Blink4.pbp *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 26.09.2007 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
@ DEVICE pic12F629, INTRC_OSC_NOCLKOUT ; System Clock Options
@ DEVICE pic12F629, WDT_ON ; Watchdog Timer
@ DEVICE pic12F629, PWRT_ON ; Power-On Timer
@ DEVICE pic12F629, MCLR_OFF ; Master Clear Options (Internal)
@ DEVICE pic12F629, BOD_OFF ; Brown-Out Detect
@ DEVICE pic12F629, CPD_OFF ; Data Memory Code Protect
@ DEVICE pic12F629, PROTECT_OFF
DEFINE OSCCAL_1K 1' Set OSCCAL for 1k
cmcon = 7 ' Comparator OFF
TRISIO = %11111110 ' Set GPIO 0 as output 1-4 as input
if gpio.1 = 1 then
pulsout GPIO.0,10000
else
pulsout GPIO.0,2000
endif
I missed something, but dunno what. The led reacts at the first command line, whether theres a gpio.1 = 1 or gpio.1 = 0
but never at the button itself. it doesnīt find the input.
HELP!
Bookmarks