Re: Questions about writing code for Gemma

by Crystal on Mon Sep 30, 2013 7:44 pm

I'm still wondering if the problem has something to do with my code. I changed the pin numbers to correspond to the pads on my Flora, uploaded the sketch, and I still can't get the NeoPixel LED to change color.

On the Flora, I used pin 6 for the NeoPixel and connected the switch to pin 1 (TX) and to GND. The switch didn't work, so I took it off and then just had a single jumper connected to pin 1. I alternated between touching the opposite end of the jumper to GND and to 3.3v, but nothing happened then either. The LED just stayed white and didn't change to the color of the next pattern...
Crystal
 
Posts: 11
Joined: Mon Sep 30, 2013 1:51 pm

Re: Questions about writing code for Gemma RESOLVED!

by Crystal on Mon Sep 30, 2013 11:38 pm

The problem was part of my code after all!

This:
Code: Select all | TOGGLE FULL SIZE
    lightPattern == lightPattern + 1;

should be this:
Code: Select all | TOGGLE FULL SIZE
    lightPattern = lightPattern + 1;

(And to give credit where credit is due, I didn't discover my mistake in the code myself; a kind soul on the Arduino forums pointed it out to me.)

I've since successfully uploaded the code to both Gemma and Flora, and everything seems to be working fine now. Thank you both, Bill and Rick, for all your help!
Crystal
 
Posts: 11
Joined: Mon Sep 30, 2013 1:51 pm

Re: Questions about writing code for Gemma

by adafruit_support_bill on Tue Oct 01, 2013 4:30 am

Wow! I knew it had to be something simple, but I wasn't looking for that one.
The 'classic' mistake in C/C++ is just the opposite: Using '=' instead of '==' in a conditional statement.
User avatar
adafruit_support_bill
 
Posts: 28057
Joined: Sat Feb 07, 2009 9:11 am