Re: Heart rate sensor MAX30102
LATC.1 for Data
LATC.2 for Clock
a recipe for failure in the making ?
use of LATx ports in "highlevel" commands is incorrect and will not work as expected
Is this the correct way to assign a constant value to the name?
a quick little exercise trying to compile this will reveal the differences between defines and constants
Code:
reg var byte'#define bite_me 5 ;try one or the other of these two or niether
'bite_me con 5 ; "
REG_INTR_STATUS_1 con $00
REG_INTR_STATUS_2 con $01
REG_INTR_STATUS_2 con $07
REG_INTR_STATUS_3 con bite_me
define REG_INTR_ENABLE_1 $02
define REG_INTR_ENABLE_2 bite_me
define REG_INTR_ENABLE_2 1
#define REG_INTR_ENABLE_3 $02
#define REG_INTR_ENABLE_4 bite_me
#define REG_INTR_ENABLE_4 1
loopy:
reg = bite_me
reg = REG_INTR_ENABLE_3
reg = REG_INTR_ENABLE_1
reg = REG_INTR_STATUS_1
goto loopy
Warning I'm not a teacher
Bookmarks