mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
46 lines
637 B
Arduino
46 lines
637 B
Arduino
|
//
|
||
|
// FILE: float16_test1.ino
|
||
|
// AUTHOR: Rob Tillaart
|
||
|
// VERSION: 0.1.0
|
||
|
// PURPOSE: test float16
|
||
|
// DATE: 2015-03-11
|
||
|
// URL: https://github.com/RobTillaart/float16
|
||
|
//
|
||
|
|
||
|
#include "float16.h"
|
||
|
|
||
|
float16 X;
|
||
|
|
||
|
|
||
|
void setup()
|
||
|
{
|
||
|
while(!Serial);
|
||
|
Serial.begin(115200);
|
||
|
Serial.println(__FILE__);
|
||
|
Serial.print("FLOAT16_LIB_VERSION: ");
|
||
|
Serial.println(FLOAT16_LIB_VERSION);
|
||
|
Serial.println("\nStart ");
|
||
|
|
||
|
float f;
|
||
|
|
||
|
for (uint16_t n = 0; n < 65535; n++)
|
||
|
{
|
||
|
f = X.f16tof32(n);
|
||
|
Serial.print(n);
|
||
|
Serial.print('\t');
|
||
|
Serial.println(f, 6);
|
||
|
}
|
||
|
|
||
|
Serial.println("\ndone");
|
||
|
}
|
||
|
|
||
|
|
||
|
void loop()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
|
// -- END OF FILE --
|
||
|
|
||
|
|