当前位置: 首页>>代码示例>>C++>>正文


C++ LiquidCrystal::write方法代码示例

本文整理汇总了C++中LiquidCrystal::write方法的典型用法代码示例。如果您正苦于以下问题:C++ LiquidCrystal::write方法的具体用法?C++ LiquidCrystal::write怎么用?C++ LiquidCrystal::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LiquidCrystal的用法示例。


在下文中一共展示了LiquidCrystal::write方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loop

void loop()
{
lcd.setCursor(3,1);
lcd.write(1); // desenha o coração
delay(500);
lcd.setCursor(3,1);
lcd.print(" Hello World! "); // Após 0.5s apaga o coração, assim ele
delay(500); // ficará piscando
}
开发者ID:vinihjunior,项目名称:Arduino_LCD,代码行数:9,代码来源:display_sz.c

示例2: PaddedWrite

/*
	Writing numbers with padding.

	@param in number to be written.
	@param decimals decimal places.
	@param row to write the number.
*/
void PaddedWrite(double in, byte decimals, byte row)
{
	// decimal mark
	byte dm = 0;  if(decimals > 0) dm = 1;

	// clear row
	for (byte i = 0; i < (sides[row][1] - sides[row][0]); i++)
	{
		lcd.setCursor(sides[row][0] + i, row);
		lcd.write(' ');
	}
	lcd.setCursor(Padding(in, row) - dm - decimals, row);
	lcd.print((round(in * pow(10, decimals)) / pow(10, decimals)), decimals);
}
开发者ID:racer01,项目名称:weather_station,代码行数:21,代码来源:main.cpp

示例3: display

	// Display results
	void display(int x, int y, int d, int near, int nearX, int nearY, int rangeX, int rangeY)
	{
	  lcd.setCursor(0, 0);
	  lcd.write("    ");
	  lcd.setCursor(0, 1);
	  lcd.write("    ");
	  lcd.setCursor(4,0);
	  lcd.write("    ");
	  lcd.setCursor(4,1);
	  lcd.write("    ");
	  lcd.setCursor(8,0);
	  lcd.write("    ");
	  lcd.setCursor(8,1);
	  lcd.write("    ");
	  lcd.setCursor(12,0);
	  lcd.write("    ");
	  lcd.setCursor(12,1);
	  lcd.write("    ");

	  lcd.setCursor(0, 0);
	  lcd.print(x);
	  lcd.setCursor(0, 1);
	  lcd.print(y);
	  lcd.setCursor(4, 0);
	  lcd.print(nearX);
	  lcd.setCursor(4, 1);
	  lcd.print(nearY);
	  lcd.setCursor(8,0);
	  lcd.print(d);
	  lcd.setCursor(8,1);
	  lcd.print(near < 10000 ? near : -1);
	  lcd.setCursor(12, 0);
	  lcd.print(rangeX);
	  lcd.setCursor(12, 1);
	  lcd.print(rangeY);
}
开发者ID:DerekK19,项目名称:Arduino,代码行数:37,代码来源:Servo_Test.cpp

示例4: loop


//.........这里部分代码省略.........

			if ( mode == SET_CLOCK_MODE )
			{
				RTC.getTime();
				seconds = RTC.second;
				minutes = RTC.minute;
				hours = RTC.hour;
				mode = NORMAL_MODE;
			}
			else if ( mode == SET_FEED_MODE )
			{
				showFeedTime(feedIndex);
				mode = NORMAL_MODE;
			}
		}
	}
	else
	{
		if ( displayTimeout >= timeout )
		{
			prevKey = NO_KEY;
		}

		displayTimeout = 0;
		pinMode(10, INPUT);
	}

	lcd.setCursor(0, 0);              // Datum und Uhrzeit in 1. Zeile schreiben

	int blinkClock = (mode == SET_CLOCK_MODE) && (seconds % 2) && (key == NO_KEY || key == SELECT_KEY);

	if ( blinkClock && position == POS_DAY )
	{
		lcd.write("  ");
	}
	else
	{
		if (RTC.day < 10)
			lcd.write("0");
		lcd.write ( itoa ( RTC.day, buffer, 10 ) );
	}

	lcd.write(".");

	if ( blinkClock && position == POS_MONTH )
	{
		lcd.write("  ");
	}
	else
	{
		if (RTC.month < 10)
			lcd.write("0");
		lcd.write ( itoa ( RTC.month, buffer, 10 ) );
	}

	lcd.write(".");

	if ( blinkClock && position == POS_YEAR )
	{
		lcd.write ("    ");
	}
	else
	{
		lcd.write ( itoa ( RTC.year, buffer, 10 ) );
	}
开发者ID:fschultze,项目名称:Catfeeder,代码行数:66,代码来源:CatFeeder.cpp

示例5: setup

void setup()
{
	byte * ptr;

	Serial.begin(9600);
	Serial.println("Started");

	lcd.begin(16, 2);
	lcd.clear();
    
	//lcd.write( "DS1307 - Uhr" );
	//RTC.setRAM(0, (uint8_t *)&startAddr, sizeof(uint16_t));// Store startAddr in NV-RAM address 0x08

	/*
	 Uncomment the next 2 lines if you want to SET the clock
	 Comment them out if the clock is set.
	 DON'T ASK ME WHY: YOU MUST UPLOAD THE CODE TWICE TO LET HIM WORK
	 AFTER SETTING THE CLOCK ONCE.
	 */
//  TimeIsSet = 0xffff;
//  RTC.setRAM(54, (uint8_t *)&TimeIsSet, sizeof(uint16_t));
	/*
	 Control the clock.
	 Clock will only be set if NV-RAM Address does not contain 0xaa.
	 DS1307 should have a battery backup.
	 */
	//RTC.getRAM(54, (uint8_t *)&TimeIsSet, sizeof(uint16_t));
	//if (TimeIsSet != 0xaa55)
	//{
	//  RTC.stopClock();
	//
	//  RTC.fillByYMD(2011,4,8);
	//  RTC.fillByHMS(22,7,0);
	//
	//  RTC.setTime();
	//  TimeIsSet = 0xaa55;
	//  RTC.setRAM(54, (uint8_t *)&TimeIsSet, sizeof(uint16_t));
	//  RTC.startClock();
	//}
	//else
	//{
	if ( !RTC.isPresent() )
	{
		lcd.write("No clock detected");
	}

	RTC.getTime();
	//}

	/*
	 Control Register for SQW pin which can be used as an interrupt.
	 */
	RTC.ctrl = 0x00;                      // 0x00=disable SQW pin, 0x10=1Hz,
										  // 0x11=4096Hz, 0x12=8192Hz, 0x13=32768Hz
	RTC.setCTRL();

	uint8_t MESZ = RTC.isMEZSummerTime();

	mode = NORMAL_MODE;
	seconds = RTC.second;
	minutes = RTC.minute;
	hours = RTC.hour;
	position = POS_DAY;
	parts = 0;
	partsPerSec = 5;
	waitTime = 200;
	keyPressed = 0;
	feedIndex = 1;
	feedHour = 0;
	feedMinute = 0;
	feedCup = 0;
	displayTimeout = 0;
	remainingCups = 0;

	for (int i = 0; i < sizeof(feedTimes) / sizeof(feedTimes[0]); i++)
	{
		uint8_t addr;
		uint8_t * ptr = (uint8_t *) &feedTimes[i];

		switch (i)
		{
		case 0:
			addr = ADDR_TIME_ENTRY_1;
			break;
		case 1:
			addr = ADDR_TIME_ENTRY_2;
			break;
		case 2:
			addr = ADDR_TIME_ENTRY_3;
			break;
		case 3:
			addr = ADDR_TIME_ENTRY_4;
			break;
		default:
			break;
		}

		for (int x = 0; x < 4; x++)
		{
			uint8_t val = EEPROM.read(addr + x);
//.........这里部分代码省略.........
开发者ID:fschultze,项目名称:Catfeeder,代码行数:101,代码来源:CatFeeder.cpp


注:本文中的LiquidCrystal::write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。