diff --git a/README.md b/README.md index c7aa39e0f31316b2edc1c012ea86a60f8f7bebb6..be8f445fee5daa1483b23636bab19bf1cd50eb0f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# **BITS-i Bare Minimum Zyklus 1** +# **BITS-i Bare Minimum** Dieses Projekt dient als Grundlage für alle Projekte mit BITS-i.<br /> <br /> @@ -11,14 +11,14 @@ Folgende Bibliotheken inklusive der jeweiligen Voraussetzungen sind für dieses - [bits_time_of_flight_controller](https://git-ce.rwth-aachen.de/bits/bits_libs/bits_time_of_flight_controller.git) - [thk_led_strip_controller](https://git-ce.rwth-aachen.de/thk_libs/microcontrollers/thk-led-strip-controller.git) - [thk_imu](https://git-ce.rwth-aachen.de/thk_libs/microcontrollers/thk_imu.git) -- [bits_motor_driver ](https://git-ce.rwth-aachen.de/bits/bits_libs/bits_motor_driver.git) +- [bits_motor_driver](https://git-ce.rwth-aachen.de/bits/bits_libs/bits_motor_driver.git) - [RF24 by TMRh20](https://github.com/nRF24/RF24)<br /> <br /> ## **Installation:** -Um dieses Projekt verwenden können, muss dieses Repository geklont und die `bits-bare-minimum-zyklus-1.ino` mit der Arduino IDE geöffnet werden. -Es muss darauf geachtet werden, dass der Ordner, in dem sich die `bits-bare-minimum-zyklus-1.ino` befindet, `bits-bare-minimum-zyklus-1` lautet. +Um dieses Projekt verwenden können, muss dieses Repository geklont und die `bits-bare-minimum.ino` mit der Arduino IDE geöffnet werden. +Es muss darauf geachtet werden, dass der Ordner, in dem sich die `bits-bare-minimum.ino` befindet, `bits-bare-minimum` lautet. ## **Anwendung:** diff --git a/Tools/Automatischer BITS_Bibliotheken Downloader.sh b/Tools/Automatischer BITS_Bibliotheken Downloader.sh index 89cab73fa8b42e526e0befeb2dfa43692e8e8e5a..d2a2ff69c364b9c4c535063d7165cb631202f4bb 100644 --- a/Tools/Automatischer BITS_Bibliotheken Downloader.sh +++ b/Tools/Automatischer BITS_Bibliotheken Downloader.sh @@ -3,6 +3,7 @@ RED='\033[0;31m' GREEN='\033[0;32m' NOCOLOR='\033[0m' +REDBACKGROUND='\033[31;7m' bold=$(tput bold) normal=$(tput sgr0) @@ -24,10 +25,12 @@ echo -e "$RED" echo -e "__________________________________________________________________" echo -e "__________________________________________________________________" echo -e " " -echo -e "\033[31;7m${bold}WICHTIG!!!!!\033[0m" +echo -e "$REDBACKGROUND${bold}" +echo -e 'WICHTIG!!!!!' +echo -e "$NOCOLOR" echo -e " " -echo -e "\033[31;7m${bold}Bitte entzippen Sie die Datei und kopieren Sie " -echo -e "alle Ordner aus BITS_Bibliotheken in den Arduino Libraries Ordner\033[0m" +echo -e "$REDBACKGROUND${bold}Bitte entzippen Sie die Datei und kopieren Sie " +echo -e "alle Ordner aus BITS_Bibliotheken in den Arduino Libraries Ordner." echo -e "$RED" echo -e "__________________________________________________________________" echo -e "__________________________________________________________________" diff --git a/basic_functions.h b/basic_functions.h index b8eff12a6988f2cee90650d58a0cf6ce22886f6f..2cb1197e852edf43ef3e29f73ec462b61610476d 100644 --- a/basic_functions.h +++ b/basic_functions.h @@ -113,4 +113,33 @@ void end_of_programm(){ } } +void initial_led_show() { + _println_("Waiting"); + set_led_color(255,0,0); + const int frequencySteps[] = {500, 700, 900, 1100, 900, 700}; + int counter = 0; + for (int k=0; k<13; k++){ + for (int i=0; i<FRONT_LED_NUM; i++){ + front_strip.set_pixel_color(i,thk_LedStripController::Color(red, green, blue)); + front_strip.show(); + tone(BUZZER_PIN, frequencySteps[counter%6], 500/FRONT_LED_NUM); + delay(500/FRONT_LED_NUM); + _print_("."); + counter++; + } + for (int i=0; i<FRONT_LED_NUM; i++){ + front_strip.set_pixel_color(i,thk_LedStripController::Color(0, 0, 0)); + front_strip.show(); + tone(BUZZER_PIN, frequencySteps[counter%6], 500/FRONT_LED_NUM); + delay(500/FRONT_LED_NUM); + _print_("."); + counter++; + } + red -= 20; + green += 20; + counter++; + } + noTone(BUZZER_PIN); +} + #endif \ No newline at end of file diff --git a/bits-bare-minimum-zyklus-1.ino b/bits-bare-minimum.ino similarity index 68% rename from bits-bare-minimum-zyklus-1.ino rename to bits-bare-minimum.ino index 15066f2d445ffde223f46bfc6647c9d116efe1ae..e620883559e0242549ac6c535ad141f37126181b 100644 --- a/bits-bare-minimum-zyklus-1.ino +++ b/bits-bare-minimum.ino @@ -12,28 +12,12 @@ <Hier kommt der Name des Projekts> Description: - <Hier kommt was dieses Skript macht> + <Hier wird die Funktion dieses Skripts beschrieben> - Author: <Hier Namen einfügen> **************************************************/ -#define DEBUG_SERIAL -// #define WIFI_COMMUNICATION - -#ifdef DEBUG_SERIAL -#define _println_(x) Serial.println(x) -#define _print_(x) Serial.print(x) -#else -#ifdef WIFI_COMMUNICATION -#define _println_(x) Serial3.println(x) -#define _print_(x) Serial3.print(x) -#else -#define _println_(x) -#define _print_(x) -#endif -#endif #include "config.h" #include "basic_functions.h" @@ -66,24 +50,9 @@ void setup(){ imu.init(); start = millis(); _println_("Waiting for IMU getting ready. Please do not move the car!"); - _print_("Waiting"); - set_led_color(255,0,0); - for (int k=0; k<13; k++){ - for (int i=0; i<FRONT_LED_NUM; i++){ - front_strip.set_pixel_color(i,thk_LedStripController::Color(red, green, blue)); - front_strip.show(); - delay(500/FRONT_LED_NUM); - _print_("."); - } - for (int i=0; i<FRONT_LED_NUM; i++){ - front_strip.set_pixel_color(i,thk_LedStripController::Color(0, 0, 0)); - front_strip.show(); - delay(500/FRONT_LED_NUM); - _print_("."); - } - red -= 20; - green += 20; - } + + //Spätestens vor der letzten Abgabe auskommentieren, da sehr viel Zeit dabei verloren geht! + initial_led_show(); // Pin deklaration der Ultraschallsensoren pinMode(TRIGF, OUTPUT); diff --git a/config.h b/config.h index e06bcbe2876520f46dce9727f04baa0c7278a611..e91d48d24d2ba7da0e9f61dd4a9d9121d20f6a87 100644 --- a/config.h +++ b/config.h @@ -41,6 +41,22 @@ // #define DEBUG_IMU // #define DEBUG_COURSE +#define DEBUG_SERIAL +// #define WIFI_COMMUNICATION + +#ifdef DEBUG_SERIAL +#define _println_(x) Serial.println(x) +#define _print_(x) Serial.print(x) +#else +#ifdef WIFI_COMMUNICATION +#define _println_(x) Serial3.println(x) +#define _print_(x) Serial3.print(x) +#else +#define _println_(x) +#define _print_(x) +#endif +#endif + /* ************ * * Bibliotheken * * ************ */ diff --git a/custom_functions.h b/custom_functions.h index 16253e337765be762ccc786cbb87d6b591f82d52..d172493f8aab7b39cba9a1182f40bd1df547937c 100644 --- a/custom_functions.h +++ b/custom_functions.h @@ -5,9 +5,4 @@ void platzhalter(){ // Dies ist nur ein Platzhalter. } - - - - - #endif \ No newline at end of file