• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setBrightness函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setBrightness函数的典型用法代码示例。如果您正苦于以下问题:C++ setBrightness函数的具体用法?C++ setBrightness怎么用?C++ setBrightness使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: pulse

/*
  Fade from off to given color and back.
 */
void pulse(int w) {
  uint32_t c;
  //uint32_t c = Wheel(map(opt, 0, 1023, 0, 255)); 
  for(uint16_t j = 8; j <= getOpt(_pin_lev, 0, 255); j++) {
    if( checkButton() ){ return; };
    setBrightness(j);
    c = Wheel(map(opt, 0, 1023, 0, 255));
    for(uint16_t i = 0; i < numPixels(); i++) {
      setPixelColor(i, c);
    }
    show();
    delay(w);
  }
  delay(w*10+50);
  for(uint16_t j=getOpt(_pin_lev, 0, 255); j>8; j--) {
    if( checkButton() ){ return; };
    setBrightness(j);
    c = Wheel(map(opt, 0, 1023, 0, 255));
    for(uint16_t i = 0; i < numPixels(); i++) {
      setPixelColor(i, c);
    }
    show();
    delay(w);
  }
  delay(w*10+50);
}
开发者ID:CNG,项目名称:arduino-examples,代码行数:29,代码来源:strip_functions.cpp


示例2: qDebug

void LEDControl::detectPath()
{
    qDebug() << "detectPath called";

    // get the name of this hardware from the /etc/hw-release file
    QSettings hwFile("/etc/hw-release", QSettings::IniFormat);
    QString name = hwFile.value("NAME").toString();
    qDebug() << "Name detected from /etc/hw-release is: " << name;

    // Use the name from /etc/hw-release to look up the control file location in controlfile.conf
    QSettings controlFileSettings("/usr/share/harbour-hammerhead-torch/controlfile.conf",QSettings::IniFormat);

    // Difficult to replace /usr/share/ with a variable, because QStandardPaths doesn't support an option that resolves to /usr/share/<APPNAME> yet
    //qDebug() << QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); //QStandardPaths::AppDataLocation and QStandardPaths::AppLocalDataLocation added in Qt 5.4

    if ( controlFileSettings.contains(name) ) {
        setDevice( name );
        setPath( controlFileSettings.value(name).toString() );
    } else {
        qDebug() << "Hardware not recognised";
        setDevice("Unknown");
        setPath("Unknown");
    }

    // Use the name from /etc/hw-release to look up the brightness in brightness.conf
    QSettings brightnessSettings("/usr/share/harbour-hammerhead-torch/brightness.conf",QSettings::IniFormat);

    if ( brightnessSettings.contains(name) ) {
        setBrightness( brightnessSettings.value(name).toString() );
    } else {
        setBrightness(QString::number(1));
    }

}
开发者ID:sam-hobbs,项目名称:harbour-hammerhead-torch,代码行数:34,代码来源:ledcontrol.cpp


示例3: onInit

    void onInit()
    {
        setBrightness(3, -16);
        videoSetMode(MODE_5_2D);
        videoSetModeSub(MODE_0_2D);

        vramSetBankA(VRAM_A_MAIN_BG);
        vramSetBankC(VRAM_C_SUB_BG);

        int bg3 = bgInit(3, BgType_Bmp8, BgSize_B8_256x256, 0, 0);

        dmaCopy(splashBitmap, bgGetGfxPtr(bg3), 256*256);
        dmaCopy(splashPal, BG_PALETTE, 256*2);

        for(int i = 0; i < 128; i++)
        {
            setBrightness(3, -16+(i/8));
            swiWaitForVBlank();
        }
        for(int i = 0; i < 128; i++)
        {
            setBrightness(3, -(i/8));
            swiWaitForVBlank();
        }
    }
开发者ID:Yoshiyuka,项目名称:Potion-Shop,代码行数:25,代码来源:SplashState.cpp


示例4: setBrightness

void Brightness::dim()
{
    if(m_dimOff) setBrightness(0);
    else setBrightness(DIM_LEVEL);
    m_dimmed = true;
    // Speed up the updater a little
    m_mouseUpdate.start(500);
}
开发者ID:BotBallARDroneAPI,项目名称:CBC_Library,代码行数:8,代码来源:Brightness.cpp


示例5: breathe

// Breath a color, for a total breathe time of...
void breathe(struct WS2812B_Strip *strip, uint32_t color, const uint32_t breathCycleTime)
{
  uint8_t oldBrightness = strip->brightness;
  uint16_t pixelIndex;
  uint8_t j;

  clear(strip);
  show(strip);

  for (pixelIndex = 0; pixelIndex < strip->numberOfPixels; pixelIndex++)
  {
    setPixelColor(strip, pixelIndex, color);
  }

  // Breathe in.
  for(j = 1; j < 255; j++)
  {
	if (strip->breakFromPattern == true)
	{
	  return;
	}

	setBrightness(strip, j);
    show(strip);
	delay_ms(breathCycleTime/512);
  }

  // pause in.
  delay_ms(breathCycleTime/16);

  // Breathe out.
  for(j = 255; j > 0; j--)
  {
	if (strip->breakFromPattern == true)
	{
	  return;
	}

    setBrightness(strip, j);
    show(strip);
	delay_ms(breathCycleTime/512);
  }

  // pause out.
  delay_ms(breathCycleTime/16);

  strip->brightness = oldBrightness;
  return;
}
开发者ID:NicholasNagrodski,项目名称:WS2812B-Strip-Controller,代码行数:50,代码来源:patterns.c


示例6: switch

void S60CameraImageProcessingControl::setProcessingParameter(
    QCameraImageProcessingControl::ProcessingParameter parameter, QVariant value)
{
    switch (parameter) {
        case QCameraImageProcessingControl::Contrast:
            setContrast(value.toInt());
            break;
        case QCameraImageProcessingControl::Saturation:
            setSaturation(value.toInt());
            break;
        case QCameraImageProcessingControl::Brightness:
            setBrightness(value.toInt());
            break;
        case QCameraImageProcessingControl::Sharpening:
            if (isSharpeningSupported())
                setSharpeningLevel(value.toInt());
            break;
        case QCameraImageProcessingControl::Denoising:
            if (isDenoisingSupported())
                setDenoisingLevel(value.toInt());
            break;
        case QCameraImageProcessingControl::ColorTemperature:
            setManualWhiteBalance(value.toInt());
            break;

        default:
            break;
    }
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:29,代码来源:s60cameraimageprocessingcontrol.cpp


示例7: max7456_on

void OSD::hw_init() {
    max7456_on();

    //read black level register
    byte osdbl_r = MAX_read(MAX7456_OSDBL_reg_read);//black level read register

    MAX_write(MAX7456_VM0_reg, MAX7456_RESET | video_mode);
    delay_150();

    //set black level
    MAX_write(MAX7456_OSDBL_reg, (osdbl_r & 0xef)); //black level write register - Set bit 4 to zero 11101111 - Enable automatic OSD black level control

// set position - may be EEPROM.read(OSD_SHIFT_X)
    MAX_write(MAX7456_HOS_reg, 0x20); // 0x20 default
    MAX_write(MAX7456_VOS_reg, 0x10); // 0x10 default


    MAX_write(MAX7456_OSDM_reg, 0b00010010); // 0x00011011 default

    setBrightness();

    // define sync (auto,int,ext)
//      MAX_write(MAX7456_VM0_reg, MAX7456_DISABLE_display | video_mode);
    MAX_write(MAX7456_VM0_reg, (MAX7456_ENABLE_display_vert | video_mode) | MAX7456_SYNC_internal);

    delay_150();

    MAX_write(MAX7456_VM0_reg, (MAX7456_ENABLE_display_vert | video_mode) | MAX7456_SYNC_autosync);

    max7456_off();

}
开发者ID:cliffoco,项目名称:minimosd-extra,代码行数:32,代码来源:ArduCam_Max7456.cpp


示例8: pinMode

Matrix::Matrix(uint8_t data, uint8_t clock, uint8_t load, uint8_t screens /* = 1 */)
{
  // record pins for sw spi
  _pinData = data;
  _pinClock = clock;
  _pinLoad = load;

  // set ddr for sw spi pins
  pinMode(_pinClock, OUTPUT);
  pinMode(_pinData, OUTPUT);
  pinMode(_pinLoad, OUTPUT);

  // allocate screenbuffers
  _screens = screens;
  _buffer = (uint8_t*)calloc(_screens, 64);
  _maximumX = (_screens * 8);

  // initialize registers
  clear();             // clear display
  setScanLimit(0x07);  // use all rows/digits
  setBrightness(0x0F); // maximum brightness
  setRegister(REG_SHUTDOWN, 0x01);    // normal operation
  setRegister(REG_DECODEMODE, 0x00);  // pixels not integers
  setRegister(REG_DISPLAYTEST, 0x00); // not in test mode
}
开发者ID:BackupTheBerlios,项目名称:arduino-svn,代码行数:25,代码来源:Matrix.cpp


示例9: onResourceInitialization

      //! Initialize resources.
      void
      onResourceInitialization(void)
      {
        if (!getConstantParameters())
          throw RestartNeeded(DTR("failed to get constant parameters"), c_restart_delay);

        setConfig();

        std::map<std::string, LED*>::iterator itr = m_led_by_name.begin();
        for (unsigned i = 0; i < c_led_count; ++i)
          setBrightness(itr->second, 0);

        if (!m_args.led_patterns.empty())
        {
          uint8_t count = m_args.led_patterns.size();

          UCTK::Frame frame;
          frame.setId(PKT_ID_LED_PATTERN);
          frame.setPayloadSize(1 + (count * 2));
          frame.set(count, 0);
          for (size_t i = 0; i < count; ++i)
            frame.set<uint16_t>(m_args.led_patterns[i], 1 + i * 2);
          if (!m_ctl->sendFrame(frame))
            throw RestartNeeded(DTR("failed to set LED patterns"), c_restart_delay);
        }

        m_wdog.reset();
        setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_ACTIVE);
      }
开发者ID:FreddyFox,项目名称:dune,代码行数:30,代码来源:Task.cpp


示例10: rainbowSingle

//Rainbow Program
void rainbowSingle() {
  setBrightness();
  //int wait = getOpt(_pin_opt, -20, 20);
  uint16_t i, j;
  for(j = 0; j < 256; j++) {

    // calculate wait based on volatile opt from interrupt
    int wait = (int) map(opt, 0, 1023, -100, 100);
    if( wait < 0 ) {
      // negative values make a huge apparent difference, so fake a larger spread
      // by having -100 to 100 instead of -20 to 100
      wait = floor( wait / 5 );
    }
    // kind of a hack to allow negative wait value to speed rainbow by
    // skipping colors, otherwise 0 would be fast as chip could process
    if(wait < 0 &&  j % ( -1 * wait ) != 0){
      continue; 
    }

    if( checkButton() ){ return; };
    for(i=0; i < numPixels(); i++) {
      setPixelColor(i, Wheel(j));
    }
    show();

    if(wait > 0){
      delay(wait);
    }

  }
}
开发者ID:CNG,项目名称:arduino-examples,代码行数:32,代码来源:strip_functions.cpp


示例11: QSerialPort

/*
 * Called on device start
 */
void LcdController::setup()
{
    // Setup LCD
    serial = new QSerialPort(this);
    serial->setPortName(portName);

    status = serial->open(QIODevice::WriteOnly);

    if(status)
    {
        serial->setBaudRate(QSerialPort::Baud9600,QSerialPort::AllDirections);
        serial->setDataBits(QSerialPort::Data8);
        serial->setStopBits(QSerialPort::OneStop);
        serial->setFlowControl(QSerialPort::NoFLowControl);
        serial->setParity(QSerialPort::NoParity);

        // Set 16 Characters Wide
        serial->putChar(LCD_COMMAND);
        serial->putChar(4);

        // Set 2 Lines
        serial->putChar(LCD_COMMAND);
        serial->putChar(6);

        clearScreen();
    }

    // Setup brightness
    setBrightness(30);
}
开发者ID:james-dibble,项目名称:Embedded-Systems-Assignment,代码行数:33,代码来源:lcdcontroller.cpp


示例12: doSave

        void SettingsMenu::doSave()
        {
            auto settings = Game::getInstance()->settings();
            settings->setCombatDifficulty(((UI::MultistateImageButton*)getUI("combat_difficulty"))->state());
            settings->setGameDifficulty(((UI::MultistateImageButton*)getUI("game_difficulty"))->state());
            settings->setViolenceLevel(((UI::MultistateImageButton*)getUI("violence_level"))->state());
            settings->setTargetHighlight(((UI::MultistateImageButton*)getUI("target_highlight"))->state());
            settings->setCombatLooks(((UI::MultistateImageButton*)getUI("combat_looks"))->state());
            settings->setCombatMessages(((UI::MultistateImageButton*)getUI("combat_messages"))->state());
            settings->setCombatTaunts(((UI::MultistateImageButton*)getUI("combat_taunts"))->state());
            settings->setLanguageFilter(((UI::MultistateImageButton*)getUI("language_filter"))->state());
            settings->setRunning(((UI::MultistateImageButton*)getUI("running"))->state());
            settings->setSubtitles(((UI::MultistateImageButton*)getUI("subtitles"))->state());
            settings->setItemHighlight(((UI::MultistateImageButton*)getUI("item_highlight"))->state());

            settings->setMasterVolume(((UI::Slider*)getUI("master_volume"))->value());
            settings->setMusicVolume(((UI::Slider*)getUI("music_volume"))->value());
            settings->setVoiceVolume(((UI::Slider*)getUI("voice_volume"))->value());
            settings->setSfxVolume(((UI::Slider*)getUI("sfx_volume"))->value());

            settings->setTextDelay(((UI::Slider*)getUI("text_delay"))->value());
            settings->setCombatSpeed(((UI::Slider*)getUI("combat_speed"))->value());
            settings->setBrightness(((UI::Slider*)getUI("brightness"))->value());
            settings->setMouseSensitivity(((UI::Slider*)getUI("mouse_sensitivity"))->value());

            settings->setPlayerSpeedup(((UI::ImageButton*)getUI("player_speedup"))->checked());

            settings->save();
            Game::getInstance()->popState();
        }
开发者ID:CynicRus,项目名称:falltergeist,代码行数:30,代码来源:SettingsMenu.cpp


示例13: setBrightness

void Graphics::fadein(int duration)
{
	FBO::unbind();

	float curr = p->brightness;
	float diff = 255.0f - curr;

	for (int i = 1; i <= duration; ++i)
	{
		setBrightness(curr + (diff / duration) * i);

		if (p->frozen)
		{
			GLMeta::blitBeginScreen(p->scSize);
			GLMeta::blitSource(p->frozenScene);

			FBO::clear();
			p->metaBlitBufferFlippedScaled();

			GLMeta::blitEnd();

			p->swapGLBuffer();
		}
		else
		{
			update();
		}
	}
}
开发者ID:xperia64,项目名称:android-mkxp,代码行数:29,代码来源:graphics.cpp


示例14: m_acuity

 YarpManager::YarpManager():
 m_acuity(0),
 m_brightness(0),
 m_fov(0),
 m_threshold(0)
 {
     std::cout<<"## YarpManager Initialisation ##"<<std::endl;
     std::cout<<"- Setting default parameters value"<<std::endl;
     setAcuity(3);
     setFov(100);
     setBrightness(50);
     setTreshold(150);
     
     std::cout<<"- Setting up YARP network"<<std::endl;
     yarp::os::Network::init();
     std::cout<<"- Opening YARP port"<<std::endl;
     std::cout<<"    * /target/module"<<std::endl;
     m_modulePort.open("/target/module");
     m_modulePort.setStrict();
     m_modulePort.useCallback(*this);
     
     std::cout<<"    * /target/parameter"<<std::endl;
     m_parameterPort.open("/target/parameter");
     m_parameterPort.setStrict();
     m_parameterPort.useCallback(*this);
 }
开发者ID:ChrisdAutume,项目名称:MoDelVi,代码行数:26,代码来源:YarpManager.cpp


示例15: setBrightness

void LevelState::Init()
{
	setBrightness(2, 0);
    //Création du worldmanager
	worldMan = new WorldManagerOffline();
	worldMan->Init();
}
开发者ID:morukutsu,项目名称:ds-chewing-boy,代码行数:7,代码来源:LevelState.cpp


示例16: setBrightness

void Dispositif::parseMessage(String code)
{
  if(orderZone)
  {
    //Serial.println(code);
    //int temp = code.toInt();
    // we check we are in the good zone, if it's true, the next part can be read
    if(code == zone)
    {
      zoneMatch = true;
    }
    else
    {
      zoneMatch = false;
    }
    orderZone = false; 
  }
  else
  { 
    orderZone = true;
    // if we are in the right zone, we can update the brightness
    if(zoneMatch)
    {
       //int p = code.toInt();  // Code is a string
       setBrightness(0, code.toInt());
    }
  }
}
开发者ID:RedBullInsomnia,项目名称:IDP,代码行数:28,代码来源:Dispositif.cpp


示例17: memoryStatus

void airbear::hatch(){
  Serial.begin(115200);
  memoryStatus();
  delay(5000);

  while(!vs1053.begin()){

  }

  SD.begin(CARDCS);    // initialise the SD card
  vs1053.setVolume(5,5);  // Set volume for left, right channels. lower numbers == louder volume!
  vs1053.useInterrupt(DREQ);  // DREQ int
  vs1053.playFullFile("Sounds/orbstart.mp3");



  neopixelbegin();
  setBrightness(MatrixBrightness);

  pinMode(heartpin,INPUT);
  pinMode(circlepin,INPUT);
  pinMode(crosspin,INPUT);
  pinMode(squarepin,INPUT);
  connection();

  tail4 = PositionRandomizer(random(7));
  tail3 = PositionRandomizer(tail4);
  tail2 = PositionRandomizer(tail3);
  tail1 = PositionRandomizer(tail2);
  head = PositionRandomizer(tail1);
  memoryStatus();
}
开发者ID:axhue,项目名称:ParticleAirbear,代码行数:32,代码来源:Airbear2.cpp


示例18: pinMode

/*
|| @constructor
|| | Initializes the digital pins and the Max7219
|| #
|| 
|| @parameter data    The data pin connected to the Max7219
|| @parameter clock   The clock pin connected to the Max7219
|| @parameter load    The load pin connected to the Max7219
|| @parameter screens The number of screens
*/
Matrix::Matrix(byte data, byte clock, byte load, byte screens /* = 1 */)
{
  // record pins for sw spi
  dataPin = data;
  clockPin = clock;
  loadPin = load;

  // set ddr for sw spi pins
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(loadPin, OUTPUT);

  // allocate screenbuffers
  numberOfScreens = numberOfScreens;
  buf = (byte*)calloc(numberOfScreens, 64);
  maximumX = (numberOfScreens * 8);

  // initialize registers
  clear();             // clear display
  setScanLimit(0x07);  // use all rows/digits
  setBrightness(0x0F); // maximum brightness
  setRegister(REG_SHUTDOWN, 0x01);    // normal operation
  setRegister(REG_DECODEMODE, 0x00);  // pixels not integers
  setRegister(REG_DISPLAYTEST, 0x00); // not in test mode
}
开发者ID:110h18,项目名称:Wiring,代码行数:35,代码来源:Matrix.cpp


示例19: pinMode

void OSD::init()
{
  pinMode(MAX7456_SELECT,OUTPUT);
  pinMode(MAX7456_VSYNC, INPUT);
  digitalWrite(MAX7456_VSYNC,HIGH); //enabling pull-up resistor

  detectMode();

  digitalWrite(MAX7456_SELECT,LOW);
  //read black level register
  Spi.transfer(MAX7456_OSDBL_reg_read);//black level read register
  byte osdbl_r = Spi.transfer(0xff);
  Spi.transfer(MAX7456_VM0_reg);
  Spi.transfer(MAX7456_RESET | video_mode);
  delay(50);
  //set black level
  byte osdbl_w = (osdbl_r & 0xef); //Set bit 4 to zero 11101111
  Spi.transfer(MAX7456_OSDBL_reg); //black level write register
  Spi.transfer(osdbl_w);

  setBrightness();
  // define sync (auto,int,ext) and
  // making sure the Max7456 is enabled
  control(1);
}
开发者ID:kosmikkosmik,项目名称:apm-osd,代码行数:25,代码来源:ArduCam_Max7456.cpp


示例20: ChangeMode

void ChangeMode(ModeType mode)
{
	//dim screen
	if (Mode::sCurrentMode != NULL)
	{
		for (s32 b = 0; b >= -16; --b)
		{
			setBrightness(1, b);
			swiWaitForVBlank();
		}
	}
	else
	{
		setBrightness(1, -16);
	}
	
	TextManager::Bottom().Clear();
	TextManager::Top().Clear();
	
	//must reset clock before calling constructors
	//otherwise bad things happen with sprites
	GameClock::Clock().Reset();
	
	if (Mode::sCurrentMode != NULL)
		delete Mode::sCurrentMode;
	
	switch (mode)
	{
		case MODE_PLAYER:
			Mode::sCurrentMode = new Player();
			break;
		case MODE_SONGSELECT:
			Mode::sCurrentMode = new SongSelect();
			break;
	}
	
	swiWaitForVBlank();
	Mode::CurrentMode().Update();
	glFlush(1);
	
	//return screen to full brightness
	for (s32 b = -16; b <= 0; ++b)
	{
		setBrightness(1, b);
		swiWaitForVBlank();
	}
}
开发者ID:echojc,项目名称:osu-ds,代码行数:47,代码来源:ModeLoader.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setBufferSize函数代码示例发布时间:2022-05-30
下一篇:
C++ setBounds函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap