
Just a test
Dependencies: BSP_DISCO_F769NI LCD_DISCO_F769NI lcd_log esp8266-driver
Fork of mbed-os-example-blinky-5 by
Revision 4:7876f757c6e8, committed 2017-05-29
- Comitter:
- joschaihl
- Date:
- Mon May 29 03:13:33 2017 +0000
- Parent:
- 3:7c7587c666e1
- Child:
- 5:250c357b6bf5
- Commit message:
- latest but not greatest
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun May 28 11:16:16 2017 +0000 +++ b/main.cpp Mon May 29 03:13:33 2017 +0000 @@ -11,8 +11,12 @@ #include "TCPSocket.h" #include "LCD_DISCO_F769NI.h" #include "lcd_log.h" + + #include <iostream> +#include <cmath> using namespace std; + #define HTTP_STATUS_LINE "HTTP/1.0 200 OK" #define HTTP_HEADER_FIELDS "Content-Type: text/html; charset=utf-8" #define HTTP_MESSAGE_BODY "" \ @@ -76,7 +80,7 @@ BSP_LCD_Init(); BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS); - LCD_LOG_SetHeader((uint8_t *) "Das ist ein Test"); + LCD_LOG_SetHeader((uint8_t *) "Serielle Schnittstelle"); //LCD_LOG_Init(); while(1) { @@ -90,6 +94,53 @@ } } +void gui_scope() { + lcd.DisplayOn(); + /* BSP_LCD_Init(); + BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS); + LCD_LOG_SetHeader((uint8_t *) "Oszilloskop");*/ + + double M_PI = 3.14159265358979323846; + double a = 0.0; + double inc = M_PI/25.0; + double abstand = lcd.GetYSize() / 2; + double prev_x = 0, prev_y = abstand, x, y; + + lcd.SetBackColor((uint32_t) 0x00000000); + lcd.SetTextColor((uint32_t) 0xffffffff); + //lcd.DrawLine(0, 0, 100, 100); + //for(int i=0; i<1000; i=i+4) + int i; + while(1){ + x = i; + y = abstand + sin(a) * 200.0; + + //lcd.Clear((uint32_t) 0xffffffff); + //lcd.SetColorKeying(1, (uint32_t) 0xff000000); + lcd.DrawLine(prev_x, prev_y, x, y); + prev_x = x; + prev_y = y; + a = a + inc; + i+=8; + if(i>lcd.GetXSize()) { + i = 0; + lcd.Clear((uint32_t) 0x00000000); + wait_ms(10); + //lcd.SetBackColor((uint32_t) 0x00000000); + //lcd.SetTextColor((uint32_t) 0xffffffff); + } + } + //lcd.LayerDefaultInit(0, LCD_FB_START_ADDRESS); + //LCD_SetTextColor((uint32_t) 0xffffffff); + //LCD_DrawLine(120, 70, 2, 30); + // LCD_DrawLine(122, 68, 2, 50); + //LCD_DrawLine(122, 72, 2, 60); + + // lcd.DrawLine(100, 100, 100, 100); + while(1) { + } +} + void touch_thread() { uint16_t x1, y1; TS_StateTypeDef state; @@ -159,11 +210,11 @@ Thread printThread(osPriorityNormal), ledThread(osPriorityNormal), guiThread(osPriorityNormal), touchThread(osPriorityNormal), clockThread(osPriorityNormal), espThread(osPriorityNormal); - printThread.start(print_thread); - ledThread.start(led_thread); - guiThread.start(gui_thread2); - touchThread.start(touch_thread); - clockThread.start(clock_thread); + // printThread.start(print_thread); + // ledThread.start(led_thread); + guiThread.start(gui_scope); + // touchThread.start(touch_thread); + // clockThread.start(clock_thread); // espThread.start(esp_thread); // Thread tsrv; // tsrv.start(srvLoop);