コード例 #1
0
void Clock::printTime() {
	static boolean printColon = true;

	// 12:25 PM
	printLeadingCharacter(hourFormat12(currentTime), ' ');
	if (printColon)
		lcd.print(':');
	else
		lcd.print(' ');
	printColon = !printColon;
	printLeadingCharacter(minute(currentTime), '0');

	lcd.print(' ');
	if (isPM(currentTime))
	{
		lcd.print(F("PM"));
	}
	else
	{
		lcd.print(F("AM"));
	}
}
コード例 #2
0
int hourFormat12() { // the hour now in 12 hour format
  return hourFormat12(now()); 
}
コード例 #3
0
/* current hour in 12 hour format */
int TimeClass::hourFormat12()
{
	return hourFormat12(now());
}