Periodic table for HP Prime
#1

Hi all,

Here is a periodic table of elements for HP Prime !

Enjoy

Download
Documentation
Video

#2

Really neat.

#3

Nice, but things have become so much more complicated recently.

- Pauli

#4

Thanks for sharing. It would be interesting to add the option to browse through the table to select the element. I'm trying to do this in a program but I have not gotten it to work well yet. A little help on programming with cursors and pointers in HP Prime would be welcome.
Regards

#5

Very nice!

#6

Awesome! Good job!

#7

Yes! Very nice and thanks!

#8

:) LOL

Edited: 19 Oct 2013, 11:06 a.m.

#9

Hi Mic,

Great work, go ahead !!
jose

#10

Haha, great !

#11

Here you go. Thanks Mic for the great starting point for this example.

That puts all the drawing into a single draw function, uses a program variable rather then globals for data, allows clicking on an element, and dragging the table.

Still plenty rough as there are not any error checks or limits, but should provide a good starting point.

======================================
symbol:={"H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu",
"Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba",
"La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi",
"Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Db","Sg","Bh","Hs","Mt","Ds","Rg","Cn"};

l0:={1,16,3,10,8,10,72,27,14,4,14,0};
//color
m1:={#00EE00,#66AAFF,#FFAA00,#F3F300,#FFC1DC,#00DDBB,#FF93C2,#99BBAA,#B2AAFF,#B2F0FF};

m2:={1,2,3,4,7,1,1,1,8,2,3,4,6,7,1,1,8,2,3,4,5,5,5,5,5,5,5,5,5,5,6,7
,7,1,8,2,3,4,5,5,5,5,5,5,5,5,5,5,6,6,7,7,8,2,3,4,9,9,9,9,9,9,9,9,9,9
,9,9,9,9,9,5,5,5,5,5,5,5,5,5,6,6,6,7,8,2,3,4,10,10,10,10,10,10,10,10
,10,10,10,10,10,10,10,5,5,5,5,5,5,5,5,5};

//position
position:= [
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 ],
3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, 8, 9, 10,
11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89,104,105,106,107,108,109,110,111,112, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 0,
0, 0, 0, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103, 0
];

startX:=2,startY:=2,width:=22,height:=21;

offset:=0; //offest for graphical shift
selEl:=1; //selected element

DrawTable()
begin
DIMGROB_P(G1,320,220); RECT(G1);
local x:=startX-offset,y:=startY,i,j;
local tablePos=1;
for j:=1 to 10 do
for i:=1 to 18 do
if tablePos:=position(j,i) then
RECT_P(G1,x,y,x+width,y+height,RGB(0,0,0),m1(m2(tablePos)));
if selEl== tablePos then
RECT_P(G1,x+1,y+1,x+width-1,y+height-1,RGB(0,0,0),RGB(0,0,0,255));
end;
TEXTOUT_P(tablePos,G1,x+2,y+1,1);
TEXTOUT_P(symbol(tablePos),G1,x+8,y+10,1);
end;
x:=x+width;
end;
x:=x-18*width;
y:=y+height;
end;
x:=2*width-offset+width/4+startX; y:=7*height+startY;

LINE_P(G1,x,y,x,y+2*height+height/2);
LINE_P(G1,x,y+2*height+height/2,x+width*3/4,y+2*height+height/2);
x:=x+width/2;
LINE_P(G1,x,y,x,y+height+height/2);
LINE_P(G1,x,y+height+height/2,x+width/4,y+height+height/2);
blit_p(G0,G1);
end;

FindEl(x,y)
begin
local el,tempX:=(x-startX+offset)/width,tempY:=(y-startY)/height;

return position(ip(tempY)+1,ip(tempX)+1);
end;

EXPORT elements()
BEGIN
DrawTable();
DRAWMENU("1");
local touch;
WHILE 1 DO
blit_p(G0,G1,0,0);
touch:=mouse();
if size(touch(1)) then //something in our mouse
case
if touch(1,5)==0 then //touch
local el:= FindEl(touch(1,1),touch(1,2));
if el then
selEl:=el;
DrawTable();
end;
end;
if touch(1,5)==1 then "incomplete" end;
if touch(1,5)==2 then //drag
offset:=touch(1,3)-touch(1,1);
DrawTable();
end;
if touch(1,5)==3 then return "stretch"; end;
if touch(1,5)==4 then return "rotate"; end;
if touch(1,5)==5 then return "long click"; end;
end;
end;
END;
END;

=============================================

TW

Edited: 19 Oct 2013, 2:21 p.m.

#12

It's wonderful that you've enlightened us by sharing what appears to be a rare and well preserved piece of previously unseen scientific history.

#13

Great Tim !

However, there is a little bug, when you come back on the 1st page with a drag, the screen becomes white.

Can you explain how to detect clicks on the menu buttons ?


Edited: 20 Oct 2013, 3:25 a.m.

#14

I added code : when you keep ENTER key pressed down on an element, informations about it are displayed. I also added ESC key.

symbol:={"H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu",
"Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba",
"La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi",
"Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Db","Sg","Bh","Hs","Mt","Ds","Rg","Cn"};
l2:={"Hydrogène","Hélium","Lithium","Béryllium","Bore","Carbone","Azote","Oxygène","Fluor","Néon","Sodium","Magnésium","Aluminium","Silicium","Phosphore","Soufre","Chlore","Argon","Potassium","Calcium","Scandium","Titane","Vanadium","Chrome","Manganèse","Fer","Cobalt","Nickel","Cuivre","Zinc","Gallium","Germanium","Arsenic","Sélénium","Brome","Krypton","Rubidium","Strontium","Yttrium","Zirconium","Niobium","Molybdène","Technétium","Ruthénium","Rhodium","Palladium","Argent","Cadmium","Indium","Etain","Antimoine","Tellure","Iode","Xénon","Césium","Baryum","Lanthane","Cérium","Praséodyme","Néodyme","Prométhium","Samarium","Europium","Gadolinium","Terbium","Dysprosium","Holmium","Erbium","Thulium","Ytterbium","Lutétium","Hafnium","Tantale","Tungstène","Rhénium","Osmium","Iridium","Platine","Or","Mercure","Thallium","Plomb","Bismuth","Polonium","Astate","Radon","Francium","Radium","Actinium","Thorium","Protactinium","Uranium","Neptunium","Plutonium","Américium","Curium","Berkélium","Californium","Einsteinium","Fermium","Mendélévium","Nobélium","Lawrencium","Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium","Roentgenium","Copernicium"};
//masse molaire
l3:={1,4,6.9,9,10.8,12,14,16,19,20.2,23,24.3,27,28.1,31,32.1,35.5,39.9,39.1,40.1,45.0,47.9,50.9,52.0,54.9,55.8,58.9,58.7,63.5,65.4,69.7,72.6,74.9,79,79.9,83.8,85.5,87.6,88.9,91.2,92.9,95.9,98.9,101.1,102.9,106.4,107.9,112.4,114.8,118.7,121.8,127.6,126.9,131.3,132.9,137.3,138.9,140.1,140.9,144.2,145,150.4,152,157.3,158.9,162.5,164.9,167.3,168.9,173,175,178.5,180.9,183.9,186.2,190.2,192.2,195.1,197,200.6,204.4,207.2,209,209,210,222,223,226,227,232,231,238,237,244,243,247,247,251,252,257,258,259,260,261,262,263,262,265,266,269,280,285};
//densité
l4:={0.0000899,0.0001785,0.535,1.848,2.46,2.26,0.001251,0.001429,0.001696,0.0009,0.968,1.738,2.7,2.33,1.823,1.96,0.003214,0.001784,0.856,1.55,2.985,4.507,6.11,7.14,7.47,7.874,8.9,8.908,8.92,7.14,5.904,5.323,5.727,4.819,3.12,0.00375,1.532,2.63,4.472,6.511,8.57,10.28,11.5,12.37,12.45,12.023,10.49,8.65,7.31,7.31,6.697,6.24,4.94,0.0059,1.879,3.51,6.146,6.689,6.64,7.01,7.264,7.353,5.244,7.901,8.219,8.551,8.795,9.066,9.321,6.57,9.841,13.31,16.65,19.25,21.02,22.59,22.56,21.09,19.3,13.534,11.85,11.34,9.78,9.196,0,0.00973,0,5,10.07,11.724,15.37,19.05,20.45,19.816,0,13.51,14.78,15.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//rayon
l5:={53,31,167,112,87,67,56,48,42,38,190,145,118,111,98,88,79,71,243,194,184,176,171,166,161,156,152,149,145,142,136,125,114,103,94,88,265,219,212,206,198,190,183,178,173,169,165,161,156,145,133,123,115,108,298,253,195,158,247,206,205,238,231,233,225,228,226,226,222,222,217,208,200,193,188,185,180,177,174,171,156,154,143,135,127,120,0,215,195,180,180,175,175,175,175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//électronégativité
l6:={2.2,0,0.98,1.57,2.04,2.55,3.04,3.44,3.9,0,0.93,1.31,1.61,1.9,2.19,2.58,3.16,0,0.82,1,1.36,1.54,1.63,1.66,1.55,1.83,1.88,1.91,1.9,1.65,1.81,2.01,2.18,2.55,2.96,0,0.82,0.95,1.22,1.33,1.6,2.16,2.1,2.2,2.28,2.2,1.93,1.69,1.78,1.96,2.05,2.1,2.66,0,0.79,0.89,1.1,1.12,1.13,1.14,0,1.17,0,1.2,0,1.22,1.23,1.24,1.25,0,1,1.3,1.5,1.7,1.9,2.2,2.2,2.2,2.4,1.9,1.8,1.8,1.9,2,2.2,0,0.7,0.9,1.1,1.3,1.5,1.7,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,0,0,0,0,0,0,0,0,0,0};
//fusion
l7:={−259,0,181,1278,2300,3370,−210,−218,−220,−249,98,649,660,1410,44,119,−101,−189,64,840,1539,1660,1890,1860,1224,1535,1495,1453,1083,420,30,937,0,217,−7,−157,39,769,1520,1852,2470,2617,2172,2310,1966,1552,962,321,157,232,631,450,114,−112,28,725,920,798,931,1010,1168,1070,822,1211,1360,1412,1474,1522,1500,824,1656,2230,2996,3410,3180,3050,2410,1772,1067,−39,304,328,271,254,302,−71,27,700,1050,1750,1600,1132,640,641,994,1340,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//ébullition
l8:={−253,−269,1347,2970,2550,4827,−196,−183,−188,−246,883,1090,2467,2355,280,445,−35,−186,774,1484,2832,3287,3380,2672,1962,2750,2870,2732,2567,907,2403,2830,613,685,59,−152,688,1384,3337,4377,4742,4612,4877,3900,3700,3140,2212,765,2080,2260,1750,990,184,−107,678,1640,3454,3257,3212,3127,2460,1778,1597,3233,3041,2562,2695,2510,1727,1193,3315,4602,5400,5660,5627,5030,4130,3800,2807,357,1460,1740,1560,962,337,−62,677,1140,3200,4790,0,3818,3902,3232,2607,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//découverte
l9:={1766,1895,1817,1798,1808,0,1772,1774,1886,1898,1807,1755,1827,1824,1669,0,1774,1894,1807,1808,1878,1791,1801,1797,1774,0,1735,1751,0,0,1875,1886,0,1817,1826,1898,1861,1808,1794,1789,1801,1782,1937,1844,1803,1803,0,1817,1863,0,0,1782,1811,1898,1860,1808,1839,1803,1885,1885,1945,1879,1901,1880,1843,1886,1878,1842,1879,1878,1907,1923,1802,1783,1925,1803,1803,1735,0,0,1861,0,0,1898,1940,1900,1939,1898,1899,1828,1913,1789,1940,1940,1944,1944,1949,1950,1952,1952,1955,1958,1961,1964,1967,1974,1981,1984,1982,1994,1994,1996};

l0:={1,16,3,10,8,10,72,27,14,4,14,0};
//color
m1:={#00EE00,#66AAFF,#FFAA00,#F3F300,#FFC1DC,#00DDBB,#FF93C2,#99BBAA,#B2AAFF,#B2F0FF};


m2:={1,2,3,4,7,1,1,1,8,2,3,4,6,7,1,1,8,2,3,4,5,5,5,5,5,5,5,5,5,5,6,7
,7,1,8,2,3,4,5,5,5,5,5,5,5,5,5,5,6,6,7,7,8,2,3,4,9,9,9,9,9,9,9,9,9,9
,9,9,9,9,9,5,5,5,5,5,5,5,5,5,6,6,6,7,8,2,3,4,10,10,10,10,10,10,10,10
,10,10,10,10,10,10,10,5,5,5,5,5,5,5,5,5};


//position
position:= [
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 ],
3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, 8, 9, 10,
11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89,104,105,106,107,108,109,110,111,112, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 0,
0, 0, 0, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103, 0
];


startX:=2,startY:=2,width:=22,height:=21;


offset:=0; //offest for graphical shift
selEl:=1; //selected element


DrawTable()
begin
DIMGROB_P(G1,320,220); RECT(G1);
local x:=startX-offset,y:=startY,i,j;
local tablePos=1;
for j:=1 to 10 do
for i:=1 to 18 do
if tablePos:=position(j,i) then
RECT_P(G1,x,y,x+width,y+height,RGB(0,0,0),m1(m2(tablePos)));
if selEl== tablePos then
RECT_P(G1,x+1,y+1,x+width-1,y+height-1,RGB(0,0,0),RGB(0,0,0,255));
end;
TEXTOUT_P(tablePos,G1,x+2,y+1,1);
TEXTOUT_P(symbol(tablePos),G1,x+8,y+10,1);
end;
x:=x+width;
end;
x:=x-18*width;
y:=y+height;
end;
x:=2*width-offset+width/4+startX; y:=7*height+startY;


LINE_P(G1,x,y,x,y+2*height+height/2);
LINE_P(G1,x,y+2*height+height/2,x+width*3/4,y+2*height+height/2);
x:=x+width/2;
LINE_P(G1,x,y,x,y+height+height/2);
LINE_P(G1,x,y+height+height/2,x+width/4,y+height+height/2);
blit_p(G0,G1);
end;


FindEl(x,y)
begin
local el,tempX:=(x-startX+offset)/width,tempY:=(y-startY)/height;


position(ip(tempY)+1,ip(tempX)+1)▶B;
return B;
end;


EXPORT elements()
BEGIN
DrawTable();
DRAWMENU({"","Fiche","Aide","Quitter"});
local touch;
WHILE 1 DO
blit_p(G0,G1,0,0);
touch:=mouse();

if ISKEYDOWN(4) THEN BREAK; END;
if ISKEYDOWN(30) THEN
RECT_P(G0);
TEXTOUT_P(symbol(B),G0,180,2,3,RGB(255,105,0));
TEXTOUT_P(l2[B],G0,7,2,3,RGB(255,0,110));
TEXTOUT_P(B,G0,210,2,3,RGB(38,127,0));
IF (B==43 OR B==61 OR (93&#8804;B AND B&#8804;112)) THEN TEXTOUT_P("Elément de synthèse",G0,10,22,1); ELSE IF l8[B]<26 AND l8[B] THEN TEXTOUT_P("Etat gazeux à 25°C",G0,10,22,1); END;
IF (l7[B]<26 AND l7[B] AND l8[B]>25) THEN TEXTOUT_P("Etat liquide à 25°",G0,10,22,1); END;
IF l7[B]>26 OR B==33 THEN TEXTOUT_P("Etat solide à 25°C",G0,10,22,1); END;
TEXTOUT_P("Masse molaire: ",G0,10,34,1,RGB(0,124,240));
TEXTOUT_P(l3[B]+" g.mol&#57348;",G0,105,34,1);
TEXTOUT_P("Densité: ",G0,10,46,1,RGB(0,124,240));
TEXTOUT_P(IFTE(l4[B],l4[B],"inconnu"),G0,105,46,1);
TEXTOUT_P("Rayon atomique:",G0,10,58,1,RGB(0,124,240));
TEXTOUT_P(IFTE(l5[B],l5[B]+" pm","inconnu"),G0,105,58,1);
TEXTOUT_P("Electronégativité: ",G0,10,70,1,RGB(0,124,240));
TEXTOUT_P(IFTE(l6[B],l6[B],"inexistante ou inconnue"),G0,105,70,1);
TEXTOUT_P("Point de fusion:",G0,10,82,1,RGB(0,124,240));
TEXTOUT_P(IFTE(l7[B],l7[B]+"°C","inexistant ou inconnu"),G0,105,82,1);
TEXTOUT_P("Point d'ébullition:",G0,10,94,1,RGB(0,124,240));
TEXTOUT_P(IFTE(l8[B],l8[B]+"°C","inconnu"),G0,105,94,1);
TEXTOUT_P("Découverte:",G0,10,106,1,RGB(0,124,240));
TEXTOUT_P(IFTE(l9[B],l9[B],"antique"),G0,105,106,1);
TEXTOUT_P("&#1161; Elements &#1161; HP Prime",G0,200,215,1,RGB(255,0,110));
TEXTOUT_P("Par Marc Coudriau, Mickaël Nicotera & Tim Wessman",G0,70,228,1,RGB(65,65,65));
elements()
END;
END;
if size(touch(1)) then //something in our mouse
case
if touch(1,5)==0 then //touch
local el:= FindEl(touch(1,1),touch(1,2));
if el then
selEl:=el;
DrawTable();
end;
end;
if touch(1,5)==1 then "incomplete" end;
if touch(1,5)==2 then //drag
offset:=touch(1,3)-touch(1,1);
DrawTable();
end;
if touch(1,5)==3 then return "stretch"; end;
if touch(1,5)==4 then return "rotate"; end;
if touch(1,5)==5 then return "long click"; end;
end;
end;
END;
END;



Edited: 20 Oct 2013, 3:26 a.m.

#15

The sequence &#8722; should be replaced by a minus sign.

Edit: Answer to wrong post within thread, but anyway...

There are a few more Unicode characters mangled by the forum software:

&#8804; is <=

&#57348; is a Prime special character (which I cant identify in the moment)

&#1161; is a Cyrillic character (just a decoration in this case).

I've had some trouble geting the program to run on the emulator. Clicking in the image still produces some errors.


Edited: 20 Oct 2013, 9:38 a.m.

#16

Quote:
&#57348; is a Prime special character (which I cant identify in the moment)

It's the ^-1 character, obtained by pressing Shift divide, or CHAR(57348).



Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime touch periodic table : new version Mic 4 1,972 11-25-2013, 05:29 PM
Last Post: Terje Vallestad
  Touch periodic table on HP Prime - revisited Terje Vallestad 2 1,390 11-23-2013, 11:47 AM
Last Post: Mic
  Touch periodic table on HP Prime Mic 30 8,714 10-27-2013, 04:45 AM
Last Post: Les Koller
  HP41 Functions Address Table (F.A.T.) Antoine M. Couëtte 6 2,148 07-21-2013, 02:48 AM
Last Post: Antoine M. Couëtte
  The first periodic table of elements for HP39gII Mic 0 902 11-08-2012, 06:55 AM
Last Post: Mic
  Variation table for HP39gII Mic 15 4,333 08-13-2012, 05:05 PM
Last Post: Bunuel66
  34s: Anyone have an instruction timing table? Gene Wright 15 3,849 07-19-2011, 11:28 PM
Last Post: Paul Dale
  wp34S Flag Table via STATUS Jake Schwartz 4 1,570 06-30-2011, 05:17 AM
Last Post: Paul Dale
  Exporting Table Values to Stack Hal Bitton in Boise 1 953 06-28-2009, 10:19 PM
Last Post: Tim Wessman
  50G, Plot-Table-Printing to 82240 IR printer George Bailey (Bedford Falls) 5 1,664 08-11-2008, 12:25 PM
Last Post: George Bailey (Bedford Falls)

Forum Jump: