本文整理汇总了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);
}
示例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));
}
示例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
}
示例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
示例5: setup
void setup() {
// put your setup code here, to run once:
strip.begin();
strip.show();
pinMode(switchPin, INPUT);
}
示例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
}
示例7: setup
void setup()
{
Serial.begin(115200);
strip.begin();
strip.setBrightness(40);
strip.show();
cmdMessenger.attach(kSetLED, OnSetLed);
}
示例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);
}
示例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);
}
示例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__));
}
示例11:
ColorWipeEffect::ColorWipeEffect(Section *sections, int sectionsStart, int sectionsEnd,int* globalSpeedFactor) :
BaseEffect(sections, sectionsStart, sectionsEnd, globalSpeedFactor) {
Section *sect = §ions[sectionsStart];
Adafruit_NeoPixel *strip = sect->strip;
strip->begin();
strip->show();
this->currentIndex = 0;
this->currentStep = 5;
}
示例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'
}
示例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);
}
示例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();
}
示例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
}