Can't get setup or loop to work

I have a small project that I am working on for my Boss. It sends a string of “sitecode” and opens a door lock. However That part of the code runs with out the pixel code. When I add the pixels code into setup and loop ,I get no response from the pixel board. Running just the pixel code it works fine. My question is how do I add the pixel code into the lock code without setup or loop?
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
//Pixel Code ==
#include <Adafruit_NeoPixel.h>
#include <avr/power.h>
#define PIN 2
#define NUMPIXELS 12
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ400);
int delayval = 40; // delay for half a second
void setup() {
pixels.begin();
pixels.setBrightness(200);
pixels.show(); // This initializes the NeoPixel library.
}

void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++){
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,20,40)); // Moderately bright green color.

pixels.show(); // This sends the updated pixel color to the hardware
// pixels.setPixelColor(1, pixels.Color(12,14,90));
// pixels.setPixelColor(2, pixels.Color(8,150,10));
// pixels.setPixelColor(3, pixels.Color(42,34,80));
// pixels.setPixelColor(4, pixels.Color(2,44,5));
pixels.setPixelColor(1, pixels.Color(0,80,10));
//delay(delayval);
pixels.show();
pixels.clear();
delay(delayval); // Delay for a period of time (in milliseconds).

}
}
//-----------------------------------------------------------------------------------------

//-----------------------------------------------------------------------------------------
//Arduino Code ==

#define CONSERVATIVE

int ioPin = 3;
#define BUFSIZE 200
unsigned char buf[BUFSIZE];

#define pullLow() pinMode(ioPin, OUTPUT)
#define pullHigh() pinMode(ioPin, INPUT)

unsigned char dbits = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0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
}

void setup() {
}

bool open() {
pinMode(ioPin, OUTPUT);
digitalWrite(ioPin, LOW);
pinMode(ioPin, INPUT);
digitalWrite(ioPin, LOW);

for(int i = 0; i < sizeof(dbits); ++i) {
if(dbits == 0) {

  • pullLow();*

  • delayMicroseconds(16);*

  • pullHigh();*

  • delayMicroseconds(190);*

  • } else {*

  • pullLow();*

  • delayMicroseconds(16);*

  • pullHigh();*

  • delayMicroseconds(56);*

  • pullLow();*

  • delayMicroseconds(16);*

  • pullHigh();*

  • delayMicroseconds(112);*

  • }*

  • }*

  • pullLow();*

  • delayMicroseconds(16);*

  • pullHigh();*

  • bval = 0;*

  • attachInterrupt(1, wentLow, FALLING);*

  • unsigned int i = 0;*

  • while(digitalRead(ioPin) == HIGH && i++ < 32767) {}*

  • if(i == 32767)*

  • return false;*

  • delayMicroseconds(20);*

  • for(int i = 0; i < 164; ++i) {*
    _ buf = 0;_
    * pullLow();*
    * delayMicroseconds(8);*
    * pullHigh();*
    * bval = 0;*
    * delayMicroseconds(184);*
    _ buf = bval;
    * }*_

* for(int i = 0; i < 32+3; ++i)*
* bits[0][50+i] = buf[22+i];*

* for(int i = 0; i < 8; ++i)*
* bits[0][86+i] = bits[0][50+i] ^ bits[0][50+9+i] ^ bits[0][50+18+i] ^ bits[0][50+27+i];*
* bits[0][86] ^= 1;*
* bits[0][87] ^= 0;*
* bits[0][88] ^= 1;*
* bits[0][89] ^= 1;*
* bits[0][90] ^= 1;*
* bits[0][91] ^= 0;*
* bits[0][92] ^= 1;*
* bits[0][93] ^= 1;*

#ifdef CONSERVATIVE
* delay(100);*
#endif
* for(int j = 0; j < 11; ++j) {*
* for(int i = 0; i < sizeof(bits[j]); ++i) {*
_ if(bits[j] == 0) {
* pullLow();
delayMicroseconds(16);
pullHigh();
delayMicroseconds(190);
} else {
pullLow();
delayMicroseconds(16);
pullHigh();
delayMicroseconds(56);
pullLow();
delayMicroseconds(16);
pullHigh();
delayMicroseconds(112);
}
}
#ifdef CONSERVATIVE*

* delayMicroseconds(2700);
#else*

* delayMicroseconds(500);
#endif*

* }
return true;
}*_

void loop() {
* open();*
}

If possible you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then add it as an attachment.

I am curious. Why does a door lock need neopixels?

Good Question. Makes the device more user friendly and very attractive.

You can only have one setup() and one loop(). Merging two separate sketches MAY be as simple as changing the names in the two sketches and adding new setup() and loop() functions:

void setup() {
    setup1();
    setup2();
}

void loop() {
    loop1();
    loop2();
}

This assumes that the two sketches have no conflicts.