![](/media/cache/profiles/2012_sf_avc_095.jpg.50x50_q85.jpg)
Code for autonomous rover for Sparkfun AVC. DataBus won 3rd in 2012 and the same code was used on Troubled Child, a 1986 Jeep Grand Wagoneer to win 1st in 2014.
Dependencies: mbed Watchdog SDFileSystem DigoleSerialDisp
Diff: print.h
- Revision:
- 13:14f56b76aa23
diff -r 5dfa1ab47838 -r 14f56b76aa23 print.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/print.h Thu Nov 29 16:52:09 2018 +0000 @@ -0,0 +1,56 @@ +/* + * print.h + * + * Created on: Jan 6, 2014 + * Author: mes + */ + +#ifndef MYPRINT_H_ +#define MYPRINT_H_ + +#include <stdio.h> +#include <stdint.h> + +#ifdef __CPLUSPLUS +extern "C" { +#endif + +/** print an unsigned long number to FILE + * + * @param f is the FILE * to which the data will be sent + * @param n is the number to print + * @return the number of bytes printed + */ +extern "C" size_t printNumber(FILE *f, unsigned long n); + +/** print a signed long number to FILE + * + * @param f is the FILE * to which the data will be sent + * @param n is the number to print + * @return the number of bytes printed + */ +extern "C" size_t printInt(FILE *f, long n); + +/** print a double to FILE + * + * @param f is the FILE * to which the data will be sent + * @param number is the number to print + * @param digits is the number of digits to print after the decimal point + * @return the number of bytes printed + */ +extern "C" size_t printFloat(FILE *f, double number, uint8_t digits); + +/** print an int as hex to FILE + * + * @param f is the FILE * to which the data will be sent + * @param n is the number to print + * @param digits is the number of hex digits to print + * @return the number of bytes printed + */ +extern "C" size_t printHex(FILE *f, long n, uint8_t digits); + +#ifdef __CPLUSPLUS +} +#endif + +#endif /* MYPRINT_H_ */