closed

Loginbox

Please enter your username and password into the following fields to log in.


  • Username:
  • Password:
  •  
  • Auto log in on every visit.


  •  

Bascom ---> Pascal



miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 56
Posts: 914
Registered: 09 / 2007
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 12.08.2022 - 00:37   -  
Hi Matthias,
laut Merlin soll auch die letzte 5.11.15 funktionieren, bei mir nicht.
Probiere mal.....

miparo
Kein Support per PN! | No support via PM!
go down go up
Merlin offline
Administrator
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 1261
Registered: 03 / 2005
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 12.08.2022 - 14:02   -  
Hi Miparo.

The test code you sent me (Labelled Mega4809) compiles and assembles. Beyond that I cannot test. If you have different code that does not work you need to let me have it.

Hi Matthias

I have 5.11.11 archived, so if 5.11.15 does not work I will send it to you. But if I do, please preserve your asm/dsm files for both versions so I can see what has gone wrong (if anything).

Regards

Merlin

====================================================

Hallo Miparo.

Der Testcode, den du mir geschickt hast (mit der Bezeichnung Mega4809) kompiliert und assembliert. Darüber hinaus kann ich nicht testen. Wenn Du einen anderen Code hast, der nicht funktioniert, musst Du ihn mir zur Verfügung stellen.

Hallo Matthias

ich habe 5.11.11 archiviert, wenn also 5.11.15 nicht funktioniert, werde ich es dir schicken. Aber wenn ich das tue, bewahren Sie bitte Ihre asm/dsm-Dateien für beide Versionen auf, damit ich sehen kann, was falsch gelaufen ist (wenn überhaupt).

Mit freundlichen Grüßen

Merlin

Übersetzt mit www.DeepL.com/Translator (kostenlose Version)
Merlin.

:magic:

Software is a black art.
go down go up
tbegle offline
Benutzer
Avatar
Gender: n/a
Location: n/a 
Age: 62
Posts: 135
Registered: 01 / 2018
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 17.08.2022 - 08:50   -  
Hi Dave , Hi Miparo,
and all the others involved in the compiler development of the MC of Microchip 4808/09 (UPDI), a big thank you.

The new MC are a hit! 1 PIN Prog. 1/2 current(Atmel) 48kB flash ........ !
I have tested the 3 USART on the 4808/09 (PIN TX=H!)
Wizzart - baudrates crooked values? - default buffer 0? maybe drill up to 230kBd? 4. USART ?
I2C(TWI) works fine I2C(TWI)presc?=TWI_BR 100/400?
AD-W still no function
Regards
Toni

Hallo Dave, Hallo MIparo,
und alle die Anderen die sich an der Compiler Entwicklung der MC von Microchip 4808/09 (UPDI) engagieren, einen herzlichen Dank.

Die neuen MC sind der Hit! 1 PIN Prog. 1/2 Strom(Atmel) 48kB flash ........ !
Ich habe die 3 USART am 4808/09 getestet (PIN TX=H!)
Wizzart - Baudraten krumme Werte? - default Buffer 0? vielleicht auf 230kBd aufbohren? 4. USART ?
I2C(TWI) funktioniert einwandfrei I2C(TWI)presc?=TWI_BR 100/400?
AD-W noch keine Funktion
Grüsse
Toni
go down go up
Mathias offline
Benutzer
Avatar
Gender: n/a
Location: GERMANY  Weingarten - Baden
Age:
Posts: 304
Registered: 07 / 2003
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 17.08.2022 - 13:35   -  
Hallo,
habe die neueste Version installiert: 15.11.15
und das Programm von Miparo an einem Mega644 am Laufen.
Wie Miparo schon geschrieben hat, an der Druckmessung hängt es noch.
Hast du einen Tippe in welcher Ecke bei "procedure BME280readPressure" zu suchen ist?

Erstaunlich wie schnell du das Programm zum Funktionieren gebracht hast.

Gruß
Mathias
You must be logged in or your permissions are to low to see this Attachment(s).
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 56
Posts: 914
Registered: 09 / 2007
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 17.08.2022 - 14:04   -  
Hi Matthias,
ich habe es nur aus C übersetzt, mehr nicht.
Das Datenblatt habe ich nie gesehen. Chip gekauft , übersetzt und probiert :)
Das wird merlin beruhigen, das es mit der 15.11.15 läuft.Warum es bei mir nicht compilieren wollte ?
Jetzt geht es bei mir auch wieder. dubios.

miparo
Kein Support per PN! | No support via PM!
This post has been edited 2-times. Last edit: 17.08.2022 - 14:09 by miparo.
go down go up
Merlin offline
Administrator
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 1261
Registered: 03 / 2005
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 17.08.2022 - 14:13   -  
I don't know if it helps but I saw this in Miparo's program

Code
function BME280read24(reg: byte): longword;

var
  Bytes3   : TRec;
begin
  Bytes3.Int_:= 0;
  I2Cout(BME280_ADDR, reg);
  I2Cinp(BME280_ADDR, Bytes3.Arr3);  // only read 3 bytes
  return(Swaplong(Bytes3.Int_) shr 8);

end;


I think that this should be

Code
function BME280read24(reg: byte): longword;

var
  Bytes3   : TRec;
begin
  Bytes3.Int_:= 0;
  I2Cout(BME280_ADDR, reg);
  I2Cinp(BME280_ADDR, Bytes3.Arr3);  // only read 3 bytes
  return(Swaplong(Bytes3.Int_  shr 8)); // << Bracket was in wrong place

end;


I cannot test but I believe I am right.

Regards

Merlin
Merlin.

:magic:

Software is a black art.
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 56
Posts: 914
Registered: 09 / 2007
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 17.08.2022 - 15:14   -  
Hi Merlin,
possible, I will test that tomorrow. :)

miparo
Kein Support per PN! | No support via PM!
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 56
Posts: 914
Registered: 09 / 2007
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 18.08.2022 - 16:51   -  
Hi Merlin,
I think mine is correct ?

Code

// Reads a signed 24 bit value over the I2C bus_REG
function BME280read24(reg: byte): longword;
var
  res : longword;
begin
  res:= 0;
  I2Cout(BME280_ADDR, reg);
  I2Cinp(BME280_ADDR, res, 3);  // only read 3 bytes 24-bit
  Writeln(Serout,'Int24 : '+  LongToHex(Swaplong(res) shr 8));  >>> result : 00831E00
  Writeln(Serout,'Int24L: '+  LongToHex(Swaplong(res shr 8))); >>> result: 1E000000
  return(Swaplong(res) shr 8);
end;



miparo
You must be logged in or your permissions are to low to see this Attachment(s).
Kein Support per PN! | No support via PM!
go down go up
Merlin offline
Administrator
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 1261
Registered: 03 / 2005
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 18.08.2022 - 19:05   -  
Hi Miparo.

I don't know the product or the format of the data. It is just that mathematically it made no sense to me. To be honest it still doesn't

You start with
00 00 00 00

Then read 3 bytes

aa bb cc 00

Then reverse the digits

00 cc bb aa

then shr 8

00 00 cc bb

That might be what you are trying to achieve but I am struggling to believe it. Or am I missing something?
Merlin.

:magic:

Software is a black art.
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 56
Posts: 914
Registered: 09 / 2007
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 18.08.2022 - 19:20   -  
The safe way :)

Code

// Reads a signed 24 bit value over the I2C bus_REG
function BME280read24(reg: byte): longword;
var
  Buff: array[0..2] of byte;
begin
  I2Cout(BME280_ADDR, reg);
  I2Cinp(BME280_ADDR, Buff); // only read 3 bytes 24-bit
  return (longword(Buff[0]) shl 16) or (longword(Buff[1]) shl 8) or longword(Buff[2]));
end;
Kein Support per PN! | No support via PM!
This post has been edited 1-times. Last edit: 19.08.2022 - 12:11 by miparo.
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 56
Posts: 914
Registered: 09 / 2007
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 19.08.2022 - 00:03   -  
Hi Matthias,
schwierige Geburt, das Teil :(

BME 280 Test....
Sensor found at Addr: 0x76
Temp: 26.47 C
Humity: 54.42 %
Pressure: 1014.51 hPa

Test Prog anbei :)

miparo
You must be logged in or your permissions are to low to see this Attachment(s).
Kein Support per PN! | No support via PM!
go down go up
Mathias offline
Benutzer
Avatar
Gender: n/a
Location: GERMANY  Weingarten - Baden
Age:
Posts: 304
Registered: 07 / 2003
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 21.08.2022 - 21:24   -  
Läuft prima!
Danke
Habe es mir angepasst.

Gruß
Mathias

Code

program BME280_Test_3;
{
 *************** Firmware für Klimsensor BME280 von Bosch *********************************
   Compiler - Version: 5.11.15
   
   Version 1.0
   Datum 20.08.2022
   
   Sensormodul: PIM472 von Pimoroni
                gibt auch andere.
}
//----------------------------------------------------------------------------------------------------------------------
{$NOSHADOW}
{ $WG}                     {global Warnings off}
Device = mega644p, VCC = 5;

define_fuses
  Override_Fuses;
  COMport    = USB;
  SPIclk     = 2000000; // optional SPI programming speed
  LockBits0  = [];
  FuseBits0  = [SUT1, CKSEL0];
  FuseBits1  = [EESave, SPIEN];        // seriell programming
  FuseBits2  = [BODLEVEL0, BODLEVEL1];
  ProgMode   = SPI;
  ProgFuses  = true;
  ProgLock   = false;
  ProgFlash  = true;
  ProgEEprom = true;
//  ProgEEprom = false;

import SysTick, SerPort1, I2Cport;    //

from System import float, Int64;

define
  ProcClock      = 14745600;         // Hertz
  SysTick        = 1;             {msec}
  StackSize      = 100, iData;
  FrameSize      = 100, iData;
  SerPort1       = 19200, Stop1, parEven;     // Baud, StopBits|Parity    USB
  RxBuffer1      = 130, iData;
  TxBuffer1      = 255, iData;
  I2Cport        = PortC;
  I2Cdat         = 1;
  I2Cclk         = 0;

implementation

//--------------------------------------------------------------;

{$IDATA}

{--------------------------------------------------------------}
{ Type Declarations }

type
// structure to hold the calibration data that is programmed into the sensor in the factory
// during manufacture

  TBME280_Calibration_Data = record
                               dig_T1: word;
                               dig_T2: integer;
                               dig_T3: integer;

                               dig_P1: word;
                               dig_P2: integer;
                               dig_P3: integer;
                               dig_P4: integer;
                               dig_P5: integer;
                               dig_P6: integer;
                               dig_P7: integer;
                               dig_P8: integer;
                               dig_P9: integer;

                               dig_H1: byte;
                               dig_H2: integer;
                               dig_H3: word;
                               dig_H4: integer;
                               dig_H5: integer;
                               dig_H6: int8;
                             end;
{--------------------------------------------------------------}
{ Const Declarations }
const

  BME280_I2C_Adress           : byte  = $76;

  BME280_REGISTER_CHIPID      : byte  = $D0;
  BME280_REGISTER_VERSION     : byte  = $D1;
  BME280_REGISTER_SOFTRESET   : byte  = $E0;
  BME280_REGISTER_CAL26       : byte  = $E1;
  BME280_REGISTER_CONTROLHUMID: byte  = $F2;
  BME280_REGISTER_STATUS      : byte  = $F3;
  BME280_REGISTER_CONTROL     : byte  = $F4;
  BME280_REGISTER_CONFIG      : byte  = $F5;
  BME280_REGISTER_PRESSUREDATA: byte  = $F7;
  BME280_REGISTER_TEMPDATA    : byte  = $FA;
  BME280_REGISTER_HUMIDDATA   : byte  = $FD;

  // Name of Registers used in the BME280

  BME280_DIG_T1_REG           : byte  = $88;
  BME280_DIG_T2_REG           : byte  = $8A;
  BME280_DIG_T3_REG           : byte  = $8C;
  BME280_DIG_P1_REG           : byte  = $8E;
  BME280_DIG_P2_REG           : byte  = $90;
  BME280_DIG_P3_REG           : byte  = $92;
  BME280_DIG_P4_REG           : byte  = $94;
  BME280_DIG_P5_REG           : byte  = $96;
  BME280_DIG_P6_REG           : byte  = $98;
  BME280_DIG_P7_REG           : byte  = $9A;
  BME280_DIG_P8_REG           : byte  = $9C;
  BME280_DIG_P9_REG           : byte  = $9E;


  BME280_DIG_H1_REG           : byte  = $A1;
  BME280_DIG_H2_REG           : byte  = $E1;
  BME280_DIG_H3_REG           : byte  = $E3;
  BME280_DIG_H4_REG           : byte  = $E4;
  BME280_DIG_H5_REG           : byte  = $E5;
  BME280_DIG_H6_REG           : byte  = $E7;

  MODE_SLEEP                  : byte  = 0;
  MODE_FORCED                 : byte  = %01;
  MODE_NORMAL                 : byte  = %11;

  SEALEVELPRESSURE_HPA        : float = 1013.25;
{--------------------------------------------------------------}
{ Const Declarations }
const
  ja                 : byte = 255;
  nein               : byte = 0;
{ Var Declarations }
{$IDATA}
var
  b                  : byte;
  BME280_ADDR        : byte;
  cal_data           : TBME280_Calibration_Data;

  t_fine             : longint;
  TempCal            : float; // stores the temp offset calibration
  Temperature,                // stores temperature value
  Humidity,                   // stores humidity value
  Pressure           : float;
  
  CASE_BME280readTDF : byte;
  TmIntervall        : SysTimer;
  BME_280            : byte;
  Id                 : byte;
  // BME280readTemperature;
  var1, var2         : longint;
  adc_T              : longint;
  // BME280readPressure;
  var3, var4, p      : int64;
  adc_P              : longint;
  xStrg              : string[12];
  // BME280readHumidity;
  adc_H,
  v_x1_u32r          : longint;
  h                  : float;
{--------------------------------------------------------------}
{ functions }

procedure BME280write8(reg, data: byte);
begin
  I2Cout(BME280_Addr, reg, data);
end;

function BME280read8(reg: byte): byte;
var
  res   : byte;
begin
  I2Cout(BME280_ADDR, reg);
  I2Cinp(BME280_ADDR, res);
  return(res);
end;

function BME280read16(reg: byte): word;
var
  buff: array[0..1] of byte;
begin
  I2Cout(BME280_ADDR, reg);
  I2Cinp(BME280_ADDR, buff);
  return((word(buff[0]) shl 8) or word(buff[1]));
end;

function BME280read16_LE(reg: byte): word;
var
  tmp: word;
begin
  tmp:= BME280read16(reg);
  return((tmp shr 8) or (tmp shl 8));
end;

function BME280readS16_LE(reg: byte): integer;
begin
  return((integer(BME280read16_LE(reg))));
end;
{
function BME280readS16(reg: byte): integer;
begin
  return(integer(BME280read16(reg)));
end;
}
// Reads a signed 24 bit value over the I2C bus_REG
function BME280read24(reg: byte): longword;
var
  buff: array[0..2] of byte;
begin
  I2Cout(BME280_ADDR, reg);
  I2Cinp(BME280_ADDR, buff); // only read 3 bytes 24-bit
  return((longword(buff[0]) shl 16) or (longword(buff[1]) shl 8) or longword(buff[2]));
end;

procedure BME280_ReadSensorCoefficients;
begin
  cal_data.dig_T1:= BME280read16_LE(BME280_DIG_T1_REG);
  cal_data.dig_T2:= BME280readS16_LE(BME280_DIG_T2_REG);
  cal_data.dig_T3:= BME280readS16_LE(BME280_DIG_T3_REG);
  cal_data.dig_P1:= BME280read16_LE(BME280_DIG_P1_REG);
  cal_data.dig_P2:= BME280readS16_LE(BME280_DIG_P2_REG);
  cal_data.dig_P3:= BME280readS16_LE(BME280_DIG_P3_REG);
  cal_data.dig_P4:= BME280readS16_LE(BME280_DIG_P4_REG);
  cal_data.dig_P5:= BME280readS16_LE(BME280_DIG_P5_REG);
  cal_data.dig_P6:= BME280readS16_LE(BME280_DIG_P6_REG);
  cal_data.dig_P7:= BME280readS16_LE(BME280_DIG_P7_REG);
  cal_data.dig_P8:= BME280readS16_LE(BME280_DIG_P8_REG);
  cal_data.dig_P9:= BME280readS16_LE(BME280_DIG_P9_REG);
  cal_data.dig_H1:= BME280read8(BME280_DIG_H1_REG);
  cal_data.dig_H2:= BME280readS16_LE(BME280_DIG_H2_REG);
  cal_data.dig_H3:= word(BME280read8(BME280_DIG_H3_REG));
  cal_data.dig_H4:= integer(integer(BME280read8(BME280_DIG_H4_REG)) shl 4) or (integer(BME280read8(BME280_DIG_H4_REG + 1)) and $F);
  cal_data.dig_H5:= integer(integer(BME280read8(BME280_DIG_H5_REG + 1)) shl 4) or (integer(BME280read8(BME280_DIG_H5_REG)) shr 4);
  cal_data.dig_H6:= int8(BME280read8(BME280_DIG_H6_REG));
end;
{
// return true if chip is busy reading cal data
// true if reading calibration, false otherwise
function BME280isReadingCalibration: boolean;
var
  Status   : byte;
begin
  Status:= BME280read8(BME280_REGISTER_STATUS);
  return((Status and 1) <> 0);
end;

procedure BME280setTempCal(Cal: float);
begin
  TempCal:= Cal;
end;
}
//-----------------------------------------------------------
procedure BME280readTempDruckFeucht;
begin
  Case CASE_BME280readTDF of                     // BME280 initialisieren.
    0     : If IsSysTimerZero(TmIntervall) Then
              BME280_ADDR:= BME280_I2C_Adress;
              Id:= BME280read8(BME280_REGISTER_CHIPID);
              If Id = $60 Then
                // BME280write8(BME280_REGISTER_SOFTRESET, $B6);
                BME280_ReadSensorCoefficients();
                mdelay(10);
                // making sure sensor is in sleep mode before setting configuration
                // as it otherwise may be ignored
                // BME280write8(BME280_REGISTER_CONTROL, MODE_SLEEP);
                // Set Humidity oversampling to 16x
                BME280write8(BME280_REGISTER_CONTROLHUMID, $03); // Set before CONTROL (DS 5.4.3)
                BME280write8(BME280_REGISTER_CONTROL, $3F);
                BME_280:= ja;
                CASE_BME280readTDF:= 10;
              Else
                BME_280:= nein;
                CASE_BME280readTDF:= 100;         // Fehler, kein Sensor vorhanden.
              Endif;
            Endif;
          |
    10    : // BME280readTemperature;
            If IsSysTimerZero(TmIntervall) Then    // BME280readTemperature;
              adc_T:= longint(BME280read24(BME280_REGISTER_TEMPDATA) shr 4);  // lowest 4 bits get dropped
              CASE_BME280readTDF:= 11;            
        var1:= longint((adc_T shr 3) - (longint(cal_data.dig_T1 shl 1)));
              var1:= (var1 * (longint(cal_data.dig_T2))) shr 11;
              var2:= longint(((adc_T shr 4) - (longint(cal_data.dig_T1))));
              var2:= (((var2 * var2) shr 12) * (longint(cal_data.dig_T3))) shr 14;
              t_fine:= var1 + var2;
              Temperature:= float((((t_fine * 5) + 128) shr 8));
              Temperature:= Temperature / 100;
              Temperature:= (Temperature + TempCal);
              CASE_BME280readTDF:= 20;
            EndIf;
          |
    20    : // BME280readPressure;
            adc_P:= longint(BME280read24(BME280_REGISTER_PRESSUREDATA) shr 4); // lowest 4 bits get dropped
            var3:= int64(t_fine) - 128000;
            var4:= var3 * var3 * int64(cal_data.dig_P6);
            var4:= var4 + ((var3 * int64(cal_data.dig_P5)) shl 17);
            var4:= var4 + (int64(cal_data.dig_P4) shl 35);
            var3:= ((var3 * var3 * int64(cal_data.dig_P3)) shr 8) +
                   ((var3 * int64(cal_data.dig_P2)) shl 12);
            var3:= (((int64(1) shl 47) + var3) * int64(cal_data.dig_P1)) shr 33;
            If (var3 = 0) Then     // avoid exception caused by division by zero
              Pressure:= 0.0;
            Return;
            EndIf;
            p:= 1048576 - int64(adc_P);
            p:= (((p shl 31) - var4) * 3125) div var3;
            var3:= (int64(cal_data.dig_P9) * (p shr 13) * (p shr 13)) shr 25;
      var4:= int64(cal_data.dig_P8) * (p shr 19);
            p:= ((p + var3 + var4) shr 8) + (int64(cal_data.dig_P7) shl 4);
            // Pressure:= float(p) div 256;         // Error: not implemented
            xStrg:= Long64ToStr(p: 6: 2: '0');   // better with Fix64
            Pressure:= StrToFloat(xStrg) / 256;
            CASE_BME280readTDF:= 30;
          |
    30    : // BME280readHumidity;
            adc_H:= longint(BME280read16(BME280_REGISTER_HUMIDDATA));
            v_x1_u32r:= (t_fine - (76800));
            v_x1_u32r:= (((((adc_H shl 14) - ((longint(cal_data.dig_H4)) shl 20) -
                        ((longint(cal_data.dig_H5)) * v_x1_u32r)) + (16384)) shr 15) *
                        (((((((v_x1_u32r * (longint(cal_data.dig_H6))) shr 10) *
                        (((v_x1_u32r * (longint(cal_data.dig_H3))) shr 11) + (32768))) shr 10) +
                        (2097152)) * (longint(cal_data.dig_H2)) + 8192) shr 14));
            v_x1_u32r:= (v_x1_u32r - (((((v_x1_u32r shr 15) * (v_x1_u32r shr 15)) shr 7) *
                        (longint(cal_data.dig_H1))) shr 4));
            If (v_x1_u32r < 0) Then
              v_x1_u32r:= 0;
            EndIf;
            If v_x1_u32r > 419430400 Then
              v_x1_u32r:= 419430400;
            EndIf;
            h:= float(v_x1_u32r shr 12);
            Humidity:= (h / 1024.0);
            CASE_BME280readTDF:= 100;
          |
    100   : If BME_280 = ja Then
              Writeln(Serout, '');
              Writeln(Serout, ' BME 280 Test....');
              Writeln(Serout, ' Sensor found at Addr: 0x' + ByteToHex(BME280_ADDR));
              // BME280setTempCal(-1);
              Writeln(Serout, ' Temp: ' + FloatToStr(Temperature: 3: 2: '0') + ' C');
              Writeln(Serout, ' Humity: ' + FloatToStr(Humidity: 3: 2: '0') + ' %');
              Writeln(Serout, ' Pressure: ' + FloatToStr(Pressure: 4: 2: '0') + ' hPa');
            Else
              Writeln(Serout, 'Could not find a valid BME280 sensor, check wiring, address, sensor ID!');
              CASE_BME280readTDF:= 0;
            EndIf;
            SetSysTimer(TmIntervall, 1000);
            CASE_BME280readTDF:= 10;
          |
    EndCase;
end BME280readTempDruckFeucht;

{--------------------------------------------------------------}
{ Main Program }
{$IDATA}

begin
  EnableInts;
  loop
    BME280readTempDruckFeucht;
  endloop;
end BME280_Test_3.

go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 56
Posts: 914
Registered: 09 / 2007
Private message
Subject: Re: Bascom ---> Pascal  -  Posted: 21.08.2022 - 22:01   -  
Hi Matthias,
sehr schön.
Es sollte von mir auch nur eine Vorlage sein, damit du dich nicht mit Basic herumärgern musst :)
Es ist auch ein gutes Beispiel, das man mit den bestehenden I2C Treiber alle ICs mit bedienen kann.

Die Vars global schützen den Frame beim In64 . :zustimm:
Im Loop unten fehlt ein delay ? Der Sensor liefert nur jede Sekunde neue Werte.

miparo
Kein Support per PN! | No support via PM!
This post has been edited 4-times. Last edit: 21.08.2022 - 22:07 by miparo.
go down go up
 


Registered users in this topic
Currently no registered users in this section

Delete cookies of this forum  •  FAQ / Help  •  Team page  •  Imprint   |  Local time: 02.10.2022 - 06:25