Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:iot-open:practical:hardware:sut:stm32:emb8_1 [2024/04/20 09:45] – [Steps] ktokarzen:iot-open:practical:hardware:sut:stm32:emb8_1 [2024/04/20 09:46] (current) – [Steps] ktokarz
Line 52: Line 52:
 The strip class definition contains the number of pixels, the pin for transmission, and the type of LEDs. In our laboratory LEDs use Green Red Blue format of data and 800kHz data transmission frequency. The strip class definition contains the number of pixels, the pin for transmission, and the type of LEDs. In our laboratory LEDs use Green Red Blue format of data and 800kHz data transmission frequency.
 === Step 3 === === Step 3 ===
-To switch a particular LED, use the function ''setPixelColor()''. It accepts parameters of different types.+To switch a particular LED, use the function ''setPixelColor();''. It accepts parameters of different types.
 <code c> <code c>
 void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b); void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b);
Line 60: Line 60:
 If you use the second version you give the LED number as the first parameter and a 32-bit version of the colour information. To convert three RGB bytes to 32-bit value you can use the function ''Color();'': If you use the second version you give the LED number as the first parameter and a 32-bit version of the colour information. To convert three RGB bytes to 32-bit value you can use the function ''Color();'':
 <code c> <code c>
-static uint32_t Color(uint8_t r, uint8_t g, uint8_t b)+static uint32_t Color(uint8_t r, uint8_t g, uint8_t b);
 </code> </code>
 <note tip>Note that the LED number is 0-based, so in the case of our laboratory equipment, valid indexes are 0...7.</note> <note tip>Note that the LED number is 0-based, so in the case of our laboratory equipment, valid indexes are 0...7.</note>
-The setPixelColor() sets the appropriate data in the internal buffer of the class object. Sending it to the LED stripe requires the usage of the ''show();'' function afterwards. +The ''setPixelColor();'' sets the appropriate data in the internal buffer of the class object. Sending it to the LED stripe requires the usage of the ''show();'' function afterwards.\\ 
-The different versions of the ''setPixelColor()'' function can look like in the following code:+The different versions of the ''setPixelColor();'' function can look like in the following code:
 <code c> <code c>
 strip.setPixelColor(0, strip.Color(10, 0, 0)); // Red strip.setPixelColor(0, strip.Color(10, 0, 0)); // Red
en/iot-open/practical/hardware/sut/stm32/emb8_1.1713606321.txt.gz · Last modified: 2024/04/20 09:45 by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0