Thanks to all who posted code and provided comment. More informative than the datasheet.