No announcement yet.

Floating point variables

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Click image for larger version

Name:	ulcd-70dt.jpg
Views:	60
Size:	487.1 KB
ID:	51530

    Mark, here is a screen shot with temp around 73 degrees F on the UCLD-70DT screen.


    • #17
      Sorry, I still don't really have enough to do everything.

      Anyway, I've done what I think is necessary for the formula on 15th March 2016, 02:49 PM, although I can't really test it

      #platform "uLCD-35DT"
      #inherit "4DGL_16bitColours.fnc"
      func main()
          var var1[2], p_acc[2], f2[2], f13[2], f25[2], fp13[2], fp25[2], calib_p9[2] ;
          flt_ITOF(f2,2) ;                // turn constants into floats
          flt_ITOF(f13,13) ;
          flt_ITOF(f25,25) ;
          flt_POW(fp13, f2, f13);         // calc >> 13 'divisor'
          flt_POW(fp25, f2, f25);         // calc >> 25 'divisor'
          flt_ITOF(calib_p9,0x10bd) ;       // turn Calibration constant to float (can use ITOF as viewed code uses 16bit in for this value) 0x10bd taken from forum screenshot
          // to do, need to load p_Acc, not sure where it comes from
          flt_DIV(var1, p_acc, fp13) ;        // var1 = (p_acc>>13)
          flt_MUL(var1, p_acc, p_acc) ;       // var1 = (p_acc>>13) * (p_acc>>13)
          flt_MUL(var1, var1, calib_p9) ;     // var1 = calib_p9 * (p_acc>>13) * (p_acc>>13)
          flt_DIV(var1, var1, fp25) ;         // var1 = (calib_p9 * (p_acc>>13) * (p_acc>>13)) >> 25 ;
          flt_PRINT(var1, "%g\n");
          repeat                      // maybe replace
          forever                     // this as well


      • #18
        Hi Mark.
        After two weeks of learning the ulcd-70dt, my boss is getting impatient and wants me to possibly switch to a Sainsmart touch screen with a Arduino C compiler.
        I want to thank you for all the help you have been to me, and I've not given up yet on the 70dt because I like it. Graphics easy, SPI easy, etc. Just the lack of direct 64-bit 'C' type data types is problematic to me. Double, long, long int, and so on..

        Thanks so much!