pardicimo
30-09-2019, 22:08:13
שלום לכולם,
מבקש שוב את עזרת המומחים, כחלק מהפרוייקט שלי אני רוצה לייצר אופק מלאכותי שישלט ע"י גוייסטיק.
לשם כך רכשתי מסך TFT עיצבתי את המסך אך כאשר אני מעביר את העיצוב ללופ הסמך מרצד לי, אשמח לעזרתכם הכוונתכם לנושא. מצרפ סרטונים להמחשה
כמו כן מצב הקוד:
#include <memorysaver.h>
#include <UTFT.h>
UTFT myGLCD(CTE32HR,38,39,40,41);
extern uint8_t SmallFont[];
void setup() {
// put your setup code here, to run once:
myGLCD.InitLCD();
myGLCD.setFont(SmallFont);
}
void loop() {
// put your main code here, to run repeatedly:
myGLCD.setColor(255, 127, 0);//orange ground
myGLCD.fillRect(240, 320, 480, 0);//location on screen
myGLCD.setColor(0, 100, 255);//blue sky
myGLCD.fillRect(0, 320, 239, 0);//location on screen
{//black climbe rate bar
myGLCD.setColor(0, 0, 0);//black alt. backrownd
myGLCD.fillRect(230, 2, 250, 50);//location on screen
myGLCD.setColor(0,0,0);//black box climb rate up
myGLCD.fillRect(10, 23, 220, 25);//location on screen
myGLCD.setColor(0,0,0);//black climb rate down
myGLCD.fillRect(260, 23, 469, 25);//location on screen
}
{//green center climb
myGLCD.setColor(0,255,0);//green center climb
myGLCD.fillRect(237, 157, 243, 163);//center climb location on screen
myGLCD.setColor(0,255,0);//green left climb
myGLCD.fillRect(237, 52, 243, 142);//location on screen
myGLCD.setColor(0,255,0);//green right climb
myGLCD.fillRect(237, 178, 243, 268);//location on screen
}
{// white climb bar sky small bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(220, 184, 220, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(160, 184, 160, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(100, 184, 100, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(40, 184, 40, 133);//location on screen
}
{// white climb bar sky BIG bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(190, 211, 190, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(130, 211, 130, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(70, 211, 70, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(10, 211, 10, 106);//location on screen
}
{// white climb bar ground small bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(260, 184, 260, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(320, 184, 320, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(380, 184, 380, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(440, 184, 440, 133);//location on screen
}
{// white climb bar ground BIG bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(290, 211, 290, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(350, 211, 350, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(410, 211, 410, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(470, 211, 470, 106);//location on screen
}
}
מבקש שוב את עזרת המומחים, כחלק מהפרוייקט שלי אני רוצה לייצר אופק מלאכותי שישלט ע"י גוייסטיק.
לשם כך רכשתי מסך TFT עיצבתי את המסך אך כאשר אני מעביר את העיצוב ללופ הסמך מרצד לי, אשמח לעזרתכם הכוונתכם לנושא. מצרפ סרטונים להמחשה
כמו כן מצב הקוד:
#include <memorysaver.h>
#include <UTFT.h>
UTFT myGLCD(CTE32HR,38,39,40,41);
extern uint8_t SmallFont[];
void setup() {
// put your setup code here, to run once:
myGLCD.InitLCD();
myGLCD.setFont(SmallFont);
}
void loop() {
// put your main code here, to run repeatedly:
myGLCD.setColor(255, 127, 0);//orange ground
myGLCD.fillRect(240, 320, 480, 0);//location on screen
myGLCD.setColor(0, 100, 255);//blue sky
myGLCD.fillRect(0, 320, 239, 0);//location on screen
{//black climbe rate bar
myGLCD.setColor(0, 0, 0);//black alt. backrownd
myGLCD.fillRect(230, 2, 250, 50);//location on screen
myGLCD.setColor(0,0,0);//black box climb rate up
myGLCD.fillRect(10, 23, 220, 25);//location on screen
myGLCD.setColor(0,0,0);//black climb rate down
myGLCD.fillRect(260, 23, 469, 25);//location on screen
}
{//green center climb
myGLCD.setColor(0,255,0);//green center climb
myGLCD.fillRect(237, 157, 243, 163);//center climb location on screen
myGLCD.setColor(0,255,0);//green left climb
myGLCD.fillRect(237, 52, 243, 142);//location on screen
myGLCD.setColor(0,255,0);//green right climb
myGLCD.fillRect(237, 178, 243, 268);//location on screen
}
{// white climb bar sky small bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(220, 184, 220, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(160, 184, 160, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(100, 184, 100, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(40, 184, 40, 133);//location on screen
}
{// white climb bar sky BIG bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(190, 211, 190, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(130, 211, 130, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(70, 211, 70, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(10, 211, 10, 106);//location on screen
}
{// white climb bar ground small bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(260, 184, 260, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(320, 184, 320, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(380, 184, 380, 133);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(440, 184, 440, 133);//location on screen
}
{// white climb bar ground BIG bar
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(290, 211, 290, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(350, 211, 350, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(410, 211, 410, 106);//location on screen
myGLCD.setColor(VGA_WHITE);//green right climb
myGLCD.fillRect(470, 211, 470, 106);//location on screen
}
}