From: Vladimir Garistov Date: Fri, 1 Apr 2022 07:08:32 +0000 (+0300) Subject: MCP41010 datasheet X-Git-Url: https://kolegite.com/gitweb/?a=commitdiff_plain;h=237b7b541da643e5766ca9b877b6c3d6cb9bc6c8;p=vmks.git MCP41010 datasheet --- diff --git a/Datasheets/MCP41010.pdf b/Datasheets/MCP41010.pdf new file mode 100644 index 0000000..a07231c Binary files /dev/null and b/Datasheets/MCP41010.pdf differ diff --git a/Examples/Big_LED_strip/Big_LED_strip.ino b/Examples/Big_LED_strip/Big_LED_strip.ino index d95d24b..afe4bf6 100644 --- a/Examples/Big_LED_strip/Big_LED_strip.ino +++ b/Examples/Big_LED_strip/Big_LED_strip.ino @@ -1,5 +1,7 @@ #include #include +#include +#include #define ROWS 8 #define COLS 32 @@ -16,17 +18,17 @@ 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