Help with Maxim Ibutton "IF THEN ELSE" statements please


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    Laughs...

    Yes BOS Plant ..... Told if Really lucky might get to see your 4 Queens of steel making too....

    Before dining in style at Deans on Brigg road !

    Thanks for help again all

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    You saw the four queens!

    I bet that made your day.

    I assume Deans is a burger van.

    You are welcome.

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    Steve, I beg to differ about your statement:"Your if correct then labels construction can not be in one line format." Oh really, and what makes you say that? If the statement is TRUE the operation is passed to the address of Correct#. Although it is not the way I would write the compound statement it is 100% acceptable.
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    Quote Originally Posted by Dave View Post
    Steve, I beg to differ about your statement:"Your if correct then labels construction can not be in one line format." Oh really, and what makes you say that? If the statement is TRUE the operation is passed to the address of Correct#. Although it is not the way I would write the compound statement it is 100% acceptable.
    Dave you are correct as Henrik's post has already demonstrated. We both agree that we would not write the compound statement this way. My biggest objection is the use of the 'goto' statement which although perfectly valid is an instruction I was taught not to use a long time ago. I read the "Correct#" as a gosub instruction not a goto statement which was my mistake.

  5. #5
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    It is typically necessary to use parenthesis between logical comparisons as:

    If (Serial[1]=$15) and (Serial[2]=$D3) and (Serial[3]=$7D) AND (Serial[4]=$16) AND (Serial[5]=$00) AND (Serial[6]=$00) then correct1

    I believe that it forces a Boolean comparison rather than a mathematical evaluation.

    One last - is it necessary to compare ALL bytes, or might you only compare say... the first one. This would seem to yield a unique condition and save the effort and complexity of so long a line:

    If (Serial[1]=$15) then Correct1

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,158


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    Quote Originally Posted by Amoque View Post
    ...

    One last - is it necessary to compare ALL bytes, or might you only compare say... the first one. This would seem to yield a unique condition and save the effort and complexity of so long a line:

    If (Serial[1]=$15) then Correct1

    Speaking out my bellybutton, I'd say yes. The other serial numbers still have to be validated (knowing absolutely nothing about his application).

    Robert

  7. #7
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    There is some good code here

    http://www.picbasic.co.uk/forum/cont...r-nine-of-them

    I particularly noted there is no pause between the owout and owin.

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    Hi,
    Tried the above and variants of it....It is now just going staight to the gosub routine (wrong) I suspect because with no Ibutton in place the "Serial Number" is after all wrong!!
    Well, if what you're saying is that you don't actually have an IButton connected then I think you've found the problem. Of course the numbers will be wrong, none of the IF statements will evaluate TRUE so the exection will fall thru to the GOSUB wrong statement.
    Help........!!!!
    This may sound like a totally crazy idea but you might try connecting an IButton and see if that possibly helps.

    :-)

    /Henrik.

  9. #9
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Help with Maxim Ibutton "IF THEN ELSE" statements please

    Quote Originally Posted by Demon View Post
    Speaking out my bellybutton, I'd say yes. The other serial numbers still have to be validated (knowing absolutely nothing about his application).

    Robert
    Yes they do ALL need verifying...

    BR
    Andy

Similar Threads

  1. Replies: 0
    Last Post: - 14th November 2013, 03:32
  2. Replies: 3
    Last Post: - 15th October 2012, 08:06
  3. Replies: 8
    Last Post: - 3rd March 2011, 22:20
  4. Replies: 5
    Last Post: - 28th February 2011, 15:33
  5. Replies: 1
    Last Post: - 16th February 2005, 20:05

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts