Hi. I am having problems with the Honeywell flux sensor. I am able to get a reading which is in bytes which I need to then convert to bits and use the start bit and length (provided in info sheet) in order to get a reading.
I am able to get this reading printing to the serial monitor, but I need help with converting this value.
Essentially, how do I take a string which is in bytes and split it into bits,a nd then translate those bits into readable data.
Is this a student project? If so, is decoding the data a key part of your project?
bitRead() will allow you to inspect the individual bits within a byte.
You can build a number by multiplying each bit value by the 2^n bit position in the destination 32 bit unsigned long type.
I'm doing this project to try to get readings for a current sensor. Decoding is not necessarily part of the project, but right now I'm stuck because the sensor is giving me readings ex 1234567890 that I'm not sure how to translate so I'm assuming decoding is the next step? I tried using bitRead() but I'm not sure what to do with the bits after. I do have the start bit and length of the data but I'm not sure if I should translate to binary, hex, or is there some other step I am missing?
You can contact a Honeywell apps engineer and ask for help and if there are any application notes explaining how to use it. I looked for a bit and did not find any.
Can I suggest you cut your code down, or write new code to just deal with the CSN sensor.
Use Serial print to output and get rid of the display code/hardware etc.
This will enable to concentrate on one device at a time.
Also Serial.begin (9600);
change to
Serial.begin (115200);
Much quicker, just don't forget to change the IDE serial monitor to 115200.