From: vl_garistov Date: Tue, 17 Nov 2020 22:40:30 +0000 (+0200) Subject: when will I learn to use git FFS X-Git-Url: https://kolegite.com/gitweb/?a=commitdiff_plain;h=4f7061e52eaa0c33693f123db31a7e29d12900c5;p=vmks.git when will I learn to use git FFS --- diff --git a/3x3-LED_BTN-Matrix-Transpose/3x3-LED_BTN-Matrix-Transpose-Schematic.png b/3x3-LED_BTN-Matrix-Transpose/3x3-LED_BTN-Matrix-Transpose-Schematic.png deleted file mode 100644 index 472ae2b..0000000 Binary files a/3x3-LED_BTN-Matrix-Transpose/3x3-LED_BTN-Matrix-Transpose-Schematic.png and /dev/null differ diff --git a/3x3-LED_BTN-Matrix-Transpose/3x3-LED_BTN-Matrix-Transpose.ino b/3x3-LED_BTN-Matrix-Transpose/3x3-LED_BTN-Matrix-Transpose.ino deleted file mode 100644 index e265976..0000000 --- a/3x3-LED_BTN-Matrix-Transpose/3x3-LED_BTN-Matrix-Transpose.ino +++ /dev/null @@ -1,85 +0,0 @@ -#define LED_ROW1 11 // Active HIGH | Inactive LOW -#define LED_ROW2 10 // Active HIGH | Inactive LOW -#define LED_ROW3 9 // Active HIGH | Inactive LOW -#define LED_COL1 8 // Active LOW | Inactive HIGH -#define LED_COL2 7 // Active LOW | Inactive HIGH -#define LED_COL3 6 // Active LOW | Inactive HIGH - -#define BTN_ROW1 A3 // Active OUTPUT-LOW | Inactive INPUT - PULLUP -#define BTN_ROW2 A4 // Active OUTPUT-LOW | Inactive INPUT - PULLUP -#define BTN_ROW3 A5 // Active OUTPUT-LOW | Inactive INPUT - PULLUP -#define BTN_COL1 A0 // Active OUTPUT-LOW | Inactive INPUT - PULLUP -#define BTN_COL2 A1 // Active OUTPUT-LOW | Inactive INPUT - PULLUP -#define BTN_COL3 A2 // Active OUTPUT-LOW | Inactive INPUT - PULLUP - -const uint8_t led_col[3] = {LED_COL1, LED_COL2, LED_COL3}; -const uint8_t led_row[3] = {LED_ROW1, LED_ROW2, LED_ROW3}; - -const uint8_t btn_col[3] = {BTN_COL1, BTN_COL2, BTN_COL3}; -const uint8_t btn_row[3] = {BTN_ROW1, BTN_ROW2, BTN_ROW3}; - -uint8_t state_1[3][3] = -{ - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -void setup() -{ - int i = 0; - - for (i = 0; i < 3; i++) - { - pinMode(led_row[i], OUTPUT); - digitalWrite(led_row[i], LOW); - pinMode(led_col[i], OUTPUT); - digitalWrite(led_col[i], HIGH); - - pinMode(btn_row[i], INPUT_PULLUP); - pinMode(btn_col[i], INPUT_PULLUP); - } -} - -void loop() -{ - // Button scan - for (byte col = 0; col < 3; col++) - { - pinMode(btn_col[col], OUTPUT); - digitalWrite(btn_col[col], LOW); - for (byte row = 0; row < 3; row++) - { - state_1[row][col] = !digitalRead(btn_row[row]); - } - pinMode(btn_col[col], INPUT_PULLUP); - } - - // Transpose - for (int i = 0; i < 3; i++) - { - for (int j = i + 1; j < 3; j++) - { - int temp; - temp = state_1[i][j]; - state_1[i][j] = state_1[j][i]; - state_1[j][i] = temp; - } - } - - // LED update - for (byte col = 0; col < 3; col++) - { - for (byte row = 0; row < 3; row++) - { - digitalWrite(led_row[row], state_1[row][col]); - } - digitalWrite(led_col[col], LOW); - delay(5); - digitalWrite(led_col[col], HIGH); - for (byte row = 0; row < 3; row++) - { - digitalWrite(led_row[row], LOW); - } - } -} diff --git a/Analog_Serial_Send_-_LDR/Analog_Serial_Send_-_LDR-Schematic.png b/Analog_Serial_Send_-_LDR/Analog_Serial_Send_-_LDR-Schematic.png deleted file mode 100644 index 49d7cc0..0000000 Binary files a/Analog_Serial_Send_-_LDR/Analog_Serial_Send_-_LDR-Schematic.png and /dev/null differ diff --git a/Analog_Serial_Send_-_LDR/Analog_Serial_Send_-_LDR.ino b/Analog_Serial_Send_-_LDR/Analog_Serial_Send_-_LDR.ino deleted file mode 100644 index 6cb7a7b..0000000 --- a/Analog_Serial_Send_-_LDR/Analog_Serial_Send_-_LDR.ino +++ /dev/null @@ -1,16 +0,0 @@ -#define LDR A0 - -uint16_t value = 0; - -void setup() -{ - pinMode(A0, INPUT); - Serial.begin(9600); -} - -void loop() -{ - value = analogRead(LDR); - Serial.println(value); - delay(100); -} diff --git a/Blink_LED_Low_Level/Blink_LED_Low_Level.ino b/Blink_LED_Low_Level/Blink_LED_Low_Level.ino deleted file mode 100644 index 96ba026..0000000 --- a/Blink_LED_Low_Level/Blink_LED_Low_Level.ino +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - // put your setup code here, to run once: - DDRB |= (1 << PB5); -} - -void loop() { - // put your main code here, to run repeatedly: - PORTB |= (1 << PB5); - _delay_ms(500); - PORTB &= ~(1 << PB5); - _delay_ms(500); -} diff --git a/Car_dodge/Car_dodge.ino b/Car_dodge/Car_dodge.ino deleted file mode 100644 index 6925a5e..0000000 --- a/Car_dodge/Car_dodge.ino +++ /dev/null @@ -1,189 +0,0 @@ -#include - -#define NUM_PIXELS 6 -#define MIN_DELAY 30 - -#define TOP_ROW 2 -#define MID_ROW 3 -#define BOT_ROW 4 -#define UP_BUTTON 6 -#define DOWN_BUTTON 5 -#define NOISE A0 - -#define PLAYER 1 -#define CAR 2 -#define EMPTY 0 -#define CRASH 3 - -Adafruit_NeoPixel top_row(NUM_PIXELS, TOP_ROW, NEO_GRB); -Adafruit_NeoPixel mid_row(NUM_PIXELS, MID_ROW, NEO_GRB); -Adafruit_NeoPixel bot_row(NUM_PIXELS, BOT_ROW, NEO_GRB); - -// Video RAM - every element corresponds to one pixel -int vram[3][NUM_PIXELS] = {{0}}; // 2 - TOP, 1 - MID, 0 - BOT -int player_pos = 1; -int next_car_in = 1; -int delay_time = 500; -int crashed = 0; - -void setup() -{ - pinMode(TOP_ROW, OUTPUT); - pinMode(MID_ROW, OUTPUT); - pinMode(BOT_ROW, OUTPUT); - pinMode(UP_BUTTON, INPUT); - pinMode(DOWN_BUTTON, INPUT); - pinMode(NOISE, INPUT); - - // LED strip initialization - top_row.begin(); - mid_row.begin(); - bot_row.begin(); - - // set the seed for the random number generator - int seed = analogRead(NOISE) * 42; - randomSeed(seed); - - Serial.begin(9600); -} - -void loop() -{ - int i; - int new_car; - - // update player position - if (digitalRead(UP_BUTTON) == HIGH) - { - player_pos++; - } - else if (digitalRead(DOWN_BUTTON) == HIGH) - { - player_pos--; - } - if (player_pos > 2) - { - player_pos = 2; - } - else if (player_pos < 0) - { - player_pos = 0; - } - - // draw the player - for (i = 0; i < 3; i++) - { - if (player_pos == i) - { - // detect collision - if (vram[i][1] == CAR) - { - vram[i][0] = CRASH; - crashed = 1; - } - else - { - vram[i][0] = PLAYER; - } - } - else - { - vram[i][0] = vram[i][1]; - } - } - - // move everything one pixel to the left - for (i = 1; i < (NUM_PIXELS - 1); i++) - { - vram[0][i] = vram[0][i + 1]; - vram[1][i] = vram[1][i + 1]; - vram[2][i] = vram[2][i + 1]; - } - - // generate next car - for (i = 0; i < 3; i++) - { - vram[i][NUM_PIXELS - 1] = EMPTY; - } - next_car_in--; - if (next_car_in == 0) - { - new_car = random(3); - vram[new_car][NUM_PIXELS - 1] = CAR; - next_car_in = 3; - } - - // render the image - for (i = 0; i < NUM_PIXELS; i++) - { - if (vram[0][i] == EMPTY) - { - bot_row.setPixelColor(i, bot_row.Color(0, 0, 0)); - } - else if (vram[0][i] == CAR) - { - bot_row.setPixelColor(i, bot_row.Color(0, 0, 255)); - } - else if (vram[0][i] == PLAYER) - { - bot_row.setPixelColor(i, bot_row.Color(0, 255, 0)); - } - else if (vram[0][i] == CRASH) - { - bot_row.setPixelColor(i, bot_row.Color(255, 0, 0)); - } - - if (vram[1][i] == EMPTY) - { - mid_row.setPixelColor(i, mid_row.Color(0, 0, 0)); - } - else if (vram[1][i] == CAR) - { - mid_row.setPixelColor(i, mid_row.Color(0, 0, 255)); - } - else if (vram[1][i] == PLAYER) - { - mid_row.setPixelColor(i, mid_row.Color(0, 255, 0)); - } - else if (vram[1][i] == CRASH) - { - mid_row.setPixelColor(i, mid_row.Color(255, 0, 0)); - } - - if (vram[2][i] == EMPTY) - { - top_row.setPixelColor(i, top_row.Color(0, 0, 0)); - } - else if (vram[2][i] == CAR) - { - top_row.setPixelColor(i, top_row.Color(0, 0, 255)); - } - else if (vram[2][i] == PLAYER) - { - top_row.setPixelColor(i, top_row.Color(0, 255, 0)); - } - else if (vram[2][i] == CRASH) - { - top_row.setPixelColor(i, top_row.Color(255, 0, 0)); - } - } - top_row.show(); - mid_row.show(); - bot_row.show(); - Serial.println(delay_time); - // stop the game if crashed - if (crashed) - { - while (1); - } - // delay before the next frame - else - { - delay(delay_time); - } - // slowly make the game faster - if (delay_time > MIN_DELAY) - { - delay_time--; - } -} diff --git a/Car_dodge/Car_dodge.png b/Car_dodge/Car_dodge.png deleted file mode 100644 index dbbbc07..0000000 Binary files a/Car_dodge/Car_dodge.png and /dev/null differ diff --git a/Digital_Blink_with_Button/Digital_Blink_with_Button-Schematic.png b/Digital_Blink_with_Button/Digital_Blink_with_Button-Schematic.png deleted file mode 100644 index e15310c..0000000 Binary files a/Digital_Blink_with_Button/Digital_Blink_with_Button-Schematic.png and /dev/null differ diff --git a/Digital_Blink_with_Button/Digital_Blink_with_Button.ino b/Digital_Blink_with_Button/Digital_Blink_with_Button.ino deleted file mode 100644 index e5ef2d4..0000000 --- a/Digital_Blink_with_Button/Digital_Blink_with_Button.ino +++ /dev/null @@ -1,32 +0,0 @@ -#define BTN 2 -#define LED 5 - -byte stateON = false; -uint8_t count = 0; - -void setup() -{ - pinMode(BTN, INPUT); - pinMode(LED, OUTPUT); -} - -void loop() -{ - if(digitalRead(BTN) == 0) - { - stateON = true; - } - - if(stateON == true) - { - digitalWrite(LED, HIGH); - delay(500); - digitalWrite(LED, LOW); - delay(500); - count++; - if(count >= 5) - { - stateON = false; - } - } -} diff --git a/Examples/Pinouts/ATmega328-Pinout-1.jpeg b/Examples/Pinouts/ATmega328-Pinout-1.jpeg deleted file mode 100644 index 5f8cf04..0000000 Binary files a/Examples/Pinouts/ATmega328-Pinout-1.jpeg and /dev/null differ diff --git a/Examples/Pinouts/ATmega328-Pinout-2.png b/Examples/Pinouts/ATmega328-Pinout-2.png deleted file mode 100644 index f418f85..0000000 Binary files a/Examples/Pinouts/ATmega328-Pinout-2.png and /dev/null differ diff --git a/Examples/Pinouts/Arduino-Uno-Pin-Diagram-2.png b/Examples/Pinouts/Arduino-Uno-Pin-Diagram-2.png deleted file mode 100644 index ee86ee9..0000000 Binary files a/Examples/Pinouts/Arduino-Uno-Pin-Diagram-2.png and /dev/null differ diff --git a/Examples/Pinouts/Arduino-Uno-Pin-Diagram-3.png b/Examples/Pinouts/Arduino-Uno-Pin-Diagram-3.png deleted file mode 100644 index 670933f..0000000 Binary files a/Examples/Pinouts/Arduino-Uno-Pin-Diagram-3.png and /dev/null differ diff --git a/Examples/Pinouts/Arduino-Uno-Pin-Diagram-4.png b/Examples/Pinouts/Arduino-Uno-Pin-Diagram-4.png deleted file mode 100644 index cd5fede..0000000 Binary files a/Examples/Pinouts/Arduino-Uno-Pin-Diagram-4.png and /dev/null differ diff --git a/Examples/Pinouts/Arduino-Uno-Pin-Diagram.png b/Examples/Pinouts/Arduino-Uno-Pin-Diagram.png deleted file mode 100644 index 74e2241..0000000 Binary files a/Examples/Pinouts/Arduino-Uno-Pin-Diagram.png and /dev/null differ diff --git a/Examples/Pinouts/Arduino-Uno-Pinout-Digital-Pins.jpg b/Examples/Pinouts/Arduino-Uno-Pinout-Digital-Pins.jpg deleted file mode 100644 index 132303a..0000000 Binary files a/Examples/Pinouts/Arduino-Uno-Pinout-Digital-Pins.jpg and /dev/null differ diff --git a/LED_Strip_Moving_LED_-_Interrupt/LED Strip Moving LED - Interrupt Tinkercad.png b/LED_Strip_Moving_LED_-_Interrupt/LED Strip Moving LED - Interrupt Tinkercad.png deleted file mode 100644 index 1284fcc..0000000 Binary files a/LED_Strip_Moving_LED_-_Interrupt/LED Strip Moving LED - Interrupt Tinkercad.png and /dev/null differ diff --git a/LED_Strip_Moving_LED_-_Interrupt/LED_Strip_Moving_LED_-_Interrupt.ino b/LED_Strip_Moving_LED_-_Interrupt/LED_Strip_Moving_LED_-_Interrupt.ino deleted file mode 100644 index 5fdcdb9..0000000 --- a/LED_Strip_Moving_LED_-_Interrupt/LED_Strip_Moving_LED_-_Interrupt.ino +++ /dev/null @@ -1,45 +0,0 @@ -#include -#define NUM_PIXELS 10 -#define PIN 5 -Adafruit_NeoPixel strip(NUM_PIXELS, PIN, NEO_GRB); - -#define BTN_LEFT 3 -#define BTN_RIGHT 2 - -volatile uint8_t position = 0; - -void L_button_pressed_ISR(); -void R_button_pressed_ISR(); - -void setup() { - pinMode(BTN_LEFT, INPUT_PULLUP); - pinMode(BTN_RIGHT, INPUT_PULLUP); - attachInterrupt(digitalPinToInterrupt(BTN_LEFT), L_button_pressed_ISR, FALLING); - attachInterrupt(digitalPinToInterrupt(BTN_RIGHT), R_button_pressed_ISR, RISING); - - pinMode(PIN, OUTPUT); - strip.begin(); -} - -void L_button_pressed_ISR() { - if (position > 0) position--; -} - -void R_button_pressed_ISR() { - if (position < (NUM_PIXELS - 1)) position++; -} - -void loop() { - for (int i = 0 ; i < NUM_PIXELS; i++) - { - if (i == position) - { - strip.setPixelColor(i, strip.Color(255, 0, 0)); - } - else - { - strip.setPixelColor(i, strip.Color(0, 0, 255)); - } - } - strip.show(); -} diff --git a/LED_Strip_Moving_LED_-_Polling/LED Strip Moving LED - Polling Tinkercad.png b/LED_Strip_Moving_LED_-_Polling/LED Strip Moving LED - Polling Tinkercad.png deleted file mode 100644 index 70f3c24..0000000 Binary files a/LED_Strip_Moving_LED_-_Polling/LED Strip Moving LED - Polling Tinkercad.png and /dev/null differ diff --git a/LED_Strip_Moving_LED_-_Polling/LED_Strip_Moving_LED_-_Polling.ino b/LED_Strip_Moving_LED_-_Polling/LED_Strip_Moving_LED_-_Polling.ino deleted file mode 100644 index 6b452fd..0000000 --- a/LED_Strip_Moving_LED_-_Polling/LED_Strip_Moving_LED_-_Polling.ino +++ /dev/null @@ -1,42 +0,0 @@ -#include -#define NUM_PIXELS 10 -#define PIN 5 -Adafruit_NeoPixel strip(NUM_PIXELS, PIN, NEO_GRB); - -#define BTN_LEFT 3 -#define BTN_RIGHT 2 - -uint8_t position = 0; - -void setup() { - pinMode(BTN_LEFT, INPUT_PULLUP); - pinMode(BTN_RIGHT, INPUT_PULLUP); - - pinMode(PIN, OUTPUT); - strip.begin(); -} - -void loop() { - if (digitalRead(BTN_LEFT) == LOW) - { - if (position > 0) position--; - } - if (digitalRead(BTN_RIGHT) == LOW) - { - if (position < (NUM_PIXELS - 1)) position++; - } - delay(50); - - for (int i = 0 ; i < NUM_PIXELS; i++) - { - if (i == position) - { - strip.setPixelColor(i, strip.Color(255, 0, 0)); - } - else - { - strip.setPixelColor(i, strip.Color(0, 0, 255)); - } - } - strip.show(); -} diff --git a/TUES-LED_strip_1/TUES-LED_strip_1.ino b/TUES-LED_strip_1/TUES-LED_strip_1.ino deleted file mode 100644 index 2426e6a..0000000 --- a/TUES-LED_strip_1/TUES-LED_strip_1.ino +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include - -#define NUM_PIXELS 16 - -#define TOP_ROW 4 -#define MID_ROW 3 -#define BOT_ROW 2 - -#define PPM_HEADER_LENGHT 58 -#define IMAGE_FILE_LENGHT 202 - -/* -typedef enum {RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN} simple_color_t; -int display_enum(simple_color_t buff[]); -*/ - -int render_image(uint8_t buff[3][NUM_PIXELS][3], const uint8_t image[]); -int display_rgb(uint8_t buff[3][NUM_PIXELS][3]); - -const uint8_t image_data_0[IMAGE_FILE_LENGHT] = -{ - 0x50, 0x36, 0x0a, 0x23, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, - 0x47, 0x49, 0x4d, 0x50, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2e, 0x31, - 0x30, 0x2e, 0x32, 0x32, 0x20, 0x50, 0x4e, 0x4d, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x2d, 0x69, 0x6e, - 0x0a, 0x31, 0x36, 0x20, 0x33, 0x0a, 0x32, 0x35, 0x35, 0x0a, 0xb9, 0x78, 0x90, 0xbc, 0x7b, 0x93, - 0xbe, 0x7e, 0x98, 0xbe, 0x7e, 0x98, 0xbc, 0x7d, 0x98, 0xba, 0x7b, 0x96, 0xb8, 0x79, 0x96, 0xb4, - 0x75, 0x92, 0xb1, 0x72, 0x8f, 0xaf, 0x70, 0x8d, 0xab, 0x6c, 0x89, 0xa7, 0x68, 0x85, 0xa2, 0x61, - 0x7f, 0x9c, 0x5b, 0x79, 0x9a, 0x57, 0x76, 0x9b, 0x56, 0x75, 0xb8, 0x77, 0x8f, 0xbb, 0x7a, 0x92, - 0xbc, 0x7c, 0x96, 0xbc, 0x7c, 0x96, 0xbb, 0x7b, 0x96, 0xb9, 0x79, 0x94, 0xb5, 0x76, 0x91, 0xb2, - 0x73, 0x8e, 0xae, 0x6f, 0x8c, 0xac, 0x6d, 0x8a, 0xa4, 0x65, 0x82, 0xa0, 0x61, 0x7e, 0x9b, 0x5a, - 0x78, 0x96, 0x55, 0x73, 0x94, 0x51, 0x70, 0x97, 0x52, 0x71, 0xb9, 0x75, 0x8c, 0xba, 0x79, 0x91, - 0xbd, 0x7c, 0x94, 0xbb, 0x7b, 0x95, 0xba, 0x7a, 0x95, 0xb8, 0x78, 0x93, 0xb5, 0x75, 0x90, 0xb0, - 0x71, 0x8c, 0xad, 0x6e, 0x8b, 0xaa, 0x6b, 0x88, 0xa3, 0x64, 0x81, 0xa0, 0x5f, 0x7d, 0x9b, 0x5a, - 0x78, 0x97, 0x54, 0x73, 0x95, 0x52, 0x71, 0x99, 0x53, 0x75 -}; - -const uint8_t image_data_1[IMAGE_FILE_LENGHT] = -{ - 0x50, 0x36, 0x0a, 0x23, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, - 0x47, 0x49, 0x4d, 0x50, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2e, 0x31, - 0x30, 0x2e, 0x32, 0x32, 0x20, 0x50, 0x4e, 0x4d, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x2d, 0x69, 0x6e, - 0x0a, 0x31, 0x36, 0x20, 0x33, 0x0a, 0x32, 0x35, 0x35, 0x0a, 0xb9, 0xa9, 0xd6, 0xb8, 0xa7, 0xd4, - 0xba, 0xaa, 0xd7, 0xbd, 0xac, 0xd9, 0xbc, 0xab, 0xd8, 0xbc, 0xab, 0xd7, 0xba, 0xa9, 0xd5, 0xb5, - 0xa4, 0xd0, 0xaf, 0x9e, 0xca, 0x98, 0x89, 0xb2, 0x8d, 0x7e, 0xa5, 0x7c, 0x6d, 0x94, 0x70, 0x62, - 0x86, 0x6b, 0x5d, 0x80, 0x6c, 0x5e, 0x81, 0x6e, 0x60, 0x81, 0xb9, 0xac, 0xd8, 0xc2, 0xb2, 0xdf, - 0xbe, 0xb1, 0xdd, 0xbd, 0xad, 0xda, 0xbb, 0xae, 0xda, 0xba, 0xad, 0xd9, 0xb7, 0xaa, 0xd6, 0xb2, - 0xa5, 0xd1, 0xae, 0xa1, 0xcc, 0x9d, 0x8e, 0xb7, 0x8f, 0x80, 0xa7, 0x80, 0x72, 0x96, 0x77, 0x69, - 0x8d, 0x72, 0x64, 0x87, 0x6e, 0x60, 0x83, 0x6c, 0x5e, 0x7f, 0xbe, 0xb1, 0xdd, 0xc4, 0xb7, 0xe3, - 0xc2, 0xb5, 0xe1, 0xc1, 0xb4, 0xe0, 0xc0, 0xb3, 0xdf, 0xbe, 0xb3, 0xde, 0xbb, 0xb0, 0xdb, 0xb7, - 0xac, 0xd7, 0xb3, 0xa8, 0xd2, 0xa0, 0x91, 0xba, 0x93, 0x84, 0xab, 0x83, 0x75, 0x99, 0x78, 0x6a, - 0x8e, 0x72, 0x64, 0x87, 0x6d, 0x5f, 0x82, 0x6b, 0x5d, 0x7e -}; - -const uint8_t image_data_2[] = -{ - 0x50, 0x36, 0x0a, 0x23, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, - 0x47, 0x49, 0x4d, 0x50, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2e, 0x31, - 0x30, 0x2e, 0x32, 0x32, 0x20, 0x50, 0x4e, 0x4d, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x2d, 0x69, 0x6e, - 0x0a, 0x31, 0x36, 0x20, 0x33, 0x0a, 0x32, 0x35, 0x35, 0x0a, 0x1a, 0x0a, 0xfe, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1a, 0x0a, 0xfe, 0x1a, 0x0a, 0xfe, 0x1a, 0x0a, 0xfe, 0x00, 0x00, 0x00, 0x1a, - 0x0a, 0xfe, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x1f, 0xee, 0x1d, 0x00, 0x00, - 0x00, 0x1f, 0xee, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x0a, 0xfe, 0x04, 0x04, 0x04, - 0x00, 0x00, 0x00, 0x1a, 0x0a, 0xfe, 0x00, 0x00, 0x00, 0x1a, 0x0a, 0xfe, 0x00, 0x00, 0x00, 0x1a, - 0x0a, 0xfe, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0xdd, 0xfa, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xdd, 0xfa, 0x03, 0x00, 0x00, 0x00, 0x1a, 0x0a, 0xfe, 0x1a, 0x0a, 0xfe, - 0x00, 0x00, 0x00, 0x1a, 0x0a, 0xfe, 0x1a, 0x0a, 0xfe, 0x1a, 0x0a, 0xfe, 0x00, 0x00, 0x00, 0x1a, - 0x0a, 0xfe, 0x1a, 0x0a, 0xfe, 0x00, 0x00, 0x00, 0xdd, 0xfa, 0x03, 0xdd, 0xfa, 0x03, 0xdd, 0xfa, - 0x03, 0xdd, 0xfa, 0x03, 0xdd, 0xfa, 0x03, 0x00, 0x00, 0x00 -}; - -Adafruit_NeoPixel top_row(NUM_PIXELS, TOP_ROW, NEO_GRB); -Adafruit_NeoPixel mid_row(NUM_PIXELS, MID_ROW, NEO_GRB); -Adafruit_NeoPixel bot_row(NUM_PIXELS, BOT_ROW, NEO_GRB); - -void setup() -{ - pinMode(TOP_ROW, OUTPUT); - pinMode(MID_ROW, OUTPUT); - pinMode(BOT_ROW, OUTPUT); - - // LED strip initialization - top_row.begin(); - mid_row.begin(); - bot_row.begin(); -} - -void loop() -{ - uint8_t frame_buffer[3][NUM_PIXELS][3] = {{{0}}}; - - render_image(frame_buffer, image_data_2); - display_rgb(frame_buffer); -} - -int render_image(uint8_t buff[3][NUM_PIXELS][3], const uint8_t image[]) -{ - if (buff == NULL || image == NULL) - return -1; - - for (uint8_t row = 0; row < 3; row++) - { - for (uint8_t col = 0; col < NUM_PIXELS; col++) - { - for (uint8_t i = 0; i < 3; i++) - { - buff[row][col][i] = image[PPM_HEADER_LENGHT + row * NUM_PIXELS * 3 + col * 3 + i]; - } - } - } - - return 0; -} - -int display_rgb(uint8_t buff[3][NUM_PIXELS][3]) -{ - if (buff == NULL) - return -1; - - for (uint8_t col; col < NUM_PIXELS; col++) - { - top_row.setPixelColor(col, top_row.Color(buff[0][col][0], buff[0][col][1], buff[0][col][2])); - mid_row.setPixelColor(col, mid_row.Color(buff[1][col][0], buff[1][col][1], buff[1][col][2])); - bot_row.setPixelColor(col, bot_row.Color(buff[2][col][0], buff[2][col][1], buff[2][col][2])); - } - - top_row.show(); - mid_row.show(); - bot_row.show(); - - return 0; -} diff --git a/TUES-LED_strip_1/TUES-LED_strip_1.png b/TUES-LED_strip_1/TUES-LED_strip_1.png deleted file mode 100644 index fd314f7..0000000 Binary files a/TUES-LED_strip_1/TUES-LED_strip_1.png and /dev/null differ diff --git a/TUES-LED_strip_1/WS2812B.pdf b/TUES-LED_strip_1/WS2812B.pdf deleted file mode 100644 index 4925af6..0000000 Binary files a/TUES-LED_strip_1/WS2812B.pdf and /dev/null differ diff --git a/TUES-LED_strip_1/mona_lisa.ppm b/TUES-LED_strip_1/mona_lisa.ppm deleted file mode 100644 index 2be5d2a..0000000 Binary files a/TUES-LED_strip_1/mona_lisa.ppm and /dev/null differ diff --git a/TUES-LED_strip_1/nozdra.ppm b/TUES-LED_strip_1/nozdra.ppm deleted file mode 100644 index dbbd1b3..0000000 --- a/TUES-LED_strip_1/nozdra.ppm +++ /dev/null @@ -1,5 +0,0 @@ -P6 -# Created by GIMP version 2.10.22 PNM plug-in -16 3 -255 -¹x¼{“¾~˜¾~˜¼}˜º{–¸y–´u’±r¯p«l‰§h…¢aœ[yšWv›Vu¸w»z’¼|–¼|–»{–¹y”µv‘²sŽ®oŒ¬mŠ¤e‚ a~›Zx–Us”Qp—Rq¹uŒºy‘½|”»{•ºz•¸x“µu°qŒ­n‹ªkˆ£d _}›Zx—Ts•Rq™Su \ No newline at end of file diff --git a/TUES-LED_strip_1/rick_astley.jpg b/TUES-LED_strip_1/rick_astley.jpg deleted file mode 100644 index fd8e530..0000000 Binary files a/TUES-LED_strip_1/rick_astley.jpg and /dev/null differ diff --git a/TUES-LED_strip_1/sako.ppm.txt b/TUES-LED_strip_1/sako.ppm.txt deleted file mode 100644 index c3967d2..0000000 --- a/TUES-LED_strip_1/sako.ppm.txt +++ /dev/null @@ -1,13 +0,0 @@ -0x50, 0x36, 0x0a, 0x23, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, -0x47, 0x49, 0x4d, 0x50, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2e, 0x31, -0x30, 0x2e, 0x32, 0x32, 0x20, 0x50, 0x4e, 0x4d, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x2d, 0x69, 0x6e, -0x0a, 0x31, 0x36, 0x20, 0x33, 0x0a, 0x32, 0x35, 0x35, 0x0a, 0xb9, 0xa9, 0xd6, 0xb8, 0xa7, 0xd4, -0xba, 0xaa, 0xd7, 0xbd, 0xac, 0xd9, 0xbc, 0xab, 0xd8, 0xbc, 0xab, 0xd7, 0xba, 0xa9, 0xd5, 0xb5, -0xa4, 0xd0, 0xaf, 0x9e, 0xca, 0x98, 0x89, 0xb2, 0x8d, 0x7e, 0xa5, 0x7c, 0x6d, 0x94, 0x70, 0x62, -0x86, 0x6b, 0x5d, 0x80, 0x6c, 0x5e, 0x81, 0x6e, 0x60, 0x81, 0xb9, 0xac, 0xd8, 0xc2, 0xb2, 0xdf, -0xbe, 0xb1, 0xdd, 0xbd, 0xad, 0xda, 0xbb, 0xae, 0xda, 0xba, 0xad, 0xd9, 0xb7, 0xaa, 0xd6, 0xb2, -0xa5, 0xd1, 0xae, 0xa1, 0xcc, 0x9d, 0x8e, 0xb7, 0x8f, 0x80, 0xa7, 0x80, 0x72, 0x96, 0x77, 0x69, -0x8d, 0x72, 0x64, 0x87, 0x6e, 0x60, 0x83, 0x6c, 0x5e, 0x7f, 0xbe, 0xb1, 0xdd, 0xc4, 0xb7, 0xe3, -0xc2, 0xb5, 0xe1, 0xc1, 0xb4, 0xe0, 0xc0, 0xb3, 0xdf, 0xbe, 0xb3, 0xde, 0xbb, 0xb0, 0xdb, 0xb7, -0xac, 0xd7, 0xb3, 0xa8, 0xd2, 0xa0, 0x91, 0xba, 0x93, 0x84, 0xab, 0x83, 0x75, 0x99, 0x78, 0x6a, -0x8e, 0x72, 0x64, 0x87, 0x6d, 0x5f, 0x82, 0x6b, 0x5d, 0x7e \ No newline at end of file diff --git a/Timer_1_10kHz_ISR/Timer_1_10kHz_ISR.ino b/Timer_1_10kHz_ISR/Timer_1_10kHz_ISR.ino deleted file mode 100644 index b1ae812..0000000 --- a/Timer_1_10kHz_ISR/Timer_1_10kHz_ISR.ino +++ /dev/null @@ -1,43 +0,0 @@ -void setup() { - pinMode(13, OUTPUT); - noInterrupts(); //cli(); // Stop reception of interrupts - - // Set PB1 to be an output (Pin9 Arduino UNO) - DDRB |= (1 << PB1); - // Clear Timer/Counter Control Registers - TCCR1A = 0; - TCCR1B = 0; - TIMSK1 = 0; - // Set non-inverting mode - Table 15-3 (page 108) - TCCR1A |= (1 << COM1A1); - // Set Fast-PWM Mode (Mode 14) - Table 15-5 (page 109) - TCCR1A |= (1 << WGM11); - TCCR1B |= (1 << WGM12); - TCCR1B |= (1 << WGM13); - // Clear Timer 1 Counter - TCNT1 = 0; - // Set PWM frequency/top value - Output PWM 10kHz - ICR1 = 199; - OCR1A = 180; - // Enable compare match interrupt - TIMSK1 |= (1 << OCIE1A); - TIMSK1 |= (1 << TOIE1); - // Set prescaler to 8 and starts PWM - TCCR1B |= (1 << CS11); - - interrupts(); //sei(); -} - -void loop() { - // Empty -} - -//Timer1 Compare Match Interrupt turns OFF pin 13 (LED) -ISR(TIMER1_COMPA_vect) { - digitalWrite(13, LOW); -} - -//Timer1 Overflow Interrupt turns ON pin 13 (LED) -ISR(TIMER1_OVF_vect) { - digitalWrite(13, HIGH); -} diff --git a/Timer_ISR/Timer_ISR.ino b/Timer_ISR/Timer_ISR.ino deleted file mode 100644 index 8d11733..0000000 --- a/Timer_ISR/Timer_ISR.ino +++ /dev/null @@ -1,38 +0,0 @@ -volatile boolean toggle1 = 0; - -void setup() { - pinMode(13, OUTPUT); - noInterrupts(); //cli(); // Stop reception of interrupts - - // Set Timer 1 Control registers and counter to 0 - TCCR1A = 0; - TCCR1B = 0; - TCNT1 = 0; - - // Set compare match value = Fclk_io / (Fout * Prescaler) - 1 - OCR1A = 15624; // = (16MHz) / (1 * 1024) - 1 - TIMSK1 |= (1 << OCIE1A); // Enable compare match interrupt - - // Set Timer 1 Mode of operation and clock prescalers - TCCR1B |= (1 << WGM12); // Mode 4 - TCCR1B |= (1 << CS12) | (1 << CS10); // Set prescaler to 1024 (=> enable the clock) - - - interrupts(); //sei(); -} - -void loop() { - // put your main code here, to run repeatedly: -} - -ISR(TIMER1_COMPA_vect){//timer1 interrupt 1Hz toggles pin 13 (LED) -//generates pulse wave of frequency 1Hz/2 = 0.5kHz (takes two cycles for full wave- toggle high then toggle low) - if (toggle1){ - digitalWrite(13,HIGH); - toggle1 = 0; - } - else{ - digitalWrite(13,LOW); - toggle1 = 1; - } -} diff --git a/UART-Send/UART-Send.ino b/UART-Send/UART-Send.ino deleted file mode 100644 index d6b3048..0000000 --- a/UART-Send/UART-Send.ino +++ /dev/null @@ -1,17 +0,0 @@ -void setup() { - // put your setup code here, to run once: - Serial.begin(9600); -} - -void loop() { - // put your main code here, to run repeatedly: - Serial.print('V'); - Serial.println('V'); - - Serial.write(0x56); - while(Serial.available() > 0) - { - Serial.read(); - } - delay(5000); -} diff --git a/external_interrupt/external_interrupt.ino b/external_interrupt/external_interrupt.ino deleted file mode 100644 index 5ea877d..0000000 --- a/external_interrupt/external_interrupt.ino +++ /dev/null @@ -1,47 +0,0 @@ -#define BTN_PIN 2 -#define LED_PIN 13 - -void button_pressed_ISR(void); -void slow_computation(void); - -volatile uint8_t led_state = 0; - -void setup() -{ - pinMode(BTN_PIN, INPUT_PULLUP); - pinMode(LED_PIN, OUTPUT); - attachInterrupt(digitalPinToInterrupt(BTN_PIN), button_pressed_ISR, FALLING); - //attachInterrupt(digitalPinToInterrupt(BTN_PIN), button_pressed_ISR, RISING); - //attachInterrupt(digitalPinToInterrupt(BTN_PIN), button_pressed_ISR, CHANGE); - - Serial.begin(9600); -} - -void loop() -{ - slow_computation(); - - if (led_state) - Serial.println("LED in on."); - else - Serial.println("LED in off."); -} - -void button_pressed_ISR(void) -{ - if (led_state) - { - led_state = 0; - digitalWrite(LED_PIN, LOW); - } - else - { - led_state = 1; - digitalWrite(LED_PIN, HIGH); - } -} - -void slow_computation(void) -{ - delay(5000); -} diff --git a/external_interrupt/external_interrupt.png b/external_interrupt/external_interrupt.png deleted file mode 100644 index 2d29e5c..0000000 Binary files a/external_interrupt/external_interrupt.png and /dev/null differ