Adafruit Flora not looping properly

I'm brand new to Arduino so I'm sure I'm missing something obvious here:

I'm attempting to make the NeoPixel on my Flora pulse with a light that gradually fades in, then out. Right now I can make it pulse by inputting the code in the void loop section but when I try to get the same code to run by using function definitions, part of the code loops, but the NeoPixel itself stops responding (The rest of the code continues to loop but the light doesn't come on.)

This is the non-functioning code.

Also, Here is the code the only way I can get it to give me something close to a desired result but I know it's ugly and there must be a way to get it to run via function definitions.

(deleted)

Per request; here’s the nonfunctioning code

#include <Adafruit_NeoPixel.h>

#define PIN 6

Adafruit_NeoPixel pixelOne = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel onboard = Adafruit_NeoPixel(1, 8, NEO_GRB + NEO_KHZ800);

void setup() {
// put your setup code here, to run once:
pixelOne.begin();
pixelOne.setBrightness(100);
pixelOne.show(); // Initialize all pixels to ‘off’

onboard.begin();
onboard.setBrightness(100);
onboard.show(); // Initialize all pixels to ‘off’
Serial.begin(9600);
}

void loop() {

colorWipe(onboard, 255, 255, 255, 500); //white
colorWipe(pixelOne, 255, 0, 0, 500); //red
}

//function definitions

void colorWipe(Adafruit_NeoPixel colorStrip, uint8_t red, uint8_t green, uint8_t blue, uint16_t wait) {
for(uint16_t i=0; i<onboard.numPixels(); i++) {
for(uint8_t g=0; g<100; g++) {
onboard.setPixelColor(i, (redg)/100, (greeng)/100, (blue*g)/100);
onboard.show();
delay(500/100);
Serial.println(g);
}

for(uint8_t g=100; g>0; g–) {
onboard.setPixelColor(i, (redg)/100, (greeng)/100, (blue*g)/100);
onboard.show();
delay(500/100);
}
}
}

(MOD EDIT)

#include <Adafruit_NeoPixel.h>

#define PIN 6

Adafruit_NeoPixel pixelOne = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel onboard = Adafruit_NeoPixel(1, 8, NEO_GRB + NEO_KHZ800);

void setup() {
 // put your setup code here, to run once:
 pixelOne.begin();
 pixelOne.setBrightness(100);
 pixelOne.show(); // Initialize all pixels to 'off'

 onboard.begin();
 onboard.setBrightness(100);
 onboard.show(); // Initialize all pixels to 'off'
 Serial.begin(9600);
}

void loop() {

 colorWipe(onboard, 255, 255, 255, 500); //white
 colorWipe(pixelOne, 255, 0, 0, 500); //red
}

//function definitions

void colorWipe(Adafruit_NeoPixel colorStrip, uint8_t red, uint8_t green, uint8_t blue, uint16_t wait) {
 for(uint16_t i=0; i<onboard.numPixels(); i++) {
   for(uint8_t g=0; g<100; g++) {
     onboard.setPixelColor(i, (red*g)/100, (green*g)/100, (blue*g)/100);
     onboard.show();
     delay(500/100);
     Serial.println(g);
   }

    for(uint8_t g=100; g>0; g--) {
      onboard.setPixelColor(i, (red*g)/100, (green*g)/100, (blue*g)/100);
      onboard.show();
      delay(500/100);
     }
 }
}

You may want to READ THIS as it will help you get the best out of the forum.

There are often what are termed “STICKY” posts at the top of almost all forums and forum sections (not just Arduino) and anybody using them is expected to read those. You passed a few before you posted.

Had you used CODE TAGS ( </> ) people would be able to select and run it.
Some forums have a bad habit of chewing up code that is not posted correctly and this is one of those.

Most users on here will not touch some random link and with very good reasons.

Hope you understand.

Bob.