SWARM-Bot Firmware  v1.0
Mobile robot OS - Embedded C/C++
__format__.h File Reference

Header file for format.c. More...

#include <__swarm_wold__.h>
Include dependency graph for __format__.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * _float_to_printable (float input)
 

Detailed Description

Header file for format.c.

  • File: format.h
  • Compiler: GCC-AVR
  • Supported devices: Tested on 328p
  • AppNote: string formatter
Author
Swarm robot graduation project workgroub
Mechatronics Program for the Distinguished
$Name$
Revision
1

$RCSfile$

Date
/5/2021 12:34:35 AM

Definition in file __format__.h.

Function Documentation

◆ _float_to_printable()

char* _float_to_printable ( float  input)

Convert a float varialbe to string

Parameters
[in]inputinput value of float to convert to string
24 {
25  //a.b
26  int16_t a = input;
27  uint16_t b = (float)((input - (float)a ) * 10000.0);
28  char *out;
29 
30  sprintf(out, "%d,%u", a,b);
31  return out;
32 }