B4R Question Strange error report

positrom2

Active Member
Licensed User
Longtime User
I am trying to graph the readings of the BMP280 sensor on the 1306-OLED.
I am combining the codes for the bare sensor with the code for the OLED.
Each one separately works.
B4X:
Sub Process_Globals
   Public Serial1 As Serial
   Private bmp As Adafruit_BMP280
        Private ssd As AdafruitSSD1306
         Private d1pins As D1Pins
     Private vx = 3, vy = 3 As Int
     Private px, py As Int
     Private radius As Int = 3
     Private tmr As Timer
     Private p As Float
End Sub

Private Sub AppStart
   Serial1.Initialize(115200)
   Log("AppStart")
       ssd.InitializeI2C(d1pins.D6, 0x3c)
    ssd.ClearDisplay
    tmr.Initialize("tmr_Tick", 1000)
    tmr.Enabled = True
  If bmp.Initialize Then
    Log("Successful")
  End If
End Sub
Private Sub tmr_Tick
    p=bmp.ReadPressure
     Log(p)
    ssd.GFX.DrawCircle(px, p, radius, ssd.BLACK, True)
    px = px + vx
   
    If px - radius <= 0 Then vx = Abs(vx)
    If px + radius >= ssd.GFX.Width Then vx = -Abs(vx)
    If py - radius <= 0 Then vy = Abs(vy)
    If py + radius >= ssd.GFX.Height Then vy = -Abs(vy)
    ssd.GFX.DrawCircle(px, py, radius, ssd.WHITE, True)
    ssd.Display 'apply the drawings
End Sub
Combining I get the error
The problem does not seem to be in the Adafruit_Sensor.h since the bare BMP280 code works.
Question: What might be the problem?
 

positrom2

Active Member
Licensed User
Longtime User
It appears that the strange error report (....."Adafruit_Sensor.h" enthält unbekannte Zeichen......" occurs when flashing was not successful.
The float vs. double did not eliminate the error (came up again). After pulling the USB plug and a couple of resets flashing was ok.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…