From 2ba032c103bc2275ccd31274f46331261d934c90 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sat, 3 Aug 2019 17:33:05 +0200 Subject: [PATCH] Added test for number conversion --- uart/main.cpp | 20 +++++++++++++++++++- uart/uart | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/uart/main.cpp b/uart/main.cpp index 10ab81d..302aea0 100644 --- a/uart/main.cpp +++ b/uart/main.cpp @@ -57,7 +57,7 @@ void newUartUsage2() void newUartStreamOverloads() { using namespace uart; - Uart1<> serial; + Uart1> serial; serial.init(); sei(); @@ -90,6 +90,24 @@ void newUartStreamOverloads() serial << F("unsigned long long : ") << ullVal << F("\r\n"); serial << F("const void : ") << &bVal << F("\r\n"); + auto number = 0xBADF00D; + + serial << F("Binary : 0b"); + serial.txNumber(number); + serial << F("\r\n"); + + serial << F("Octal : 0"); + serial.txNumber(number); + serial << F("\r\n"); + + serial << F("Decimal : "); + serial.txNumber(number); + serial << F("\r\n"); + + serial << F("Hex : 0x"); + serial.txNumber(number); + serial << F("\r\n"); + _delay_ms(1000); } diff --git a/uart/uart b/uart/uart index 8d07e2d..b6c1c3b 160000 --- a/uart/uart +++ b/uart/uart @@ -1 +1 @@ -Subproject commit 8d07e2d4db6f0fafebb00db7993b43b49aee30fc +Subproject commit b6c1c3b51b44b3d7cb32e7f5f0222ecc155f8294