Hauptprogramm
Dependencies: ILI9340_Driver_Lib PM2_Libary Lib_DFPlayerMini
Diff: main.cpp
- Revision:
- 24:02223fec319a
- Parent:
- 21:1aaf25fc8d53
- Child:
- 25:863e6ef1245f
--- a/main.cpp Fri Apr 23 16:26:54 2021 +0000 +++ b/main.cpp Sat Apr 24 19:06:59 2021 +0000 @@ -1,5 +1,5 @@ #include "mbed.h" -//#include "Servo.h" + //Eigene Header einbinden //include Zeitfunktion @@ -10,44 +10,35 @@ //LED Anzeige -//#include "Adafruit_LED_Backpack.h" - - +#include "Adafruit_LED_Backpack.h" -/* -#define MID 1500 -#define MIN 1000 -#define MAX 2000 -#define STEP 50 -//Time delay between steps in milliseconds -#define TIME 100 -*/ using namespace std::chrono; InterruptIn user_button(USER_BUTTON); DigitalOut led(LED1); - - -//I2C i2c(I2C_SDA , I2C_SCL); +BufferedSerial pc(SERIAL_TX, SERIAL_RX); +I2C i2c(PB_9, PB_8); // i2c1 pins + bool executeMainTask = false; Timer user_button_timer, loop_timer; +//Adafruit_7segment matrix = Adafruit_7segment(); /* declaration of custom button functions */ void button_fall(); void button_rise(); -/*void setup() { +void setup() { #ifndef __AVR_ATtiny85__ - Serial.begin(9600); - Serial.println("7 Segment Backpack Test"); + pc.set_baud(15200); + //pc.println("7 Segment Backpack Test"); #endif - matrix.begin(0x70); -}*/ -//Adafruit_7segment matrix = Adafruit_7segment(); + //matrix.begin(0x70); +} + int main() { @@ -137,24 +128,3 @@ executeMainTask = !executeMainTask; } } - -/*uint16_t blinkcounter = 0; - boolean drawDots = false; - for (uint16_t counter = 0; counter < 9999; counter ++) { - matrix.writeDigitNum(0, (counter / 1000), drawDots); - matrix.writeDigitNum(1, (counter / 100) % 10, drawDots); - matrix.drawColon(drawDots); - matrix.writeDigitNum(3, (counter / 10) % 10, drawDots); - matrix.writeDigitNum(4, counter % 10, drawDots); - - blinkcounter+=50; - if (blinkcounter < 500) { - drawDots = false; - } else if (blinkcounter < 1000) { - drawDots = true; - } else { - blinkcounter = 0; - } - matrix.writeDisplay(); - delay(10); - }*/ \ No newline at end of file