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


C++ Adafruit_NeoPixel::begin方法代码示例

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


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

示例1: setup

void setup()
{
        pinMode(RL1, OUTPUT);
        pinMode(RL2, OUTPUT);
        pinMode(GL1, OUTPUT);
        pinMode(GL2, OUTPUT);
        pinMode(BL1, OUTPUT);
        pinMode(BL2, OUTPUT);
        pinMode(M1, OUTPUT);
        pinMode(M2, OUTPUT);
        digitalWrite(M1,HIGH);
        digitalWrite(M2, HIGH);
        analogWrite(E1, 0);
        analogWrite(E2, 0);
        //open bluetooth serial
        Serial1.begin(115200);
        Serial.begin(9600);
        Serial.println("Type AT commands!");

        /*       NEOPIXEL          */
  #if defined (__AVR_ATtiny85__)
        if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
  #endif
        pixels.begin();
        ears.begin();

        Wire.begin();


        delay(5);
        sixDOF.init(); //begin the IMU
        delay(5);
}
开发者ID:weareleka,项目名称:arduino-prototype-projects,代码行数:33,代码来源:remote-simplecode.cpp

示例2: setup

void setup() {
    pinMode(PIN_DIAGNOSTIC_LED, OUTPUT);

    Serial.begin(9600);

    debug(F("initializing LED Strip\n"));
    strip.begin();
    strip.setBrightness(0xff);

    strip.show();

    Color sunset(0x80, 0x20, 0x20),
            morning(0xa0, 0x5e, 0x50),
            noon(0xff, 0xff, 0xff),
            afternoon(0xa0, 0x5e, 0x50),
            night(0x10, 0x15, 0x20);

    // switch on at 6 (use an external timer for that)
    fade(Color::OFF, sunset, minutes_to_ms(45));

    fade(sunset, morning, minutes_to_ms(30));

    fade(morning, noon, minutes_to_ms(45 + 4 * 60));

    fade(noon, noon, minutes_to_ms(4 * 60));

    fade(noon, afternoon, minutes_to_ms(2 * 60));

    fade(afternoon, sunset, minutes_to_ms(45));

    fade(sunset, night, minutes_to_ms( 30));

    fade(night, Color::OFF, minutes_to_ms(30));

}
开发者ID:neuhalje,项目名称:arduino-aquarium-lights,代码行数:35,代码来源:main.cpp

示例3: setup

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }
  MCUSR = 0;  // for Reset : clear out any flags of prior resets.

/*
  if(!isDebug){//TODO Servo bug fix....
    // Initialize SD card.
    Serial.print(F("\nInitializing SD card..."));
    if (card.init(SPI_HALF_SPEED, chipSelectPin)) {
      //Serial.print(F("OK"));
    } else {
      //Serial.print(F("NG"));
      abort();
    }
    memset(buffer, 0, 0x200);
  }
  */


  //For Neopixel
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

  sv.attach(SERVO_PIN, 800, 2300);// For Servo

  pinMode(buttonPin, INPUT);// for BUtton
}
开发者ID:takustaqu,项目名称:bakkathon,代码行数:30,代码来源:arduino.cpp

示例4: Init_LearnBitsShield

// Shield initialize function:
void Init_LearnBitsShield(){
  // initialize serial ports:
  Serial.begin(57600); // Pc Communication
  Serial1.begin(57600); // Pi communication
  Serial2.begin(57600); // Bluetooth Communication

  // initialize motor driver
  pinMode(MOT_STBY, OUTPUT);
  pinMode(MOT_PWMA, OUTPUT);
  pinMode(MOT_AIN1, OUTPUT);
  pinMode(MOT_AIN2, OUTPUT);
  pinMode(MOT_PWMB, OUTPUT);
  pinMode(MOT_BIN1, OUTPUT);
  pinMode(MOT_BIN2, OUTPUT);
  digitalWrite(MOT_STBY, LOW);  //Set standby

  // initialize Neo pixels
  pixels.begin(); // initializes NeoPixel library.
  for(int ii=0;ii<NUMPIXELS;ii++){
    pixels.setPixelColor(ii, pixels.Color(0,0,0)); // Set pixel color. 
  }
  pixels.show(); // Updated pixel color Hardware.
  

}// end Init_LearnBitsShield
开发者ID:LearnBits,项目名称:Shield,代码行数:26,代码来源:LearnBitsShield.cpp

示例5: setup

void setup() {
  // put your setup code here, to run once:
  strip.begin();
  strip.show();
  pinMode(switchPin, INPUT);

}
开发者ID:ismailuddin,项目名称:arduino,代码行数:7,代码来源:neopixel.c

示例6: init

void init()
{

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

	Serial.print("NeoPixel demo .. start");


    // Wifi could be used eg. for switching Neopixel from internet
	// could be also dissabled if no needed

	WifiStation.config(WIFI_SSID, WIFI_PWD);
	WifiStation.enable(true);
	WifiAccessPoint.enable(false);
	WifiEvents.onStationDisconnect(connect_Fail);
	WifiEvents.onStationGotIP(got_IP);



	StripDemoType =0;  //demo index to be displayed

	strip.begin();  //init port

	StripDemoTimer.initializeMs(1000, StartDemo).start();  //start demo


}
开发者ID:blinkingnoise,项目名称:Sming,代码行数:28,代码来源:application.cpp

示例7: setup

void setup()
{
  Serial.begin(115200);
  strip.begin();
  strip.setBrightness(40);
  strip.show();
  cmdMessenger.attach(kSetLED, OnSetLed);
}
开发者ID:baillel,项目名称:rotonde-arduino-neopixel,代码行数:8,代码来源:main.cpp

示例8: setup

void setup() {
  pixels.begin(); 
  t = millis() + TOUT * 1000;
  CMD[0] = 'F';
  
  //Change to Serial1 if using micro
  Serial.begin(9600); 
  xbee.begin(Serial);
}
开发者ID:0x27,项目名称:redalert,代码行数:9,代码来源:lights.cpp

示例9: setup

void setup()
{
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

  //atm buttons
  for( int i=2; i<2+9; ++i)
    pinMode(i, INPUT_PULLUP);
  Serial.begin(BAUD);
}
开发者ID:MeowWolf,项目名称:BeamArcade,代码行数:10,代码来源:sketch.cpp

示例10: setup

 void setup () {
   strip_h.begin();
   strip_d.begin();
   strip_s.begin();
   strip_h.show();
   strip_d.show();
   strip_s.show();
   Serial.begin(57600);
   Wire.begin();
   RTC.begin();
   strip_h.setBrightness(100);
   strip_d.setBrightness(100);
   strip_s.setBrightness(100);
 
   // if (! RTC.isrunning()) {
   // Serial.println("RTC is NOT running!");
   // following line sets the RTC to the date & time this sketch was compiled
   //   RTC.adjust(DateTime(__DATE__, __TIME__));
 }
开发者ID:wwebb,项目名称:WordClock,代码行数:19,代码来源:wordclock+(buckeyeworldcitizen).c

示例11:

ColorWipeEffect::ColorWipeEffect(Section *sections, int sectionsStart, int sectionsEnd,int* globalSpeedFactor) : 
	BaseEffect(sections, sectionsStart, sectionsEnd, globalSpeedFactor) {
		Section *sect = &sections[sectionsStart];
		Adafruit_NeoPixel *strip = sect->strip;
	strip->begin();
	strip->show();

	this->currentIndex = 0;
	this->currentStep = 5;
}
开发者ID:rootux,项目名称:sabaled,代码行数:10,代码来源:ColorWipeEffect.cpp

示例12: setup

void setup() 
{

	Spark.function("setColor1", setColor1);
	Spark.function("setColor2", setColor2);
	Spark.function("setColor3", setColor3);
	Spark.function("setPattern", setPattern);


	strip.begin();
	strip.show(); // Initialize all pixels to 'off'
}
开发者ID:jrojas2016,项目名称:sound_portal,代码行数:12,代码来源:soundPortal.cpp

示例13: begin

void SparkButton::begin(){
    ring.begin();
    ring.show();
    
    accelerometer.begin();                   // Setup SPI protocol, issue device soft reset
    accelerometer.beginMeasure();            // Switch ADXL362 to measure mode  
    accelerometer.checkAllControlRegs();     // Burst Read all Control Registers, to check for proper setup
    
    pinMode(D1, INPUT_PULLUP);
    pinMode(D2, INPUT_PULLUP);
    pinMode(D3, INPUT_PULLUP);
    pinMode(D4, INPUT_PULLUP);
}
开发者ID:seanmitchellmcdonald,项目名称:SparkButton,代码行数:13,代码来源:SparkButton.cpp

示例14: setup

void setup()
{
// Arduino_h is only defined when compiling the sketch in the Arduino IDE.
#ifndef Arduino_h
    // Select line, circle or grid pixel layout for emulator.
    // pixels.setPixelLayout(Strip);
    pixels.setPixelLayout(Ring);
    // pixels.setPixelLayout(Grid);
#endif
    pixels.begin();
    // setBrightness() is intended for use only in setup() and not for animations. It's ignored by the emulator (see
    // the README).
    pixels.setBrightness(50);
    pixels.show();
}
开发者ID:thostr,项目名称:neopixelstuff,代码行数:15,代码来源:rgb_sketch.cpp

示例15: init

void init()
{

	Serial.begin(115200); // 115200 by default
	Serial.systemDebugOutput(false); // Disable debug output to serial

	Serial.print("NeoPixel demo .. start");

	StripDemoType =0;  //demo index to be displayed

	strip.begin();  //init port

	StripDemoTimer.initializeMs(1000, StartDemo).start();  //start demo


}
开发者ID:alonewolfx2,项目名称:Sming_RTOS_POC,代码行数:16,代码来源:application.cpp


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