Hello,
I am trying to get some help to learn how to program my led ring with gemma, it uses the adafruit neopixel library, and I dont quite understand it from the example codes given.
Is there a place where I can learn how to program this leds?
I have medium skills in programmin with c++ but it seem overwhelmin the use of variables like unit8_t and unit32, etc.
I dont understand a lot of the parts in that example codes.
If this post should be in another place, please redirect me.
Regards!
Learn programming Adafruit neopixel library
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 30
- Joined: Thu Sep 12, 2013 5:37 pm
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Learn programming Adafruit neopixel library
I've moved this over to General Project Help..
The best way to approach the issue is to ask specific questions one or two at a time. Case in point: you mentioned the uint8_t and uint32_t values.
Those are data types that correspond to specific numbers of bits and ranges of values: "uint8_t" means "unsigned integer 8 bits long". Types like "int" are too ambiguous (how many bits does it have? can it have positive and negative values? if so, are the negative values ones-complement or twos-complement? etc).
By the same token, "uint32_t" means "unsigned integer 32 bits long".
Those types are generally used as bit fields for data transmission. Most hardware communication protocols transfer information in 8-bit chunks, and we don't want to have to fight the language to get an 8-bit block of memory. The NeoPixels want 24 bits of information about the color and intensity of the light they're supposed to display, and we don't want to fight over that either. The explicit types give us an easy way to specify the exact block of memory we want.
The best way to approach the issue is to ask specific questions one or two at a time. Case in point: you mentioned the uint8_t and uint32_t values.
Those are data types that correspond to specific numbers of bits and ranges of values: "uint8_t" means "unsigned integer 8 bits long". Types like "int" are too ambiguous (how many bits does it have? can it have positive and negative values? if so, are the negative values ones-complement or twos-complement? etc).
By the same token, "uint32_t" means "unsigned integer 32 bits long".
Those types are generally used as bit fields for data transmission. Most hardware communication protocols transfer information in 8-bit chunks, and we don't want to have to fight the language to get an 8-bit block of memory. The NeoPixels want 24 bits of information about the color and intensity of the light they're supposed to display, and we don't want to fight over that either. The explicit types give us an easy way to specify the exact block of memory we want.
Please be positive and constructive with your questions and comments.