Hi,
I am trying to extract temperature from a thinxtra xkit shield connected to an arduino. Can anyone please help me to eliminate the inline C part in the below code.
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Private temperature As Float
Private tmrTemperature As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
tmrTemperature.Initialize("tmrTemperature_Tick", 1000)
tmrTemperature.Enabled = True
End Sub
private Sub tmrTemperature_Tick
RunNative("Include",Null)
Log(temperature)
End Sub
#if C
#include <WISOL.h>
#include <Tsensors.h>
#include <Wire.h>
#include <math.h>
Isigfox *Isigfox = new WISOL();
Tsensors *tSensors = new Tsensors();
void Include(B4R::Object* o)
{
Wire.begin();
Wire.setClock(100000);
b4r_main::_temperature = round(tSensors->getTemp() * 10) / 10.0;
}
#End If
I am trying to extract temperature from a thinxtra xkit shield connected to an arduino. Can anyone please help me to eliminate the inline C part in the below code.
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Private temperature As Float
Private tmrTemperature As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
tmrTemperature.Initialize("tmrTemperature_Tick", 1000)
tmrTemperature.Enabled = True
End Sub
private Sub tmrTemperature_Tick
RunNative("Include",Null)
Log(temperature)
End Sub
#if C
#include <WISOL.h>
#include <Tsensors.h>
#include <Wire.h>
#include <math.h>
Isigfox *Isigfox = new WISOL();
Tsensors *tSensors = new Tsensors();
void Include(B4R::Object* o)
{
Wire.begin();
Wire.setClock(100000);
b4r_main::_temperature = round(tSensors->getTemp() * 10) / 10.0;
}
#End If