kod çok yer kapladı compiler uyarı veriyor ne yapmalıyı

Başlatan forumsad, 17 Ocak 2010, 21:32:23

forumsad

elektronik periyodik cetvel yapmaya çalışıyorum
kodlar çok fazla geldi 4 satır lcd kullanmak istiyorum
ama ikinci satıra geçemeden hafıza uyarısı veriyor
kodları kısaltmak için bir şeyler yapılabilirmi

teşekkürler



GOSTER:
Print Cls
SAY=mynumber
Select SAY					

Case 1				
Print At 1,1,"1 Hidrojen(H)"
Print At 2,1,""
Case 2
Print At 1,1,"2 Helium(He)"
Print At 2,1,""
Case 3
Print At 1,1,"3 Lithium(Li)"
Print At 2,1,""
Case 4
Print At 1,1,"4 Beryllium(Be)"
Print At 2,1,""

Case 5
Print At 1,1,"5 Boron(B"
Print At 2,1,""

Case 6
Print At 1,1,"6 Carbon(C)"
Print At 2,1,""

Case 7
Print At 1,1,"7 Nitrogen(N)"
Print At 2,1,""

Case 8
Print At 1,1,"8 Oxygen(O)"
Print At 2,1,""
Case 9
Print At 1,1,"9 Flourine(F)"
Print At 2,1,""
Case 10
Print At 1,1,"10 Neon(Ne)"
Print At 2,1,""
Case 11
Print At 1,1,"11 Sodium(Na)"
Print At 2,1,""
Case 12
Print At 1,1,"12 Magnesium(Mg)"
Print At 2,1,""
Case 13
Print At 1,1,"13 Aluminum(Al)"
Print At 2,1,""
Case 14
Print At 1,1,"14 Silicon(Si)"
Print At 2,1,""
Case 15
Print At 1,1,"15 Phosphorous(P)"
Print At 2,1,""
Case 16
Print At 1,1,"16 Sulfur(S)"
Print At 2,1,""
Case 17
Print At 1,1,"17 Chlorine(Cl)"
Print At 2,1,""
Case 18
Print At 1,1,"18 Argon(Ar)"
Print At 2,1,""
Case 19
Print At 1,1,"19 Potassium(K)"
Print At 2,1,""
Case 20
Print At 1,1,"20 Calcium(Ca)"
Print At 2,1,""
Case 21
Print At 1,1,"21 Scandium(Sc)"
Print At 2,1,""
Case 22
Print At 1,1,"22 Titanium(Ti)"
Print At 2,1,""
Case 23
Print At 1,1,"23 Vanadium(V)"
Print At 2,1,""
Case 24
Print At 1,1,"24 Chromium(Cr)"
Print At 2,1,""
Case 25
Print At 1,1,"25 Manganese(Mn)"
Print At 2,1,""
Case 26
Print At 1,1,"26 Iron(Fe)"
Print At 2,1,""
Case 27
Print At 1,1,"27 Cobalt(Co)"
Print At 2,1,""
Case 28
Print At 1,1,"28 Nickel(Ni)"
Print At 2,1,""
Case 29
Print At 1,1,"29 Copper(Cu)"
Print At 2,1,""
Case 30
Print At 1,1,"30 Zinc(Zn)"
Print At 2,1,""
Case 31
Print At 1,1,"31 Gallium(Ga)"
Print At 2,1,""
Case 32
Print At 1,1,"32 Germanium(Ge)"
Print At 2,1,""
Case 33
Print At 1,1,"33 Arsenic(As)"
Print At 2,1,""
Case 34
Print At 1,1,"34 Selenium(Se)"
Print At 2,1,""
Case 35
Print At 1,1,"35 Bromine(Br)"
Print At 2,1,""
Case 36
Print At 1,1,"36 Krypton(Kr)"
Print At 2,1,""
Case 37
Print At 1,1,"37 Rubidium(Rb)"
Print At 2,1,""
Case 38
Print At 1,1,"38 Strontium(Sr)"
Print At 2,1,""
Case 39
Print At 1,1,"39 Yttrium(Y)"
Print At 2,1,""
Case 40
Print At 1,1,"40 Zirconium(Zr)"
Print At 2,1,""
Case 41
Print At 1,1,"41 Niobium(Nb)"
Print At 2,1,""
Case 42
Print At 1,1,"42 Molybdenum(Mo)"
Print At 2,1,""
Case 43
Print At 1,1,"43 Technetium(Tc)"
Print At 2,1,""
Case 44
Print At 1,1,"44 Ruthenium(Ru)"
Print At 2,1,""
Case 45
Print At 1,1,"45 Rhodium(Rh)"
Print At 2,1,""
Case 46
Print At 1,1,"46 Palladium(Pd)"
Print At 2,1,""
Case 47
Print At 1,1,"47 Silver(Ag)"
Print At 2,1,""
Case 48
Print At 1,1,"48 Cadmium(Cd)"
Print At 2,1,""
Case 49
Print At 1,1,"49 Indium(In)"
Print At 2,1,""
Case 50
Print At 1,1,"50 Tin(Sn)"
Print At 2,1,""
Case 51
Print At 1,1,"51 Antimony(Sb)"
Print At 2,1,""
Case 52
Print At 1,1,"52 Tellurium(Te)"
Print At 2,1,""
Case 53
Print At 1,1,"53 Iodine(I)"
Print At 2,1,""
Case 54
Print At 1,1,"54 Xenon(Xe)"
Print At 2,1,""
Case 55
Print At 1,1,"55 Cesium(Cs)"
Print At 2,1,""
Case 56
Print At 1,1,"56 Barium(Ba)"
Print At 2,1,""
Case 57
Print At 1,1,"57 Lanthanum(La)"
Print At 2,1,""
Case 58
Print At 1,1,"58 Cerium(Ce)"
Print At 2,1,""
Case 59
Print At 1,1,"59 Praseodymium(Pr)"
Print At 2,1,""
Case 60
Print At 1,1,"60 Neodymium(Nd)"
Print At 2,1,""
Case 61
Print At 1,1,"61 Promethium(Pm)"
Print At 2,1,""
Case 62
Print At 1,1,"62 Samarium(Sm)"
Print At 2,1,""
Case 63
Print At 1,1,"63 Europium(Eu)"
Print At 2,1,""
Case 64
Print At 1,1,"64 Gadolinium(Gd)"
Print At 2,1,""
Case 65
Print At 1,1,"65 Terbium(Tb)"
Print At 2,1,""
Case 66
Print At 1,1,"66 Dysprosium(Dy)"
Print At 2,1,""
Case 67
Print At 1,1,"67 Holmium(Ho)"
Print At 2,1,""
Case 68
Print At 1,1,"68 Erbium(Er)"
Print At 2,1,""
Case 69
Print At 1,1,"69 Thulium(Tm)"
Print At 2,1,""
Case 70
Print At 1,1,"70 Ytterbium(Yb)"
Print At 2,1,""
Case 71
Print At 1,1,"71 Lutetium(Lu)"
Print At 2,1,""
Case 72
Print At 1,1,"72 Hafnium(Hf)"
Print At 2,1,""
Case 73
Print At 1,1,"73 Tantalum(Ta)"
Print At 2,1,""
Case 74
Print At 1,1,"74 Tungsten(W)"
Print At 2,1,""
Case 75
Print At 1,1,"75 Rhenium(Re)"
Print At 2,1,""
Case 76
Print At 1,1,"76 Osmium(Os)"
Print At 2,1,""
Case 77
Print At 1,1,"77 Iridium(Ir)"
Print At 2,1,""
Case 78
Print At 1,1,"78 Platinum(Pt)"
Print At 2,1,""
Case 79
Print At 1,1,"79 Gold(Au)"
Print At 2,1,""
Case 80
Print At 1,1,"80 Mercury(Hg)"
Print At 2,1,""
Case 81
Print At 1,1,"81 Thallium(Tl)"
Print At 2,1,""
Case 82
Print At 1,1,"82 Lead(Pb)"
Print At 2,1,""
Case 83
Print At 1,1,"83 Bismuth(Bi)"
Print At 2,1,""
Case 84
Print At 1,1,"84 Polonium(Po)"
Print At 2,1,""
Case 85
Print At 1,1,"85 Astatine(At)"
Print At 2,1,""
Case 86
Print At 1,1,"86 Radon(Rn)"
Print At 2,1,""
Case 87
Print At 1,1,"87 Francium(Fr)"
Print At 2,1,""
Case 88
Print At 1,1,"88 Radium(Ra)"
Print At 2,1,""
Case 89
Print At 1,1,"89 Actinium(Ac)"
Print At 2,1,""
Case 90
Print At 1,1,"90 Thorium(Th)"
Print At 2,1,""
Case 91
Print At 1,1,"91 Proactinium(Pa)"
Print At 2,1,""
Case 92
Print At 1,1,"92 Uranium(U)"
Print At 2,1,""
Case 93
Print At 1,1,"93 Neptunium(Np)"
Print At 2,1,""
Case 94
Print At 1,1,"94 Plutonium(Pu)"
Print At 2,1,""
Case 95
Print At 1,1,"95 Americium(Am)"
Print At 2,1,""
Case 96
Print At 1,1,"96 Curium(Cm)"
Print At 2,1,""
Case 97
Print At 1,1,"97 Berkelium(Bk)"
Print At 2,1,""
Case 98
Print At 1,1,"98 Californium(Cf)"
Print At 2,1,""
Case 99
Print At 1,1,"99 Einsteinium(Es)"
Print At 2,1,""
Case 100
Print At 1,1,"100 Fermium(Fm)"
Print At 2,1,""
Case 101
Print At 1,1,"101 Mendelevium(Md)"
Print At 2,1,""
Case 102
Print At 1,1,"102 Nobelium(No)"
Print At 2,1,""
Case 103
Print At 1,1,"103 Lawrencium(Lr)"
Print At 2,1,""
Case 104
Print At 1,1,"104 Rutherfordium(Rh)"
Print At 2,1,""
Case 105
Print At 1,1,"105 Dubnium(Db)"
Print At 2,1,""
Case 106
Print At 1,1,"106 Seaborgium(Sg)"
Print At 2,1,""
Case 107
Print At 1,1,"107 Bohrium(Bh)"
Print At 2,1,""
Case 108
Print At 1,1,"108 Hassium(Hs)"
Print At 2,1,""
Case 109
Print At 1,1,"109 Meitnerium(Mt)"
Print At 2,1,""
Case 110
Print At 1,1,"110 Ununnilium(Uun)"
Print At 2,1,""
Case 111
Print At 1,1,"111 Unununium(Uuu)"
Print At 2,1,""
Case 112
Print At 1,1,"112 Ununbium(Uub)"
Print At 2,1,""
Case 113
Print At 1,1,"113 Ununtrium(Uut)"
Print At 2,1,""
Case 114
Print At 1,1,"114 Ununquadium(Uuq)"
Print At 2,1,""
Case 115
Print At 1,1,"115"
Print At 2,1,""
Case 116
Print At 1,1,"116"
Print At 2,1,""
Case 117
Print At 1,1,"117"
Print At 2,1,""
Case 118
Print At 1,1,"118"








Case Else

SAY=0			'SAY'I sıfırla
EndSelect

zakbay

Bu kadar çok print kullanırsan taşma normal gibi

gördüğüm kadarıyla en uzun element

114 Ununquadium(Uuq)

boyu da 20 karakter

dim isim[20] as byte diye bir değişken tanımla

select case altındada 20 dizilik değişkene istediğin bilgiyi aşağıdaki gibi ata

select case sonunda da
tek bir
print at 1,1, isim[0],isim[1]....,isim[19] diye ekrana yazdır



isim[0] = "1"
isim[1] = "1"
isim[2] = "4"
isim[3] = " "
isim[4] = "U"
isim[5] = "n"
isim[6] = "u"
isim[7] = "n"
isim[8] = "q"
isim[9] = "u"
isim[10] = "a"
isim[11] = "d"
isim[12] = "i"
isim[13] = "u"
isim[14] = "m"
isim[15] = "("
isim[16] = "U"
isim[17] = "u"
isim[18] = "g"
isim[19] = ")"
Tek dostum çalışmak...

drmp

arkadaşım kolay gelsin  yaptığın uygulamanda bazı sabitleri eeprom'dan okuyarak hafıza olayını çözebilirsin

forumsad

eprom olayını biraz açabilirmisin

hangi proton kodlarılnı kullanıyoruz...

Ewrite-Eread
EDATA,LDATA  ile ilğili bir kaç örmek incelemiştim ama???

teşekkürler...

ilker_32

Hiç birşey yapamadıysan birkaç tl daha vererek 18F452 alabilirsin. Tabi bu bir çözüm değildir.

forumsad

18F452 hafızası daha büyükse olabilir elimde 16f877 var ama onuda alabiliriz..

ama genede harici eprom uygulamasını bir denemek isterim..

bu hususda eğitim dosyası tavsiye ederseniz sevinirim...

saygılarımla

ete

En azından LCD nin 2 satırına bir şey yazdırmıyorsun ama her birinci satır yazma komutuna ilave etmişsin. İkinci satırı yalnızca bir kere yazabilirsin.
Yada Birinci satırı Case ile sectikten sonra en sonda bir tane de boş ,
Print At 2,1,""
yazdırabilirsin. Böylece bir çok Print satırından kurutulmuş olacaksın. Dene bakalım belki kurtarır.

Ete
Bilgi hazinedir paylaştıkça büyür.            http://etepic.com

ErsinErce

Tek tek yazdırmak yerine bir döngüden istediğin veriyi çıkararak yazdırma işlemini yaparsan problemin kalmaz. Aşağıdaki örneği bir incele faydası dokunur umarım.
Label Names as Pointers

If a label's name is used in the list of values in a Cdata table, the labels address will be used. This is useful for accessing other tables of data using their address from a lookup table. See example below.

' Display text from two CDATA tables
' Based on their address located in a separate table
  
  Include "PROTON18_4.INC"            ' Use a 16-bit core device
        
  Dim ADDRESS as Word
  Dim LOOP as Word
  Dim DATA_BYTE as Byte
        
  Delayms 200                         ' Wait for PICmicro to stabilise
  Cls                                 ' Clear the LCD
  ADDRESS = CREAD ADDR_TABLE          ' Locate the address of the first string
  While 1 = 1                         ' Create an infinite loop
  DATA_BYTE = CREAD ADDRESS           ' Read each character from the CDATA string
  If DATA_BYTE = 0 Then EXIT_LOOP     ' Exit if NULL found
  Print DATA_BYTE                     ' Display the character
  Inc ADDRESS                         ' Next character
  Wend                                ' Close the loop
EXIT_LOOP:
  
  Cursor 2,1                          ' Point to line 2 of the LCD
  ADDRESS = CREAD ADDR_TABLE + 2      ' Locate the address of the second string
  While 1 = 1                         ' Create an infinite loop
  DATA_BYTE = CREAD ADDRESS           ' Read each character from the CDATA string
  If DATA_BYTE = 0 Then EXIT_LOOP2    ' Exit if NULL found
  Print DATA_BYTE                     ' Display the character
  Inc ADDRESS                         ' Next character
  Wend                                ' Close the loop
EXIT_LOOP2:
  Stop
             
ADDR_TABLE: CDATA AS WORD STRING1, STRING2 ' Table of address's
STRING1: CDATA "HELLO",0
STRING2: CDATA "WORLD",0

sovalye

hocam bu programın hazır c kodları vardı . o kodlarda 877 kullanıyordu.onlarda sorun çıkarıyor mu yoksa kendin mi denemek istedin?
bilim teknik in sitesinde ki kodlar :
[web]http://www.biltek.tubitak.gov.tr/gelisim/elektronik/dosyalar/29/periyodik_%20cetvel.C[/web]

forumsad

proton ile kendim yazmak istiyorum ordakilerden daha detaylı hazırlamak istedim..
18f452 spariş verdim yukardaki önerileri denedikten sonra birde
18f452 yi deniyeceğim  saygılarımla..