return
;--------------------------------------------------------------------
;[WriteOutputs] Updates the state of the leds
WriteOutputs: 'Output LOW to each LED that should be on
IF ledA = 1 THEN
low p4
ENDIF
IF ledB = 1 THEN
low p5
ENDIF
IF ledC = 1 THEN
low p6
ENDIF
IF Eyes = 0 THEN
low cEyesPin
ELSE
high cEyesPin
ENDIF
return[/code]
when programming the Atom pro the A ~LED is on the others are off,
Once programmed the A and C LEDs flick fast while the B LED is on bright.
when i push A or C buttons they go bright and B stays Bright.
the command i give for pushing button A doesnt work. iv added a sound command.
Is it possible to perform an input read function using pre-defined pin numbers? I prefer to define pin functions in the beginning of my code so that I don’t need to keep track of which inputs/outputs go to which pin. An example of this is the code below for a servo control function. In this code I predefine the two servo pins so I can just refer to them as YServo and XServo in the HSERVO function and elsewhere throughout the program.
[code]YServo CON 2 ’ Y-axis servo
Xservo CON 3 ’ X-axis servo
pulseX VAR SWord
pulseY VAR SWord
pulseX = 0
pulseY = 0
enablehservo ’ Activate HSERVO function
HSERVO [XServo\pulseX, YServo\pulseY] ’ Send control pulses to servos[/code]
It doesn’t look like the ATOM will accept the following code however for reading from input pins:
[code]ButtonReset CON 13
Button_Reset VAR Byte
Button_Reset = ButtonReset
if (Button_Reset = 0) then
goto start
endif[/code]
Instead I’m forced to use the following code:
[code]Button_Reset VAR Byte
Button_Reset = in13
if (Button_Reset = 0) then
goto start
endif[/code]
Is there anyway to avoid the need to refer to specific pin locations when reading inputs?