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


C++ LiquidCrystal_I2C::backlight方法代码示例

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


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

示例1: setup

void setup()/*----( SETUP: RUNS ONCE )----*/
{
  lcd.begin(20, 4);        // initialize the lcd for 20 chars 4 lines and turn on backlight
  
  // Open serial communications and wait for port to open:
  Serial.begin(9600);

  // --- button setup

  pinMode(RunBtn, INPUT);
  pinMode(ChangeScanBtn, INPUT);

  digitalWrite(RunBtn, HIGH);
  digitalWrite(ChangeScanBtn, HIGH);


  pinMode(clampPin, OUTPUT);      // sets the digital pin as OUTPUT to drive FET clamp)

  pinMode(5, OUTPUT);      // sets the digital pin as output
  pinMode(6, OUTPUT);      // sets the digital pin as output
  pinMode(7, OUTPUT);      // sets the digital pin as output
  pinMode(11, OUTPUT);     // pin11= PWM  output / frequency output //Will Turner - This could go to pin 5 from 11.  CHANGED TO 9 AS IT WOULDNT REACH OTHERS


  // ------- Quick 3 blinks of backlight  -------------
  for (int i = 0; i < 3; i++)
  {
    lcd.backlight();
    delay(20);
    lcd.noBacklight();
    delay(20);
  }
  lcd.backlight(); // finish with backlight on

  //-------- Initialise display ----------------
  // NOTE: Cursor Position: CHAR, LINE) start at 0
  lcd.setCursor(0, 0); //Start at character 0 on line 0
  lcd.print("Tension Tester v1.5 "); // sets up the screen for the wire number and layer number being recorded
  lcd.setCursor(0, 2);
  lcd.print("     Press Run      ");

  Setup_timer2();

  // disable interrupts to avoid timing distortion
  cbi (TIMSK0, TOIE0);             // disable Timer0 !!! delay() is now not available
  sbi (TIMSK2, TOIE2);             // enable Timer2 Interrupt

  dfreq = 1000.0;                  // initial output frequency = 1000.o Hz
  tword_m = pow(2, 32) * dfreq / refclk; // calulate DDS new tuning word

  // setup start and end frequencies of sweep

  // setup initial values for loop
  adcflag = false;

  analogval = 0;
  digitalWrite(clampPin, HIGH);    // sets the pin high to short out large signals before amp (using a FET as clamp)
  avgcnt = 0.0;
}
开发者ID:RFQED,项目名称:TensionTester,代码行数:59,代码来源:ArduinoCode.c

示例2: flashx3

void flashx3() {
// ------- Quick 3 blinks of backlight  -------------
for (int i = 0; i < 3; i++)
{
  lcd.backlight();
  delay(2000);
  lcd.noBacklight();
  delay(2000);
}
lcd.backlight(); // finish with backlight on

//-------- Initialise display ----------------
}
开发者ID:RFQED,项目名称:TensionTester,代码行数:13,代码来源:ArduinoCode.c

示例3: setup

void setup()
{
  Serial.begin(115200);
 
  //Setup Channel A
  pinMode(X_DIR_PIN, OUTPUT); //Initiates Motor Channel A pin
  pinMode(Y_DIR_PIN, OUTPUT); //Initiates Motor Channel A pin
  pinMode(9, OUTPUT); //Initiates Brake Channel A pin
  pinMode(A0,INPUT);
  pinMode(X_MIN_PIN,INPUT_PULLUP);
  pinMode(X_MAX_PIN,INPUT_PULLUP);
  pinMode(X_JOY_LEFT,INPUT_PULLUP);
  pinMode(X_JOY_RIGHT,INPUT_PULLUP);
  pinMode(Y_JOY_DOWN,INPUT_PULLUP);
  pinMode(Y_JOY_UP,INPUT_PULLUP);
  // Quadrature encoders
  // X encoder
  pinMode(c_XEncoderPinA, INPUT);      // sets pin A as input
  digitalWrite(c_XEncoderPinA, LOW);  // turn on pullup resistors
  pinMode(c_XEncoderPinB, INPUT);      // sets pin B as input
  digitalWrite(c_XEncoderPinB, LOW);  // turn on pullup resistors
  attachInterrupt(c_XEncoderInterrupt, HandleLeftMotorInterruptA, RISING);
 
  // Y encoder
  pinMode(c_YEncoderPinA, INPUT);      // sets pin A as input
  digitalWrite(c_YEncoderPinA, LOW);  // turn on pullup resistors
  pinMode(c_YEncoderPinB, INPUT);      // sets pin B as input
  digitalWrite(c_YEncoderPinB, LOW);  // turn on pullup resistors
  attachInterrupt(c_YEncoderInterrupt, HandleRightMotorInterruptA, RISING);
  
  
  lcd.begin(20,4);         // initialize the lcd for 20 chars 4 lines, turn on backlight

// ------- Quick 3 blinks of backlight  -------------
  for(int i = 0; i< 3; i++)
  {
    lcd.backlight();
    delay(150);
    lcd.noBacklight();
    delay(150);
  }
  lcd.backlight(); // finish with backlight on  

//-------- Write characters on the display ------------------
  // NOTE: Cursor Position: Lines and Characters start at 0  
  lcd.setCursor(3,0); //Start at character 4 on line 0
  lcd.print("Hello, world!");
 

}/*--(end setup )---*/
开发者ID:sgawad,项目名称:Teacup_Firmware,代码行数:50,代码来源:Main.cpp

示例4: processButton

void WeatherStation::processButton()
{
    #define GOTOSLEEP_TIME 2 //s

    setCurrentDate();
    buttonPressHours = runHours;
    buttonPressMinute = currentMinute;

    if ( DISPLAY_STATE_INIT == displayMgt.state )
    {
        lcd.backlight();

        lcd.setCursor(0,0);
        lcd.print("Weather Station");  //16
        lcd.setCursor(0,1);
        lcd.print("*** DFRobot ***");  //16

        addAction(ACTION_SAMPLE_DATA);
    }

    addAction(ACTION_DISPLAY);


    overTime = SLEEP_OVERTIME;
    /**to avoid RTC interrupt when goto sleep **/
    if ( (59 == currentMinute) && ( (currentSecond + overTime + GOTOSLEEP_TIME) >= 60 ))
    {
        overTime += (GOTOSLEEP_TIME + 1);
    }


}
开发者ID:pookiemaker,项目名称:Reviews,代码行数:32,代码来源:WeatherStation.cpp

示例5: init

void init()
{
	Serial.begin(SERIAL_BAUD_RATE);
	Serial.systemDebugOutput(true); // Allow debug print to serial
	Serial.println("Sming. Let's do smart things!");
	Wire.pins(2, 0);
	lcd.begin(16, 2);
	lcd.backlight();

	lcd.clear();
	lcd.setCursor(0, 0);
	lcd.print("DATE: 00/00/0000");
	lcd.setCursor(0, 1);
	lcd.print("TIME: 00:00");

	// Station - WiFi client
	WifiStation.enable(true);
	WifiStation.config(WIFI_SSID, WIFI_PWD); // Put you SSID and Password here

	// set timezone hourly difference to UTC
	SystemClock.setTimeZone(7);

	

	// Run our method when station was connected to AP (or not connected)
	WifiStation.waitConnection(connectOk, 30, connectFail); // We recommend 20+ seconds at start
}
开发者ID:db4linq,项目名称:SystemClock_NTP,代码行数:27,代码来源:application.cpp

示例6: loop

// The loop function is called in an endless loop
void loop() {
	delay(SENSOR_CHANGE_TRIGGER_TIME);
	unsigned long unchangedTime = millis() - lastMotionDetected;
	if (unchangedTime < MAX_ON_TIME) {
		lcd.display();
		lcd.backlight();
		switch (sensor) {
		case TEMPERATURE_SENSOR_NUM:
			setTemperature();
			break;
		case HUMIDITY_SENSOR_NUM:
			setHumidity();
			break;
		case SOIL_SENSOR_NUM:
			setSoilHumidity();
			break;
		case PRESSURE_SENSOR_NUM:
			setPressure();
			break;
		}
	} else {
		lcd.noDisplay();
		lcd.noBacklight();
	}
	delay(500);
}
开发者ID:kjetilfjellheim,项目名称:arduino_experiments,代码行数:27,代码来源:Senser.cpp

示例7: init

void init()
{
	spiffs_mount(); // Mount file system, in order to work with files

	Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
	Serial.systemDebugOutput(false); // Debug output to serial

	ActiveConfig = loadConfig();

	// Select control line
	pinMode(CONTROL_PIN, OUTPUT);

	// DHT sensor start
	dht.begin();

	lcd.begin(16, 2);
	lcd.backlight();
	lcd.createChar(1, icon_termometer);
	lcd.createChar(2, icon_water);
	lcd.createChar(3, celsius);
	lcd.createChar(4, icon_retarrow);
	lcd.createChar(5, icon_clock);
	lcd.createChar(6, icon_cross);
	lcd.createChar(7, icon_check);

	WifiStation.config(ActiveConfig.NetworkSSID, ActiveConfig.NetworkPassword);
	WifiStation.enable(true);
	WifiAccessPoint.enable(false);

	WifiStation.waitConnection(connectOk, 20, connectFail); // We recommend 20+ seconds for connection timeout at start

	procTimer.initializeMs(5000, process).start();
	process();
}
开发者ID:BorntraegerMarc,项目名称:Sming,代码行数:34,代码来源:application.cpp

示例8:

LCD::LCD(Cooler *cooler, CheeseDHT *dhtUp, CheeseDHT *dhtDown, CheeseLog* logger) {
  this->cooler = cooler;
  this->logger = logger;
  this->dhtUp = dhtUp;
  this->dhtDown = dhtDown;
  Wire.begin(4, 5);
  currentLCD.init();
  currentLCD.backlight();
  counter = 0;
}
开发者ID:cheese-ua,项目名称:smarthome.arduino,代码行数:10,代码来源:LCD.cpp

示例9: init

void init()
{

	spiffs_mount(); 
	Serial.begin(230400); // 115200 by default

	Serial.systemDebugOutput(false); // Enable debug output to serial

	Wire.begin();	
	lcd.begin(16,2);               // initialize the lcd 

	for(int i = 0; i< 3; i++)
	{
		lcd.backlight();
		delay(150);
		lcd.noBacklight();
		delay(250);
	}
	lcd.backlight();
	
    lcd.setCursor(0,0);
    lcd.clear();
    lcd.print("    Music Box   ");
    lcd.setCursor(0,1);
    lcd.print("    Geek Labs   ");
	SystemClock.setTimeZone(3);
	printTimer.initializeMs(1000*60, onPrintSystemTime).start();
	
	Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
	Serial.systemDebugOutput(true); // Enable debug output to serial
	WifiStation.enable(true);
	WifiStation.config(WIFI_SSID, WIFI_PWD);
	WifiAccessPoint.enable(false);
	
	Wire.beginTransmission(PT2258_ADDRESS); 
	Wire.write(0xC0);
	Wire.endTransmission();
		
	// Run our method when station was connected to AP
	WifiStation.waitConnection(connectOk, 30, connectFail);
}
开发者ID:avtehnik,项目名称:esp8266-music-box,代码行数:41,代码来源:application.cpp

示例10: setPower

void setPower(int state){
	power = state;
	lcd.setCursor(0,1);
	if(state==1){
		lcd.print("   Power ON     ");	
		lcd.backlight();
	}else{
		lcd.print("   Power OFF    ");	
		lcd.noBacklight();
	}

}
开发者ID:avtehnik,项目名称:esp8266-music-box,代码行数:12,代码来源:application.cpp

示例11: setup

void setup() {
  Serial.begin(9600);
  pinMode(SOILSENSOR, INPUT);
  pinMode(PUMPPIN, OUTPUT);
  
  // initialize the LCD
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Initializing...");

  dht.begin();
}
开发者ID:darrenrector,项目名称:darrenrector.github.io,代码行数:13,代码来源:ArduinoAutoWatering.c

示例12: navigationInit

void navigationInit(PiezoEffects * mySounds)
{
  navigationSounds = mySounds;

  //lcd buttons
  pinMode(LCD_UP_PIN, INPUT_PULLUP);
  pinMode(LCD_DOWN_PIN, INPUT_PULLUP);
  pinMode(LCD_PLAY_PIN, INPUT_PULLUP);
  pinMode(LCD_STOP_PIN, INPUT_PULLUP);

  // initialize the LCD
  lcd.begin();
  lcd.backlight();
  lcd.print("Geekbot Navigator");
}
开发者ID:robotgeek,项目名称:geekbot,代码行数:15,代码来源:Navigation.cpp

示例13: enableAfterSleep

void WeatherStation::enableAfterSleep()
{
    uint8_t i;
    volatile uint8_t *out, *ddr;
    uint16_t diffMinutes;

    //enable power
    digitalWrite( PALETTE_PIN_MVCC, LOW );
    pinMode( PALETTE_PIN_MVCC, OUTPUT );
    delay(50);  //waiting power stable

    /**recovery ports**/
    for( i = 0; i < PALETTE_PORT_NUM; i++ )
    {
        ddr = portModeRegister(ioPort[i]);
        out = portOutputRegister(ioPort[i]);

        *ddr = ioPreDDRValue[i];
        *out = ioPrePORTValue[i];
    }


    sensorMgt.start();
    lcd.init();  //need sometimes

    if ( EVENT_STATE_SET == eventButtonState )
    {
        lcd.backlight();

        setCurrentDate();

        diffMinutes = (uint16_t)(runHours - buttonPressHours) * 60 + currentMinute - buttonPressMinute;

        if ( (!displayMgt.statisticFlag) || (diffMinutes >= RESTART_DISPLAY_OVERTIME) )
        {
            clrDisplayMgt();
        }
    }


    for ( i = 0; i < ACTION_NUMBER; i++ )
    {
        a_actionList[i].state = STATE_INIT;
    }

    startTime = (uint8_t)(millis()/1000);

}
开发者ID:pookiemaker,项目名称:Reviews,代码行数:48,代码来源:WeatherStation.cpp

示例14: setup

void setup() {  
  lcd.begin();
  lcd.backlight();
}
开发者ID:senfo,项目名称:ScratchPad,代码行数:4,代码来源:SainSmartLCD.c

示例15: setup

void setup()
{
    target_lat[1] = TARGET_1_LAT;
    target_lon[1] = TARGET_1_LON;
    target_lat[2] = TARGET_2_LAT;
    target_lon[2] = TARGET_2_LON;
    target_lat[3] = TARGET_3_LAT;
    target_lon[3] = TARGET_3_LON;
    target_lat[4] = TARGET_4_LAT;
    target_lon[4] = TARGET_4_LON;
    target_lat[5] = TARGET_5_LAT;
    target_lon[5] = TARGET_5_LON;
    target_lat[6] = TARGET_6_LAT;
    target_lon[6] = TARGET_6_LON;
    target_lat[7] = TARGET_7_LAT;
    target_lon[7] = TARGET_7_LON;
    target_lat[8] = TARGET_8_LAT;
    target_lon[8] = TARGET_8_LON;
    target_lat[9] = TARGET_9_LAT;
    target_lon[9] = TARGET_9_LON;
    target_lat[10] = TARGET_10_LAT;
    target_lon[10] = TARGET_10_LON;
    target_lat[11] = TARGET_11_LAT;
    target_lon[11] = TARGET_11_LON;
    target_lat[12] = TARGET_12_LAT;
    target_lon[12] = TARGET_12_LON;
    target_lat[13] = TARGET_13_LAT;
    target_lon[13] = TARGET_13_LON;
    target_lat[14] = TARGET_14_LAT;
    target_lon[14] = TARGET_14_LON;

    target = EEPROM.read(EEPROM_TARGET_INDEX);
    if(target > NUMBER_OF_TARGETS+2 || target == 0 /*|| TARGET_RESET > 0*/) {
        target = 1;
        EEPROM.write(EEPROM_TARGET_INDEX, target);
    }

    // Force next step on strtup
    //target++;
    //EEPROM.write(EEPROM_TARGET_INDEX, target);

    // Init pin outputs
    pinMode(BATTERY_VOLTAGE_PIN, INPUT);
    pinMode(BUTTON_PIN, INPUT);
    pinMode(LED_PIN, OUTPUT);
    pinMode(SERVO_ON_PIN, OUTPUT);
    pinMode(ON_PIN, INPUT);
    pinMode(LCD_POWER_PIN, OUTPUT);
    pinMode(GPS_RX_PIN, INPUT);

    digitalWrite(LCD_POWER_PIN, 1);
    digitalWrite(SERVO_ON_PIN, 0);

    servo.attach(SERVO_PIN);

    analogReference(EXTERNAL);

    ss.begin(9600);
    Serial.begin(115200);

    lcd.init();
    lcd.backlight();

    lcd_welcome(lcd);

    wait w;
    w.set_time(3000);
    w.start();

    wait sim;
    w.set_time(30000);
    sim.set_steps(7);
    sim.start();

    Serial.print(F("Free RAM:"));    Serial.println(freeRam());
    Serial.println(F("Setup done."));
}
开发者ID:vvranjek,项目名称:questbox,代码行数:77,代码来源:QwestBox.cpp


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