adafruit / Adafruit_nRF8001

Drivers for Adafruit's nRF8001 Bluetooth Low Energy Breakout
109 stars 53 forks source link

Added more print() functions for Strings, Integers and FlashStringHelpers #5

Closed marcoschwartz closed 10 years ago

marcoschwartz commented 10 years ago

Hello, I added new functions into the library to make it more like the Serial library of Arduino. I added print() functions for Integers, Strings and FlashStringHelper. Please review the changes, thanks. I tested it with my Adafruit BLE breakout board and it works well.

tdicola commented 10 years ago

Thanks for submitting the pull and apologies it took a little while to be reviewed. I just integrated it but made a few small changes. I pulled out the calls to free since the character buffer is on the stack and free shouldn't be used to clear its memory. I also change the integer printing function to accept any signed int since it's already calling itoa and could handle negative values easily. Also made the flash string send handle strings longer than 20 characters by calling write multiple times. Gave things a quick test and the new print functions work as expected. Thanks for submitting the changes!

marcoschwartz commented 10 years ago

Great, thanks a lot for the merge & your modifications. Just tested the new code this morning with my BLE projects, it works perfectly.