- gban: Ingyen kellene, de tegnapra
- aquark: Jó platformer játékokat keresek!
- sziku69: Fűzzük össze a szavakat :)
- sziku69: Szólánc.
- Imilenni: Egy kis depi (szösszenet inkább), remélem elfér itt :) 3#
- Geri Bátyó: Agglegénykonyha 5 – Edények és konyhai eszközök
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Luck Dragon: Asszociációs játék. :)
- aquark: A ló túloldalán (Intel-AMD szivatás)
Új hozzászólás Aktív témák
-
#90088192
törölt tag
Hello Mindenkinek
Lenne itt egy kis fennforgás és segítséget szeretnek kerni hozza, mert nem jutok dűlőre egymagamban.
A karakter kiíratás amikor elérkezik a határhoz(2X64 képpontból áll a kijelző, amiket külön kell kapcsolgatni, és 8 bit magas a "sor") akkor nem csak térfelet vált hanem nem is tudom mit csinál, kihagyja az első karakter, meg mintha csak egy oszlopnyi szemetet zúdítana a határvonalra
Ez lenne a problémás részlet(a font 6 szeles és 8 magas):
for(x=(charcater_code-32)*6; x<((charcater_code-32)*6)+7; x++) //Decodes the character code and make sure the data is sent by 8 bits
{if(y_offset+(x-(charcater_code-32)*6)<63) //Checks if the character has reached the border of the 2 sides of the screen
{
DISPLAY_RS = 1;
S_DATA_OUT = font6x8[x]; //Sends the data to the screen
strobe_E();
}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);
DISPLAY_RS = 1;
S_DATA_OUT = font6x8[x]; //Sends the data to the screen
strobe_E();Ez lenne az egesz:
#include "font6x8.h"
#include "screen.h"
#include "membrane.h"
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<=7 && 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 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<=7;y++)
{
set_y(0); //Set y to 0
set_x(y); //Selects line of writing
for(x=0; x<64; x++)
{
DISPLAY_RS = 1; //Turns Data mode ON
DelayUs(2);
S_DATA_OUT = Fill_; //Send data to the selected line
strobe_E();
}
}
}
void write_char(int line_select, int y_offset, int charcater_code)
{ int x;
if(y_offset>=64 && y_offset<=122) //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-64); //Set y
set_x(line_select); //Selects line of writing
for(x=(charcater_code-32)*6; x<=((charcater_code-32)*6)+6; x++) //Decodes the character code and make sure the data is sent by 8 bits
{
DISPLAY_RS = 1;
S_DATA_OUT = font6x8[x];
strobe_E();
}
} else if(y_offset<=63 && 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-32)*6; x<((charcater_code-32)*6)+7; x++) //Decodes the character code and make sure the data is sent by 8 bits
{if(y_offset+(x-(charcater_code-32)*6)<63) //Checks if the character has reached the border of the 2 sides of the screen
{
DISPLAY_RS = 1;
S_DATA_OUT = font6x8[x]; //Sends the data to the screen
strobe_E();
}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);
DISPLAY_RS = 1;
S_DATA_OUT = font6x8[x]; //Sends the data to the screen
strobe_E();
}
}
}
else
{
MEMBRANE_MUTE=1;
}
}
void string_out(char* message, float variable, char line, char y_offset)
{
char test[21],i=0,j;
char a[21];
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*6,test[j]);
}
Új hozzászólás Aktív témák
Hirdetés
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- A Temu diktál Magyarországon, a hazai e-kereskedők fulladoznak
- TPM (trusted platform module) topic
- Anglia - élmények, tapasztalatok
- Foreo FAQ 202 – LED it be!
- Borderlands 4
- Iqos cigaretta
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- EAFC 26
- gban: Ingyen kellene, de tegnapra
- Bambu Lab 3D nyomtatók
- További aktív témák...
- Microsoft Surface Pro 7 Érintős Szétszedhető Laptop Tablet 12,3" -80% i5-1035G4 8/256 Retina
- Mars Gaming MK60W 60% Mechanikus Blue Switches Gamer Billentyűzet Spanyol Kiosztás
- 2019 - BMW I3S 120Ah
- ASUS ROG Strix G15 144Hz / AMD Ryzen 5 / RTX 3050Ti / 16GB RAM / 512GB SSD
- Microsoft Surface Pro 7+ Érintős Szétszedhető Laptop Tablet 12,3" -80% i5-1135G7 16/256 Retina
- Eladó szép állapotban levő Apple iPhone SE2020 64GB / 12 hó jótállás
- Apple iPhone 14 Pro 256 GB Space Black 1 év Garancia Beszámítás Házhozszállítás
- BESZÁMÍTÁS! Apple Studio Display 27 5K Nanotexturált üveg monitor garanciával hibátlan működéssel
- BESZÁMÍTÁS! LG 24MB35PM 60Hz FHD IPS 5ms monitor garanciával hibátlan működéssel
- SzinteÚJ! HP Elitebook 860 G9 i7-1255U 16GB 512GB 16" FHD+ Gar.: 1 év
Állásajánlatok
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest