Jump to content
  • 0

Pmod CMPS2 example for Arduino


pasicr

Question

Hi there, I use Pmod CMPS2 example with Arduino, https://reference.digilentinc.com/reference/pmod/pmodcmps2/start

code work OK like compass, but I need to use the sensor like magnetic field sensor and get value from sensor for X, Y and Z value of

magnetic filed in mG (that is implemented in code but the final result on serial monitor is compass value, not 3 axis magnetic field values)

Can somebody help me with advice or code?

Thanks

Regards

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Hi @pasicr,

The code as is won't provide you the mG values as those are set as private variables within the corresponding .h file. You could adjust the library code to make the x, y, and z values public, or it looks like you may be able to call the getX, getY, and getZ in the Arduino code which should return the values you are looking for (albeit for a single sample rather than an average).

Thanks,
JColvin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...