Hirdetés
- Egész pofás lett a Lian Li új mikrotornya, és az ára sem vészes
- Az Enermax nagyon belehúzott a "tápozásba"
- Holdbázis és űrkupola az Egyesült Államok csillagászati terveiben
- Nem a képgenerálásnak van köze a képmegjelenítés egyenletességéhez
- A Windows 11 nem akarja ránk erőltetni az AI applikációkat – vagy mégis?
- OLED TV topic
- Mit tud egy nagy név? Teszten az Acer Predator Orion 5000 PC
- ThinkPad (NEM IdeaPad)
- A foltozásra fókuszált az új GeForce driver
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Azonnali alaplapos kérdések órája
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- TCL LCD és LED TV-k
- Milyen billentyűzetet vegyek?
- Milyen cserélhető objektíves gépet?
Új hozzászólás Aktív témák
-
#90088192
törölt tag
válasz
buherton
#6075
üzenetére
Koszonom

Remélem erre gondoltál
Különben igen érdekes maga a probléma, a bal oldali képernyő gyakorlatilag túlcsordul(Módosítottam a kodon így is duplázza az oszlopokat, es elkezd a 0. oszlopba írni)
Maga a problémás részlet:
void write_char(int line_select, int y_offset, int charcater_code)
{ int x;
if(y_offset>=(Display_width/2) && y_offset<=Display_width-Font_width) //Check which side of the screen need to be activated
{
lcd_select(1); //if the offset is bigger than 63 than the right side
set_y(y_offset-Display_width/2); //Deducts the the half of the display size Set y
set_x(line_select); //Selects line of writing
for(x=(charcater_code-Font_offset)*Font_width; x<=((charcater_code-Font_offset)*Font_width)+Font_width; x++) //Decodes the character code and make sure the data is sent by 8 bits
{
send_data_screen(font6x8[x]); //Sends out the relevant section of the Array
}
} else if(y_offset<=(Display_width/2)-1 && y_offset>=0) {
lcd_select(0); //selects the left side of the screen
set_y(y_offset); //Set y
set_x(line_select); //Selects line of writing
for(x=(charcater_code-Font_offset)*Font_width; x<((charcater_code-Font_offset)*Font_width)+Font_width; x++) //Decodes the character code and make sure the data is sent by 8 bits
{if(y_offset+(x-(charcater_code-Font_offset)*Font_width)!=(Display_width/2)) //Checks if the character has reached the border of the 2 sides of the screen
{
send_data_screen(font6x8[x]);
}else{ //If the Character is belong to the right side
lcd_select(1); //If yes selects the the right side
set_y(0); // Resets the offset
set_x(line_select); //Selects line of writing
send_data_screen(font6x8[x]); //Sends out the relevant section of the Array
}
}
}
else
{
MEMBRANE_MUTE=1;
}
}Es az egesz en block
#include "font6x8.h"
#include "screen.h"
#include "membrane.h"
#define Font_width 6
#define Font_offset 32
#define Font_height 8
#define Display_width 128
#define Dislpay_height 64
#define Display_rows 8
//#define Font_type font6x8
void InitalizePorts_display(void)
{
S_DATA_OUT=0;
S_DATA_IN=0;
DISPLAY_Dir=0;
DISPLAY_CS1=1;
DISPLAY_CS2=1;
DISPLAY_RS=1;
DISPLAY_RW=0;
DISPLAY_EN=0;
/* Command port direction settings */
DISPLAY_CS1_Direction =0 ;
DISPLAY_CS2_Direction =0 ;
DISPLAY_RS_Direction =0 ;
DISPLAY_RW_Direction =0 ;
DISPLAY_EN_Direction =0 ;
DelayUs(100);
}
void lcd_select(int s)
{
if(s==0)
{
DISPLAY_CS1 = 1; //Selects Left side of the screen
DISPLAY_CS2 = 0; //Deselects Right side of the screen
DelayUs(15);
}else if(s==1)
{
DISPLAY_CS1 = 0; //Deselects Left side of the screen
DISPLAY_CS2 = 1; //Selects Right side of the screen
DelayUs(15);
}else{
DISPLAY_CS1 = 1; //Selects Left side of the screen
DISPLAY_CS2 = 1; //Selects Right side of the screen
DelayUs(15);
}
}
void strobe_E(void) //Turns enabling line off/on
{
DelayUs(5);
DISPLAY_EN = 0; //Turns Display Off
DelayUs(5);
DISPLAY_EN = 1; //Turns Display On
DelayUs(5);
}
void set_y(int y) //Set Y coordinate 0-63 on the active side of the screen
{
DISPLAY_RS = 0; //Sets Instruction mode
DelayUs(5);
S_DATA_OUT = (0b01000000+y); //Set Y coordinate
strobe_E();
}
void set_x(int x) //Select one of the 8 bit line out of the 8
{
if(x<=Display_rows-1 && x>=0) // Verify input parameter is in range
{
DelayUs(5);
DISPLAY_RS = 0; //Sets Instruction mode
DelayUs(5);
S_DATA_OUT = 0b10111000+x; //select the desired line from the 8 X 8bit lines
strobe_E();
}else{
MEMBRANE_MUTE=1;
}
}
void send_data_screen (long int Data) //Sends Data to the Display hardware
{
DISPLAY_RS = 1; //Enables Data mode
DelayUs(5);
S_DATA_OUT = Data; //Insert Data to the hardware line
strobe_E();
}
void dsp_on(void)
{
DISPLAY_RS = 0; //Instruction mode
DelayUs(2);
S_DATA_OUT = 0b00111111; //Turns display controller ON
DelayUs(2);
DISPLAY_EN = 1; //Turns Enable line ON
strobe_E();
}
void clr_scr (int Fill)
{
int x; int y;
lcd_select(2); //Select both side of the display for quicker action
for(y=0;y<=Display_rows-1;y++) //Loop for the rows
{
set_y(0); //Set y to 0
set_x(y); //Selects line of writing
for(x=0; x<(Display_width/2); x++) //Loop for the columns
{
send_data_screen(Fill);
}
}
}
void write_char(int line_select, int y_offset, int charcater_code)
{ int x;
if(y_offset>=(Display_width/2) && y_offset<=Display_width-Font_width) //Check which side of the screen need to be activated
{
lcd_select(1); //if the offset is bigger than 63 than the right side
set_y(y_offset-Display_width/2); //Deducts the the half of the display size Set y
set_x(line_select); //Selects line of writing
for(x=(charcater_code-Font_offset)*Font_width; x<=((charcater_code-Font_offset)*Font_width)+Font_width; x++) //Decodes the character code and make sure the data is sent by 8 bits
{
send_data_screen(font6x8[x]); //Sends out the relevant section of the Array
}
} else if(y_offset<=(Display_width/2)-1 && y_offset>=0) {
lcd_select(0); //selects the left side of the screen
set_y(y_offset); //Set y
set_x(line_select); //Selects line of writing
for(x=(charcater_code-Font_offset)*Font_width; x<((charcater_code-Font_offset)*Font_width)+Font_width; x++) //Decodes the character code and make sure the data is sent by 8 bits
{if(y_offset+(x-(charcater_code-Font_offset)*Font_width)!=(Display_width/2)) //Checks if the character has reached the border of the 2 sides of the screen
{
send_data_screen(font6x8[x]);
}else{ //If the Character is belong to the right side
lcd_select(1); //If yes selects the the right side
set_y(0); // Resets the offset
set_x(line_select); //Selects line of writing
send_data_screen(font6x8[x]); //Sends out the relevant section of the Array
}
}
}
else
{
MEMBRANE_MUTE=1;
}
}
void string_out(char* message, float variable, int line, int y_offset)
{
int Maximum_num_char= Display_width/Font_width; //Maximum number of characters what can be placed in one row
char test[Maximum_num_char],i=0,j;
char a[Maximum_num_char];
sprintf(a, "%s%f", message, variable);
while(a[i]!='\0') {test[i]=a[i]; i++;}
for(j=0;j<=i-1;j++) write_char(line,y_offset+j*Font_width,test[j]);
}
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- OLED TV topic
- Mit tud egy nagy név? Teszten az Acer Predator Orion 5000 PC
- Synology NAS
- ThinkPad (NEM IdeaPad)
- A foltozásra fókuszált az új GeForce driver
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Abarth, Alfa Romeo, Fiat, Lancia topik
- League of Legends
- Okos Otthon / Smart Home
- Kamionok, fuvarozás, logisztika topik
- További aktív témák...
- PS4 FAT (1216A 12.02 GOLDHEN)
- FÉLÁRON SZINTE ÚJ HP HyperX Cloud Stinger Bolti ár:25k INGYEN FOXPOST
- Bomba ár! Fujitsu Lifebook T936: i5-6G I 8GB I 256SSD I 13,3" FHD Touch I Cam I W10 I Gari!
- Bomba ár! HP ProBook 640 G2 - i3-6GEN I 4GB I 128GB SSD I 14" FHD I Cam I W11 I Garancia!
- több db DELL P2417 full HD 1920x1080 IPS monitor HDMI - gari + számla
- ÁRGARANCIA!Épített KomPhone i9 14900KF 64GB RAM RTX 5090 32GB GAMER PC termékbeszámítással
- HIBÁTLAN iPhone 13 mini 128GB Starlight -1 ÉV GARANCIA - Kártyafüggetlen, MS3828
- ÁRGARANCIA!Épített KomPhone i5 14600KF 32/64GB RAM RX 7800 XT 16GB GAMER PC termékbeszámítással
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7500F 32/64GB RAM RX 7800 XT 16GB GAMER PC termékbeszámítással
- Készpénzes / Utalásos Számítógép felvásárlás! Személyesen vagy Postával!
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: Laptopszaki Kft.
Város: Budapest




