Announcement

Collapse
No announcement yet.

From PIC to VISI Genie and 32DT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by pauleilio View Post
    Hi,

    Thank you for clarifying that I was missing a file in the Visi-Genie file but have since located it. I have all I need to carry on now.

    Best regards

    Paul
    Did you have little time for me to check the PBP and what is the best way send variables from an external microcontroller to Visi Genie?

    Comment


    • #32
      Originally posted by pauleilio View Post
      Hi,

      It is supported in the genieArduino library as it will take variable and convert it into a string but as you can't use the library you will have to convert the variable into a string so that you can find the ASCII value of each character that you are sending to calculate the checksum.

      I will do more research into how this can be done in MkiroBasic

      Best regards

      Paul
      Paul in case i find a way to convert the variable to a string, which is guess it is easy, and then to calculate the checksum.....what is the command i need to follow in visi genie with an external PIC microcontroller in order to send the values on a specific area and on a specific page on the display?

      Comment


      • #33
        I know you all have lots of work. I only need to know which is the right command, in order to send a variable from HOST to DISPLAY, to a specific FORM at specific XY and with the right color and size. If there is no way to do that, then i might need to check for alternatives.

        Comment


        • #34
          I'll figure it out. No problem. thanks a lot for your kind help. It might be much easier than i thought.

          Once i have the right result i will post the code here for everyone is interested in PBP3 and how we sent variables to leddigits.

          Comment


          • #35
            I have succeed to send manual some values to the digits but there is no luck when i try to send variables like below.

            I could upload the files from visi genie with the updated forms and leddigits.

            The following is in PBP3 though.

            Code:
            ' -----------------------------------------------------------------------------|
            ' [ LCD Initialization ] |
            '------------------------------------------------------------------------------|
            ' FIRST TIME BOOTUP: We give plenty of time for tbe LCD '
            lcdinit:
            pause 2000
            command = $04
            contrast = $0A
            gosub checksum
            hserout [command,contrast,CS] ' Contrast settings
            hserin [wait(6)]
            pause 100
            
            return
            
            '------------------------------------------------------------------------------*
            ' Measure IR object temp *
            '------------------------------------------------------------------------------*
            object:
            reg = $07 ' based on the datasheet $07 is the object's temp
            addr = %10110100 ' $B4 binary value: %10110100
            i2cwrite SDA, scl, addr ' send write command, shift the address B4, 8 bits where LSB is W = 0
            i2cwrite sda, scl, reg ' register is $07
            
            addr = %10110101 ' $B5 Binary value: %10110101
            i2cwrite sda, scl, addr ' sends read command, shift the address B5, 8 bits where LSB is R = 1, clock idles low
            i2cread SDA, SCL,0,reg,[temp.lowbyte,temp.highbyte] ' reg = $07
            
            'IF sign_Bit = signCold THEN Change_Sign ' If Sign_Bit = 1, it's below "0" deg C
            Sign = "+"
            'shifts 8 bits to the left
            tempir = temp.highbyte << 8
            tempir = tempir + temp.lowbyte ' add the temp.lowbyte
            
            temperature = tempir/50 ' based on the manual we need to divide by 50 or 0.02
            temperature = temperature - 273 ' subtract 273 for Degree in C,actually is 273,15
            remainder = (tempir*2)//100 ' multiply x 2 and get the remainder //100
            
            pause 100
            gosub display
            return
            
            '------------------------------------------------------------------------------*
            ' Display the parameters *
            '------------------------------------------------------------------------------*
            display: ' IR TEMP
            gosub checksum2
            hserout [$01,$0F,$02,temperature,remainder,IRCS]
            Hserin timeout,error,[wait(6)]
            return
            
            '------------------------------------------------------------------------------|
            ' CHECKSUM |
            '------------------------------------------------------------------------------|
            checksum:
            cs = 0
            cs = cs ^command
            cs = cs ^ contrast
            return
            
            '------------------------------------------------------------------------------|
            ' CHECKSUM |
            '------------------------------------------------------------------------------|
            checksum2:
            IRCS = 0
            IRCS = IRCS ^ $01 ^ $0F ^ $02 ^ temperature ^ remainder
            'ircs = IRCS ^ remainder
            
            return
            
            '------------------------------------------------------------------------------|
            ' return to error |
            '------------------------------------------------------------------------------|
            error:
            high red
            PAUSE 10
            return
            
            end
            Last edited by astasuleo; 22 November 2021, 08:18 PM.

            Comment

            Working...
            X