]> kolegite.com Git - vmks.git/commitdiff
MCP41010 datasheet
authorVladimir Garistov <vl.garistov@gmail.com>
Fri, 1 Apr 2022 07:08:32 +0000 (10:08 +0300)
committerVladimir Garistov <vl.garistov@gmail.com>
Fri, 1 Apr 2022 07:08:32 +0000 (10:08 +0300)
Datasheets/MCP41010.pdf [new file with mode: 0644]
Examples/Big_LED_strip/Big_LED_strip.ino

diff --git a/Datasheets/MCP41010.pdf b/Datasheets/MCP41010.pdf
new file mode 100644 (file)
index 0000000..a07231c
Binary files /dev/null and b/Datasheets/MCP41010.pdf differ
index d95d24bcfe5cea36fa46b9a86c044d2d7784b01a..afe4bf6595046c2b262654d48b3ded969f4ab949 100644 (file)
@@ -1,5 +1,7 @@
 #include <Adafruit_NeoPixel.h>
 #include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
 
 #define ROWS                           8
 #define COLS                           32
        we must do so directly without allocating a working buffer.
        Uncomment this to indicate that display_rgb_direct() must be used.
 */
-#define NEOPIXEL_ATE_MY_RAM
+//#define NEOPIXEL_ATE_MY_RAM
 
-#ifdef NEOPIXEL_ATE_MY_RAM
+//#ifdef NEOPIXEL_ATE_MY_RAM
 #define LED_PIN        12
-#else
-#define LED_PIN        PA2
-#endif
+//#else
+//#define LED_PIN      12
+//#endif
 
 int render_image(uint8_t buff[ROWS][COLS][3], const uint8_t image[]);
 int display_rgb(uint8_t buff[ROWS][COLS][3]);
-int display_rgb_direct(const uint8_t image[]);
+//int display_rgb_direct(const uint8_t image[]);
 
 static const uint8_t big_image_data[BIG_IMAGE_FILE_SIZE] =
 {
@@ -85,39 +87,43 @@ Adafruit_NeoPixel led_matrix(NUM_PIXELS, LED_PIN, NEO_GRB);
 
 void setup()
 {
-       pinMode(LED_PIN, OUTPUT);
+       //pinMode(LED_PIN, OUTPUT);
        led_matrix.begin();
+       //Serial.begin(9600);
 }
 
 void loop()
 {
-       #ifndef NEOPIXEL_ATE_MY_RAM
-       uint8_t frame_buffer[ROWS][COLS][3] = {{{0}}};
-
-       render_image(frame_buffer, big_image_data);
-       display_rgb(frame_buffer);
-       #else
-       display_rgb_direct(big_image_data);
-       #endif
+       volatile uint8_t takovata = 0;
+       //#ifndef NEOPIXEL_ATE_MY_RAM
+       //uint8_t frame_buffer[ROWS][COLS][3];
+
+       //Serial.println("TETS");
+       //render_image(frame_buffer, big_image_data);
+       //display_rgb(frame_buffer);
+       display_rgb((uint8_t (*)[32][3]) &takovata);
+       //#else
+       //display_rgb_direct(big_image_data);
+       //#endif
 
 }
 
 int render_image(uint8_t buff[ROWS][COLS][3], const uint8_t image[])
 {
-       size_t row_offset, col_offset;
+       //size_t row_offset, col_offset;
 
        if (buff == NULL || image == NULL)
                return -1;
 
        for (uint8_t row = 0; row < ROWS; row++)
        {
-               row_offset = row * COLS * 3;
+               //row_offset = row * COLS * 3;
                for (uint8_t col = 0; col < COLS; col++)
                {
-                       col_offset = col * 3;
+                       //col_offset = col * 3;
                        for (uint8_t i = 0; i < 3; i++)
                        {
-                               buff[row][col][i] = image[PPM_HEADER_LENGHT + row_offset + col_offset + i];
+                               buff[row][col][i] = image[PPM_HEADER_LENGHT + row * COLS * 3 + col * 3 + i];
                        }
                }
        }
@@ -154,7 +160,7 @@ int display_rgb(uint8_t buff[ROWS][COLS][3])
 
        return 0;
 }
-
+/*
 int display_rgb_direct(const uint8_t image[])
 {
        size_t row_offset, col_offset;
@@ -190,3 +196,4 @@ int display_rgb_direct(const uint8_t image[])
 
        return 0;
 }
+*/
\ No newline at end of file