Components and supplies
Arduino UNO
LC75829
Male Header 40 Position 1 Row (0.1")
Tools and machines
Soldering iron (generic)
Project description
Code
LC75829 drive code
c_cpp
It is ready to be used with an Uno, but you need to change the ports if you use other controller. The PrintData function is responsible for displaying the data to the screen. This is the place for you if you need to change the ports. With the Print function on this display you can write 12 characters.
1// UNO 2// pin8 PB0 3// pin9 PB1 4// pin10 PB2 5 6// MEGA 7// pin8 PH5 8// pin9 PH6 9// pin10 PB4 10 11// 1 12#define Aa 43 13#define Ab 47 14#define Ac 40 15#define Ad 36 16#define Ae 32 17#define Af 35 18#define Ag 34 19#define Ah 41 20#define Ai 38 21#define Aj 42 22#define Ak 37 23#define Am 33 24#define An 39 25// 2 26#define Ba 55 27#define Bb 58 28#define Bc 56 29#define Bd 48 30#define Be 44 31#define Bf 46 32#define Bg 45 33#define Bh 57 34#define Bi 53 35#define Bj 54 36#define Bk 52 37#define Bm 49 38#define Bn 50 39// 3 40#define Ca 35+60 41#define Cb 35+67 42#define Cc 35+65 43#define Cd 35+57 44#define Ce 35+53 45#define Cf 35+55 46#define Cg 35+54 47#define Ch 35+66 48#define Ci 35+62 49#define Cj 35+63 50#define Ck 35+61 51#define Cm 35+58 52#define Cn 35+59 53// 4 54#define Da 35+79 55#define Db 35+87 56#define Dc 35+85 57#define Dd 35+77 58#define De 35+73 59#define Df 35+71 60#define Dg 35+74 61#define Dh 35+86 62#define Di 35+82 63#define Dj 35+83 64#define Dk 35+81 65#define Dm 35+78 66#define Dn 35+75 67// 5 68#define Ea 35+96 69#define Eb 35+103 70#define Ec 35+101 71#define Ed 35+93 72#define Ee 35+89 73#define Ef 35+91 74#define Eg 35+90 75#define Eh 35+102 76#define Ei 35+98 77#define Ej 35+99 78#define Ek 35+97 79#define Em 35+94 80#define En 35+95 81// 6 82#define Fa 63+112 83#define Fb 63+119 84#define Fc 63+117 85#define Fd 63+109 86#define Fe 63+105 87#define Ff 63+107 88#define Fg 63+106 89#define Fh 63+118 90#define Fi 63+114 91#define Fj 63+115 92#define Fk 63+113 93#define Fm 63+110 94#define Fn 63+111 95// 7 96#define Ga 63+128 97#define Gb 63+136 98#define Gc 63+134 99#define Gd 63+133 100#define Ge 63+122 101#define Gf 63+123 102#define Gg 63+126 103#define Gh 63+135 104#define Gi 63+130 105#define Gj 63+131 106#define Gk 63+129 107#define Gm 63+125 108#define Gn 63+127 109// 8 110#define Ha 63+144 111#define Hb 63+151 112#define Hc 63+149 113#define Hd 63+141 114#define He 63+137 115#define Hf 63+139 116#define Hg 63+138 117#define Hh 63+150 118#define Hi 63+146 119#define Hj 63+147 120#define Hk 63+145 121#define Hm 63+142 122#define Hn 63+143 123// 9 124#define Ia 95+164 125#define Ib 95+168 126#define Ic 95+161 127#define Id 95+157 128#define Ie 95+153 129#define If 95+156 130#define Ig 95+155 131#define Ih 95+162 132#define Ii 95+159 133#define Ij 95+163 134#define Ik 95+158 135#define Im 95+154 136#define In 95+160 137// 10 138#define Ja 95+176 139#define Jb 95+179 140#define Jc 95+177 141#define Jd 95+165 142#define Je 95+166 143#define Jf 95+172 144#define Jg 95+170 145#define Jh 95+178 146#define Ji 95+174 147#define Jj 95+175 148#define Jk 95+173 149#define Jm 95+169 150#define Jn 95+171 151// 11 152#define Ka 95+188 153#define Kb 95+196 154#define Kc 95+194 155#define Kd 95+185 156#define Ke 95+181 157#define Kf 95+183 158#define Kg 95+182 159#define Kh 95+195 160#define Ki 95+190 161#define Kj 95+191 162#define Kk 95+189 163#define Km 95+186 164#define Kn 95+187 165// 12 166#define La 95+204 167#define Lb 95+208 168#define Lc 95+205 169#define Ld 95+193 170#define Le 95+197 171#define Lf 95+200 172#define Lg 95+199 173#define Lh 95+206 174#define Li 95+202 175#define Lj 95+207 176#define Lk 95+201 177#define Lm 95+198 178#define Ln 95+203 179 180int aa[13] = {Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La}; 181int bb[13] = {Ab,Bb,Cb,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1, 1,0,0,0,0,0,1,0, 1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1, 0,0,0,0,0,0,0,0, 0,0,0, 0,0,0, 0,0, 0,0,0, 0,0,0, 1,0, 1,0,0,0,0,0,1,0, 1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1, 0,0,0, 0,0,0, 0,0, 0,0,0, 0,0,0, 1,1}; 196// 1 17 21 26 31 36 46 51 53 61 71 81 91 101 105 111 121 131 141 151 153 161 171 181 191 201 197 198#define CLK 8 199#define CE 9 200#define DATA 10 201 202int tick = 0; 203 204void setup() { 205 pinMode(CLK, OUTPUT); 206 pinMode(CE, OUTPUT); 207 pinMode(DATA, OUTPUT); 208 digitalWrite(CLK, 0); 209 digitalWrite(CE, 0); 210 digitalWrite(DATA, 0); 211 delay(30); 212 ClearDisplay(); 213 214} 215 216void loop() { 217 ClearDisplay(); 218 delay(50); 219 FillDisplayOne(); 220 delay(50); 221 ClearDisplayOne(); 222 delay(50); 223 Print("ARDUINO "); 224 delay(1000); 225} 226 227void PrintData(){ 228 tick = 1; 229 230 comehere: 231 232 if(data[tick-1] == 0){ 233 PORTB = PORTB & B11111011; // DATA DOWN 234 PORTB = PORTB | B00000001; // CLK UP 235 } 236 else{ 237 PORTB = PORTB | B00000100; // DATA UP 238 PORTB = PORTB | B00000001; // CLK UP 239 } 240 delayMicroseconds(1); 241 if(tick == 8 || tick == 88 || tick == 168 || tick == 248){ 242 PORTB = PORTB | B00000010; // CE UP 243 delayMicroseconds(1); 244 } 245 246 if(tick == 80 || tick == 160 || tick == 240){ 247 PORTB = PORTB & B11111101; // CE DOWN 248 delayMicroseconds(1); 249 } 250 251 PORTB = PORTB & B11111110; // CLK DOWN 252 253 if(tick < 320){ 254 tick++; 255 goto comehere; 256 } 257 258 PORTB = PORTB & B11111101; // CE DOWN 259 delay(10); 260} 261 262void FillDisplay(){ 263 for(int j = 24; j <= 59; j++){ 264 data[j] = 1; 265 //PrintData(); 266 } 267 for(int j = 88; j <= 139; j++){ 268 data[j] = 1; 269 //PrintData(); 270 } 271 for(int j = 168; j <= 215; j++){ 272 data[j] = 1; 273 //PrintData(); 274 } 275 for(int j = 248; j <= 303; j++){ 276 data[j] = 1; 277 //PrintData(); 278 } 279 PrintData(); 280} 281 282void FillDisplayOne(){ 283 for(int j = 24; j <= 59; j++){ 284 data[j] = 1; 285 PrintData(); 286 } 287 for(int j = 88; j <= 139; j++){ 288 data[j] = 1; 289 PrintData(); 290 } 291 for(int j = 168; j <= 215; j++){ 292 data[j] = 1; 293 PrintData(); 294 } 295 for(int j = 248; j <= 303; j++){ 296 data[j] = 1; 297 PrintData(); 298 } 299 //PrintData(); 300} 301 302void ClearDisplay(){ 303 for(int j = 24; j <= 59; j++){ 304 data[j] = 0; 305 //PrintData(); 306 } 307 for(int j = 88; j <= 139; j++){ 308 data[j] = 0; 309 //PrintData(); 310 } 311 for(int j = 168; j <= 215; j++){ 312 data[j] = 0; 313 //PrintData(); 314 } 315 for(int j = 248; j <= 303; j++){ 316 data[j] = 0; 317 //PrintData(); 318 } 319 PrintData(); 320} 321 322void ClearDisplayOne(){ 323 for(int j = 24; j <= 59; j++){ 324 data[j] = 0; 325 PrintData(); 326 } 327 for(int j = 88; j <= 139; j++){ 328 data[j] = 0; 329 PrintData(); 330 } 331 for(int j = 168; j <= 215; j++){ 332 data[j] = 0; 333 PrintData(); 334 } 335 for(int j = 248; j <= 303; j++){ 336 data[j] = 0; 337 PrintData(); 338 } 339 //PrintData(); 340} 341 342void Print(char toprint[13]){ // must be 12 characters 343 for(int j = 24; j <= 59; j++){ 344 data[j] = 0; 345 } 346 for(int j = 88; j <= 139; j++){ 347 data[j] = 0; 348 } 349 for(int j = 168; j <= 215; j++){ 350 data[j] = 0; 351 } 352 for(int j = 248; j <= 303; j++){ 353 data[j] = 0; 354 } 355 for(int j = 0; j <= 11; j++){ 356 if(toprint[j] == 'A' || toprint[j] == 'a'){ 357 AA(j); 358 BB(j); 359 CC(j); 360 EE(j); 361 FF(j); 362 GG(j); 363 HH(j); 364 } 365 if(toprint[j] == 'B' || toprint[j] == 'b'){ 366 AA(j); 367 BB(j); 368 CC(j); 369 DD(j); 370 EE(j); 371 FF(j); 372 GG(j); 373 HH(j); 374 } 375 if(toprint[j] == 'C' || toprint[j] == 'c'){ 376 AA(j); 377 DD(j); 378 EE(j); 379 FF(j); 380 } 381 if(toprint[j] == 'D' || toprint[j] == 'd'){ 382 BB(j); 383 CC(j); 384 DD(j); 385 EE(j); 386 GG(j); 387 HH(j); 388 } 389 if(toprint[j] == 'E' || toprint[j] == 'e'){ 390 AA(j); 391 DD(j); 392 EE(j); 393 FF(j); 394 GG(j); 395 HH(j); 396 } 397 if(toprint[j] == 'F' || toprint[j] == 'f'){ 398 AA(j); 399 EE(j); 400 FF(j); 401 GG(j); 402 HH(j); 403 } 404 if(toprint[j] == 'G' || toprint[j] == 'g'){ 405 AA(j); 406 CC(j); 407 DD(j); 408 EE(j); 409 FF(j); 410 HH(j); 411 } 412 if(toprint[j] == 'H' || toprint[j] == 'h'){ 413 BB(j); 414 CC(j); 415 EE(j); 416 FF(j); 417 GG(j); 418 HH(j); 419 } 420 if(toprint[j] == 'I' || toprint[j] == 'i'){ 421 II(j); 422 } 423 if(toprint[j] == 'J' || toprint[j] == 'j'){ 424 BB(j); 425 CC(j); 426 DD(j); 427 EE(j); 428 } 429 if(toprint[j] == 'K' || toprint[j] == 'k'){ 430 EE(j); 431 FF(j); 432 GG(j); 433 JJ(j); 434 KK(j); 435 } 436 if(toprint[j] == 'L' || toprint[j] == 'l'){ 437 DD(j); 438 EE(j); 439 FF(j); 440 } 441 if(toprint[j] == 'M' || toprint[j] == 'm'){ 442 BB(j); 443 CC(j); 444 EE(j); 445 FF(j); 446 JJ(j); 447 NN(j); 448 } 449 if(toprint[j] == 'N' || toprint[j] == 'n'){ 450 BB(j); 451 CC(j); 452 EE(j); 453 FF(j); 454 KK(j); 455 NN(j); 456 } 457 if(toprint[j] == 'O' || toprint[j] == 'o'){ 458 AA(j); 459 BB(j); 460 CC(j); 461 DD(j); 462 EE(j); 463 FF(j); 464 } 465 if(toprint[j] == 'P' || toprint[j] == 'p'){ 466 AA(j); 467 BB(j); 468 EE(j); 469 FF(j); 470 GG(j); 471 HH(j); 472 } 473 if(toprint[j] == 'Q' || toprint[j] == 'q'){ 474 AA(j); 475 BB(j); 476 CC(j); 477 DD(j); 478 EE(j); 479 FF(j); 480 KK(j); 481 } 482 if(toprint[j] == 'R' || toprint[j] == 'r'){ 483 AA(j); 484 BB(j); 485 EE(j); 486 FF(j); 487 GG(j); 488 HH(j); 489 KK(j); 490 } 491 if(toprint[j] == 'S' || toprint[j] == 's'){ 492 AA(j); 493 CC(j); 494 DD(j); 495 FF(j); 496 GG(j); 497 HH(j); 498 } 499 if(toprint[j] == 'T' || toprint[j] == 't'){ 500 AA(j); 501 II(j); 502 } 503 if(toprint[j] == 'U' || toprint[j] == 'u'){ 504 BB(j); 505 CC(j); 506 DD(j); 507 EE(j); 508 FF(j); 509 } 510 if(toprint[j] == 'V' || toprint[j] == 'v'){ 511 EE(j); 512 FF(j); 513 JJ(j); 514 MM(j); 515 } 516 if(toprint[j] == 'W' || toprint[j] == 'w'){ 517 BB(j); 518 CC(j); 519 EE(j); 520 FF(j); 521 KK(j); 522 MM(j); 523 } 524 if(toprint[j] == 'X' || toprint[j] == 'x'){ 525 JJ(j); 526 KK(j); 527 MM(j); 528 NN(j); 529 } 530 if(toprint[j] == 'Y' || toprint[j] == 'y'){ 531 BB(j); 532 CC(j); 533 DD(j); 534 FF(j); 535 GG(j); 536 HH(j); 537 } 538 if(toprint[j] == 'Z' || toprint[j] == 'z'){ 539 AA(j); 540 DD(j); 541 JJ(j); 542 MM(j); 543 } 544 if(toprint[j] == '0'){ 545 AA(j); 546 BB(j); 547 CC(j); 548 DD(j); 549 EE(j); 550 FF(j); 551 } 552 if(toprint[j] == '1'){ 553 BB(j); 554 CC(j); 555 } 556 if(toprint[j] == '2'){ 557 AA(j); 558 BB(j); 559 DD(j); 560 EE(j); 561 GG(j); 562 HH(j); 563 } 564 if(toprint[j] == '3'){ 565 AA(j); 566 BB(j); 567 CC(j); 568 DD(j); 569 GG(j); 570 HH(j); 571 } 572 if(toprint[j] == '4'){ 573 BB(j); 574 CC(j); 575 FF(j); 576 GG(j); 577 HH(j); 578 } 579 if(toprint[j] == '5'){ 580 AA(j); 581 CC(j); 582 DD(j); 583 FF(j); 584 GG(j); 585 HH(j); 586 } 587 if(toprint[j] == '6'){ 588 AA(j); 589 CC(j); 590 DD(j); 591 EE(j); 592 FF(j); 593 GG(j); 594 HH(j); 595 } 596 if(toprint[j] == '7'){ 597 AA(j); 598 BB(j); 599 CC(j); 600 } 601 if(toprint[j] == '8'){ 602 AA(j); 603 BB(j); 604 CC(j); 605 DD(j); 606 EE(j); 607 FF(j); 608 GG(j); 609 HH(j); 610 } 611 if(toprint[j] == '9'){ 612 AA(j); 613 BB(j); 614 CC(j); 615 DD(j); 616 FF(j); 617 GG(j); 618 HH(j); 619 } 620 if(toprint[j] == ' '){ 621 } 622 623 /* 624 625 if(toprint[j] == ''){ 626 AA(j); 627 BB(j); 628 CC(j); 629 DD(j); 630 EE(j); 631 FF(j); 632 GG(j); 633 HH(j); 634 II(j); 635 JJ(j); 636 KK(j); 637 MM(j); 638 NN(j); 639 } 640 641 */ 642 } 643 PrintData(); 644} 645 646void AA(int x){ 647 data[aa[x]] = 1; 648} 649 650void BB(int x){ 651 data[bb[x]] = 1; 652} 653 654void CC(int x){ 655 data[cc[x]] = 1; 656} 657 658void DD(int x){ 659 data[dd[x]] = 1; 660} 661 662void EE(int x){ 663 data[ee[x]] = 1; 664} 665 666void FF(int x){ 667 data[ff[x]] = 1; 668} 669 670void GG(int x){ 671 data[gg[x]] = 1; 672} 673 674void HH(int x){ 675 data[hh[x]] = 1; 676} 677 678void II(int x){ 679 data[ii[x]] = 1; 680} 681 682void JJ(int x){ 683 data[jj[x]] = 1; 684} 685 686void KK(int x){ 687 data[kk[x]] = 1; 688} 689 690void MM(int x){ 691 data[mm[x]] = 1; 692} 693 694void NN(int x){ 695 data[nn[x]] = 1; 696} 697 698void Setbit(int x){ 699 data[x] = 1; 700} 701 702void Resetbit(int x){ 703 data[x] = 0; 704} 705 706
Comments
Only logged in users can leave comments
pdio
0 Followers
•0 Projects
Table of contents
Intro
2
0