
Originally Posted by
kevlar129bp
Hello all,
I've got my serial comms working great, thanks to all of you! As I'm running my code through the sim, I'm trying to validate the incoming decimal address, with no success. It goes something like this:
Code:
hserin [wait("A"),DEC3 boardadd]
hserout ["Board received A",DEC3 boardadd,13,10]
IF (boardadd = 000) OR (boardadd > 254) THEN 'THIS IS NOT WORKING!!!!!
hserout ["Error: Address ",DEC3 boardadd," not valid! Please use 001 to 254.",13,10]
else
write 0,boardadd
high Progled
pauseus 50
low progled
read 0,boardaddep
hserout ["Board address set to ",DEC boardaddep,13,10]
endif
The "=000" works, but the ">254" doesn't. The code allows me to enter >254. Am I missing something here, or am I trying to compare 2 different formats? I've tried the following with no success:
IF (DEC3 boardadd = 000) or (DEC3 boardadd > 254) THEN...
Hope one of you can help. Thanks a million!
C
I have a thought . . . Right, wrong or otherwise . . .
your code . .
Code:
IF (boardadd = 000) OR (boardadd > 254) THEN
have you tried . . . ?
Code:
IF (boardadd <1) OR (boardadd > 254) THEN
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks