It has some sample code which i think uses stm32 and is based on as different sensor. I want to work on this sensor using arduino.
It has a data sheet https://www.es.co.th/Schemetic/PDF/AFS01IA.PDF
which is totally different from all the tutorials i have searched on internet. I am unable to do anything with this data sheet.
After scanning address with i2c scanner i am getting address 0x40 but in the data sheet it says 0x15.
I am very new to arduino can someone guide me how to proceed ?
i have tried to run this code which i wrote from all the searching and tutorials i could find
#include <Wire.h>
#define SLA 0x15
#define RAD 0x2B
#define WAD 0x2A
int16_t data = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Wire.begin();
Wire.beginTransmission(SLA);
Wire.write(RAD);
Wire.write(0x00);
Wire.write(0x02);
Wire.endTransmission();
}
void loop() {
Wire.requestFrom(SLA, 2);
int a = Wire.read();
int b = Wire.read();
Serial.println(a);
Serial.println(b);
delay(500);
}
if i use SLA as 0x15 i get -1 as repeated output and if i use SLA as 0x40 i get 0 as repeated output in serial monitot. I have attached data sheet in the post