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


C++ Led类代码示例

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


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

示例1: InputButton

void TestSimulationController::testCase1( ) {
  InputButton *btn1 = new InputButton( );
  InputButton *btn2 = new InputButton( );
  And *andItem = new And( );
  Led *led = new Led( );
  QNEConnection *conn = new QNEConnection( );
  QNEConnection *conn2 = new QNEConnection( );
  QNEConnection *conn3 = new QNEConnection( );
  editor->getScene( )->addItem( led );
  editor->getScene( )->addItem( andItem );
  editor->getScene( )->addItem( btn1 );
  editor->getScene( )->addItem( btn2 );
  editor->getScene( )->addItem( conn );
  editor->getScene( )->addItem( conn2 );
  editor->getScene( )->addItem( conn3 );
  conn->setPort1( btn1->output( ) );
  conn->setPort2( andItem->input( 0 ) );
  conn2->setPort1( btn2->output( ) );
  conn2->setPort2( andItem->input( 1 ) );
  conn3->setPort1( andItem->output( ) );
  conn3->setPort2( led->input( ) );
  QVector< GraphicElement* > elms( SimulationController::sortElements( editor->getScene( )->getElements( ) ) );
  QVERIFY( elms.at( 0 ) == btn1 || elms.at( 1 ) == btn1 );
  QVERIFY( elms.at( 0 ) == btn2 || elms.at( 1 ) == btn2 );
  QVERIFY( elms.at( 2 ) == andItem );
  QVERIFY( elms.at( 3 ) == led );
}
开发者ID:G4merBR,项目名称:Guitar-Panda,代码行数:27,代码来源:testsimulationcontroller.cpp

示例2: qDebug

QList<QVector3D> ControlPlan2D::controlLed(const QString & valeur,Cube cubeMotif,int NumeroPlan,QList<QVector3D>  liste_vecteur3D,Ui::MainWindow *ui,QPushButton* buttons[90]){
        QString strlig=valeur[0];
        QString strcol=valeur[1];
        int lig=strlig.toInt(0,10);
        int col=strcol.toInt(0,10);
        Led l;
        l=cubeMotif.getList1()->value(NumeroPlan).getLed(lig,col);
        l.modifierEtat();
        Plan p1=cubeMotif.getList1()->value(NumeroPlan);
        p1.updatePlan(l,lig,col);
        cubeMotif.updateCube(p1,NumeroPlan);
        QVector3D v;
        v=QVector3D(abs(8-col),NumeroPlan,abs(8-lig));
        liste_vecteur3D.append(v);
        QString s ;
        s=QString::number(liste_vecteur3D.size());
        qDebug()<<"la taille de la liste est "+s;
        ui->widget->setListPoints(liste_vecteur3D);
        if(cubeMotif.getList1()->value(NumeroPlan).getLed(lig,col).getEtat()==1){
            liste_vecteur3D.append(v);
           ui->widget->setListPoints(liste_vecteur3D);
        }
        else {
            liste_vecteur3D.removeAll(v);
            ui->widget->setListPoints(liste_vecteur3D);
        }
        afficheLed(buttons,lig,col,l.getEtat());
        return liste_vecteur3D;
}
开发者ID:ppff,项目名称:Cubicle-GUI,代码行数:29,代码来源:controlplan2d.cpp

示例3: initLeds

void
initLeds()
{
  redLed.off();
  greenLed.off();
  redLed.quicklyMakeBlinkSeveralTimes(3);
}
开发者ID:sebastienjean,项目名称:arduino-HAO-tracker,代码行数:7,代码来源:main.cpp

示例4: drawLedCircleOnStatusImage

void VideoBasedTracker::drawLedCircleOnStatusImage(Led const &led,
        bool filled,
        cv::Vec3b color) {
    cv::circle(m_statusImage, led.getLocation(),
               led.getMeasurement().diameter / 2., cv::Scalar(color),
               filled ? -1 : 1);
}
开发者ID:bwrsandman,项目名称:OSVR-Core,代码行数:7,代码来源:VideoBasedTracker.cpp

示例5: ledSet

void Wrapper::ledSet(WbDeviceTag tag, int state) {
  Device *device = DeviceManager::instance()->findDeviceFromTag(tag);
  Led *led = dynamic_cast<Led *>(device);
  if (led) {
    led->setLedRequested();
    led->setState(state);
  }
}
开发者ID:Isaac25silva,项目名称:TD-lambida--walk-Webots,代码行数:8,代码来源:Wrapper.cpp

示例6: rt_thread_entry_led_test

void rt_thread_entry_led_test(void* parameter)
{
	Led led;
	led.init();
	while(1)
	{
		led.toggle();
		
		rt_thread_delay(RT_TICK_PER_SECOND/5);
	}
}
开发者ID:damoxinjiang,项目名称:RT-Thread-Quadcopter,代码行数:11,代码来源:Led.cpp

示例7: Led

void LedTests::addTimeAxis() {
    iAnimation->addTimeAxis(0, 100, 100, kPriorityLow, false);

    Led* led = new Led(iAnimation,
                       *iAnimation,
                       1,
                       Position(0,0),
                       NULL);

    led->addTimeAxis();

    QVERIFY(led->timeAxis() != NULL);
}
开发者ID:annesummers,项目名称:LedAnimator,代码行数:13,代码来源:LedTests.cpp

示例8: setup

// Setup function
void setup()
{
  // connection to the salve computer in the garage
  Serial1.begin(9600);

  // register Particle variables
  Particle.variable("rssi", rssi);
  Particle.variable("temperature", temperature);
  Particle.variable("humidity", humidity);

  // register Particle functions
  Particle.function("Door", funcDoor);
  Particle.function("Restart", funcRestart);

  // connect to the blynk server
  //Blynk.begin("7cb12eb10dee49f98c61d3e7b34f7433");

  //while (Blynk.connect() == false) {
    // Wait until connected
  //}

  debug("STEJ Garage Control");
  debug(String::format("Built: %s %s",__DATE__, __TIME__));

  closeLed.setMax(brightness);
  openLed.setMax(brightness);

  openButton.attach(bePressed, onOpenPressed);
  closeButton.attach(bePressed, onClosePressed);

  screen.begin(0x73, true);
  screen.setBrightness((brightness / 100.0) * 15);
  screen.clearText();

  screen << "Now is the time for a very long message to see if it works!";

  //lcd.clear();

  // Adds newline to every command
  cmd.printLfCr();

  cmd.attach(GC_DoorStatus, &onDoorStatus);
  cmd.attach(GC_Temperature, &onTemperature);

  cmd.sendCmd(GC_Acknowledge, F("Garage Control Master Started!"));

  onFiveSeconds(); fiveSecondTimer.start();
  fiveMinuteTimer.start();
  onThirtySeconds(); thirtySecondTimer.start();
}
开发者ID:stejsoftware,项目名称:GarageControlFirmware,代码行数:51,代码来源:application.cpp

示例9: breathe

void breathe(Led & led)
{
  if( !led.isRunning() )
  {
    if( led.isOn() )
    {
      led.fadeOff(breathe);
    }
    else
    {
      led.fadeOn(breathe);
    }
  }
}
开发者ID:stejsoftware,项目名称:GarageControlFirmware,代码行数:14,代码来源:application.cpp

示例10: switch

bool Chirp::overlaps(Led led) {
	float maxMoveDistance = lastSeen * Config::getRobotSpeed();
	float maxRotation = lastSeen * Config::getRobotRotation();
	float distance = util::distance(position, led.getPoint());

	switch(led.getType()) {
	case Led::RED:
		return distance + maxMoveDistance < Config::getRobotDiameter();
	case Led::BLUE:
		return distance + maxMoveDistance < Config::getRobotDiameter() / 2 + Config::getCameraLedSize();
	case Led::GREEN:
		return distance + maxMoveDistance < (1/2.0 + 1.0/4.0)  * Config::getRobotDiameter();
	}
}
开发者ID:hdlam,项目名称:master,代码行数:14,代码来源:Chirp.cpp

示例11: stopActuators

void Wrapper::stopActuators() {
  // reset all the requests

  for (int i=0; i<5; i++) {
    Led *led = DeviceManager::instance()->led(i);
    led->resetLedRequested();
  }

  vector<Device *>::const_iterator it;
  const vector<Device *> &devices = DeviceManager::instance()->devices();
  for (it=devices.begin() ; it < devices.end(); it++) {
    Sensor *s = dynamic_cast<Sensor *>(*it);
    if (s)
      s->resetSensorRequested();
  }

  // send the packet
  robotStep(0);
}
开发者ID:Isaac25silva,项目名称:TD-lambida--walk-Webots,代码行数:19,代码来源:Wrapper.cpp

示例12: loop

// Loop function
void loop()
{
  // process serial commands
  cmd.feedinSerialData();

  // read buttons
  openButton.run();
  closeButton.run();

  // update led matrix
  screen.run(mpScrollLeft, 100);

  // update leds
  closeLed.display();
  openLed.display();

  // update blynk
  //Blynk.run();
}
开发者ID:stejsoftware,项目名称:GarageControlFirmware,代码行数:20,代码来源:application.cpp

示例13: QFETCH

void LedTests::constructor() {
    QFETCH(Position, position);
    QFETCH(int, number);
    QFETCH(QString, error);

    try {
        Led* led = new Led(iAnimation,
                      *iAnimation,
                      number,
                      position,
                      NULL);

        QCOMPARE(led->position(), position);
        QCOMPARE(led->number(), number);

    } catch(IllegalArgumentException& e){
        QCOMPARE(e.errorMessage(), error);

        return;
    }
}
开发者ID:annesummers,项目名称:LedAnimator,代码行数:21,代码来源:LedTests.cpp

示例14: main

int main(int argc, char** argv){

//Definir estados Leds:
LedRed.LedOff(); //OK
LedGreen.LedOff(); //OK
//Asignar interrupciones a teclas
Tecla1.teclaInterrupcion(); //OK
Tecla3.teclaInterrupcion(); //OK

//Configurar interrupciones:
INTCONSET= _INTCON_MVEC_MASK; //CONFIGURE INTERRUPT CONTROLLLER FOR MULTIVECTOR
__asm__ volatile("ei"); //ENABLE INTERRUPTS

//Main program:
while(1){        
        
        if(Tecla1.pulsada()== 1){
            LedRed.LedOn();
        }
        //PULSAR TECLA 2(RB12) -> APAGAR LOS DOS
        if(Tecla2.pulsada_ahora() == 1){ //DOESNT WORKS
            LedGreen.LedOn();
        }
        
        //PULSAR TECLA 3(RB14) -> ENCENDER LED ROJO(RB4) //OK
        if(Tecla3.pulsada()== 1){
            LedRed.LedOff();
            LedGreen.LedOff();
        }
}
    return 0;
}
开发者ID:TorreX90,项目名称:epsa-embeddedsystems,代码行数:32,代码来源:ejer4.cpp

示例15: IllegalArgumentException

void AxisDetailsWidget::addLed(int row, int column) {
    Led* led = iAnimation.ledAt(Position(row, column));

    if(led == NULL) {
        throw IllegalArgumentException("AnimationDetailsWidget::addLed : NULL led");
    }

    if(!iLedDetails.contains(led->number())) {
        int count = iLedDetails.count();
        qDebug("add new led, %d, %d", row, column);

        QLabel* ledNumberLabel = new QLabel(this);
        ledNumberLabel->setMaximumWidth(LED_LABEL_WIDTH);
        ledNumberLabel->setMinimumWidth(LED_LABEL_WIDTH);

        FrameListWidget* framesListWidget = new FrameListWidget(this, axisData(*led), *this);//, count);
        QToolButton* closeButton = new QToolButton(this);
        closeButton->setObjectName(QString::fromUtf8("detailsClose"));
        closeButton->setIcon(QIcon(":/images/delete.png"));

        iGridLayout->addWidget(closeButton, count, 0);
        iGridLayout->addWidget(ledNumberLabel, count, 1);
        iGridLayout->addWidget(framesListWidget, count, 2);
       // iGridLayout->setColumnStretch(1, 1);
       // iGridLayout->addWidget(new QWidget(), count, 3);
       // iGridLayout->setColumnStretch(3, 2);

        iLedDetails.insert(led->number(), new LedDetails(*this,
                                                         *led,
                                                         *ledNumberLabel,
                                                         *framesListWidget,
                                                         *closeButton));

        iCloseAll->setEnabled(true);
        iScrollAreaWidgetContents->setShowCurrentFrameLine(true);

        doResize();
        layout()->invalidate();
    }
}
开发者ID:annesummers,项目名称:LedAnimator,代码行数:40,代码来源:AxisDetailsWidget.cpp


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