Menu

decimal point sums

2017-03-19
2019-07-18
<< < 1 .. 3 4 5 (Page 5 of 5)
  • David Thompson

    David Thompson - 2017-10-31

    Humidity is doing my head in :-) Although Humidity is only 16 bit, the equation is enormous and won't fit into GCB whole. Splitting it down is where the errors are occurring. I've just noticed something weird, var_H = (t_fine - 76800) Then humidity = var_H/768 gives about the right humidity.
    If I haw on the sensor, the humidity(?) goes up and then down when. left alone a few mins it matches a commercial made humidity sensor. Weird because ADC_h isn't even in the picture. Must be a temperature related oddity.
    I'm aware of the signed comp data but I don't think any of them are neg (-) but I'll double check. I've also done the shifting for h4 & H5. I just noticed H4 is HB, LB & H5 is LB,HB I need to check that I did that.
    Humidity is 0 to 100 so there shouldn't be any negatives, he says with hope :-)
    Definitely back to the spreadsheet now.

    One of the calibrations was Neg(-), I'd done the H4 & H5 stuff but had 2 x H4.
    I'm now using coloured backgrounds to identify equation groups and parenthasis, then transfering them from a document to the SS using the same colours. Working so far.
    Update 3/11/17
    I think I've cracked the parenthesis using coloured backgrounds to match the pairs. Next I'll transfer them over to the spreadsheet using the same method to group component parts. Then with fingers Xed I'll see if it works. If it doesn't at least I have a method that allows fault finding instead of starting from scratch each time.

     

    Last edit: David Thompson 2017-11-03
  • Camerart

    Camerart - 2018-01-19

    Hi,
    I've just discovered your discussion!
    I struggle with programming, as I'm sure some of you do too, and am unable to convert to the more modern languages, so I'm 'stuck' with BASIC and use Oshonsoft, which has an excellent Simulator. I am also working on a similar project to this one, a BMP280 which has Pressure and Temperature. Here is a link to my project: https://www.electro-tech-online.com/threads/pic-plus-5110-48x84-lcd-gps.150378/page-19#post-1314644 PM me if you think we are able to swap notes.
    Cheers, Camerart

     
  • stan cartwright

    stan cartwright - 2018-01-19

    I guess by "modern languages" you mean c, @Camerart which isn't new just maybe unfamiliar..gcb was unfamiliar to me as nearly every version of basic is different and new things to learn.
    I find data sheets have only c examples and converting c to gcb is a pain, me not familiar with c and no floats ie decimal point numbers.
    ok, you can scale ie multiply everything,do sums,then divide back but like that is complicated for me.
    A guy on picaxe forum has made a "ALU" in picaxe basic to use with the bmp280 which sounds loads of fun and outputs results at picaxe speed (which users say is not a problem).
    It's a pain that you can't find device info in other than c or maybe python if it's popular with raspberry pi users. Did you find this forum in a bmp280 search?

     
    • Chris Roper

      Chris Roper - 2018-01-19

      I guess by "modern languages" you mean c.

      How do you define Modern?

      In 1964, John G. Kemeny and Thomas E. Kurtz designed the original BASIC
      language at Dartmouth College in New Hampshire, United States.
      In 1972 Dennis Ritchie at Bell Labs writes C and in 1978 the publication of
      The C Programming Language by Kernighan & Ritchie caused a revolution in
      the computing world.

      So we have an 8 year difference from 53 years ago.

      Java is a C derivative and is a modern interpretive language, but most
      BASIC compilers are actually written in C which predates modern BASIC (MS /
      IBM / BBC BASIC).

      Sorry for derailing the thread, just struck a nerve :)

      Cheers
      Chris

       
  • stan cartwright

    stan cartwright - 2018-01-19

    Ha,ho. And they thought of the name basic after it was written, not let's design a language called basic first and then make a version....dunno-folklore.
    My point was "modern..as in use today" but should have said main stream microcontroller programming, which is ? %wise?
    My main point being searching for basic examples for devices is not going to give much whereas you could load an arduino sketch and run it with no knowledge for a bmpblah and it would work without you not knowing anything except how to click stuff.
    "I struggle with programming, as I'm sure some of you do too, "
    yes sometimes...it's human error mostly......but learning a new language,system?...
    do you mean you are new to gcb, @Camerart or you trying to convert some oshonsoft files to gcb and if so what's wrong with oshonsoft implementation?
    Can you sort my VL53L0X which is all c stuff?
    ps bbc basic et al was written in asm native to machine ie bbc-6502,sinclair-z80, amstrad 512 used ms basic and drbasic which was written in what?

     

    Last edit: stan cartwright 2018-01-19
  • getsi

    getsi - 2019-07-18

    hello guys i do have this formula speed = 0.54*revs . where revs is an integer .how can i display the speed on LCD . its only displaying 0 . is there any alternative way of doing it in GreatCowBasic IDE. i tried revs/100 * 54 but its not accurate e.g 2.7 = 2 2.9 = 2 2.0 = 2 etc

     
    • Chris Roper

      Chris Roper - 2019-07-18

      You say that revs is an integer, can you give an indication of the integer value i.e
      if the result should be 2.9 what would the value of revs be?
      Reversing your equation and solving for 2.9:
      "Revs/100 * 54 = 2.9"
      would yield a value for Revs of 5.3704 which is definitely not an integer value.

       
<< < 1 .. 3 4 5 (Page 5 of 5)

Log in to post a comment.