Hirdetés
- iPhone topik
- Két kamerával cserélné az iPhone Air a zakót kapucnis pulcsira
- Vivo X200 Pro - a kétszázát!
- Youtube Android alkalmazás alternatívák reklámszűréssel / videók letöltése
- Xiaomi 14T Pro - teljes a család?
- Samsung Galaxy S25 - végre van kicsi!
- Mobil flották
- Telekom mobilszolgáltatások
- One mobilszolgáltatások
- Nincs több titok a OnePlus 15R-t illetően, megjött Európába
Ú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
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- iPhone topik
- És akkor a memóriapánik után beköszöntött a HDD-pánik
- Call of Duty: Black Ops 7
- TCL LCD és LED TV-k
- Forza sorozat (Horizon/Motorsport)
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Mibe tegyem a megtakarításaimat?
- Két kamerával cserélné az iPhone Air a zakót kapucnis pulcsira
- Folyószámla, bankszámla, bankváltás, külföldi kártyahasználat
- Nvidia GPU-k jövője - amit tudni vélünk
- További aktív témák...
- Sony G 24-105 f/4 - Sigma 50mm f/1.4 Art (SONY E)
- Összeszerelésre váró komplett gépezet várja új gazdáját!
- BONTATLAN Új Iphone 17 256GB White -Fe Szín 1év APPLE garancia gyári független Deák AZONNAL Átvehet
- Asus P5a-b Ss7 dobozos alaplap / K6-2+ 500mhz / Voodoo 3 /Awe 64 / Big Box Game
- Eladó 82 colos 4K HDR Samsung TV
- Dell Latutide E7270, 7280, i5- i7, 8GB RAM, 256gb ssd, számla, 6 hó gar - több db
- ÁRGARANCIA!Épített KomPhone i9 14900KF 32/64GB DDR5 RAM RTX 5070 12GB GAMER PC termékbeszámítással
- Nintendo switch oled, Új,Dobozával, 12 hónap garanciával
- GYÖNYÖRŰ iPhone 13 Pro 256GB Sierra Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3360
- Telefon felvásárlás!! iPhone X/iPhone Xs/iPhone XR/iPhone Xs Max
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: ATW Internet Kft.
Város: Budapest




