Magnetometer
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-08-08 6:52 AM
Posted on August 08, 2016 at 15:52
Hello folks,
I am trying to implement magnetomter LIS3MDL with STM32F4. After reading the X, Y and Z axis register I am getting negative values as they are 2's complement. How can I transmit them on UART to see negative decimal value on hyperterminal ?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-08-08 7:59 AM
Posted on August 08, 2016 at 16:59
How can I transmit them on UART to see negative decimal value on hyperterminal ?
How would you convert any binary representation into ASCII? If you couldn't figure out the negation and repeated division by 10, you could use things likehttp://www.cplusplus.com/reference/cstdlib/itoa/
or sprintf() and send the buffer. sprintf(buffer,''%d,%d,%d\n'', x, y, z);
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
