Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Afficheur.cpp@7:b1b4db3eedb4, 2017-09-05 (annotated)
- Committer:
- ThierryLeonard
- Date:
- Tue Sep 05 09:50:38 2017 +0000
- Revision:
- 7:b1b4db3eedb4
- Parent:
- 2:3576839565ae
- Child:
- 8:5124be43c963
rip;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ThierryLeonard | 2:3576839565ae | 1 | |
| ThierryLeonard | 2:3576839565ae | 2 | |
| ThierryLeonard | 2:3576839565ae | 3 | #include "Afficheur.h" |
| ThierryLeonard | 7:b1b4db3eedb4 | 4 | #ifdef USESPI |
| ThierryLeonard | 2:3576839565ae | 5 | Afficheur::Afficheur():afficheur(p5,p6,p7),chipSelect(p8) |
| ThierryLeonard | 2:3576839565ae | 6 | { |
| ThierryLeonard | 2:3576839565ae | 7 | afficheur.format(8,0); |
| ThierryLeonard | 2:3576839565ae | 8 | afficheur.frequency(50000); |
| ThierryLeonard | 2:3576839565ae | 9 | chipSelect = 0; |
| ThierryLeonard | 2:3576839565ae | 10 | } |
| ThierryLeonard | 7:b1b4db3eedb4 | 11 | #else |
| ThierryLeonard | 7:b1b4db3eedb4 | 12 | Afficheur::Afficheur():afficheur(),chipSelect(p8) |
| ThierryLeonard | 7:b1b4db3eedb4 | 13 | { |
| ThierryLeonard | 7:b1b4db3eedb4 | 14 | chipSelect = 1; |
| ThierryLeonard | 7:b1b4db3eedb4 | 15 | } |
| ThierryLeonard | 7:b1b4db3eedb4 | 16 | #endif |
| ThierryLeonard | 2:3576839565ae | 17 | void Afficheur::write(char* characters,int length ) |
| ThierryLeonard | 2:3576839565ae | 18 | { |
| ThierryLeonard | 7:b1b4db3eedb4 | 19 | char buf[20]; |
| ThierryLeonard | 7:b1b4db3eedb4 | 20 | //resetDisplay(); |
| ThierryLeonard | 2:3576839565ae | 21 | afficheur.write(characters,length,buf,20); |
| ThierryLeonard | 2:3576839565ae | 22 | } |
| ThierryLeonard | 2:3576839565ae | 23 | void Afficheur::write(char ch) |
| ThierryLeonard | 2:3576839565ae | 24 | { |
| ThierryLeonard | 7:b1b4db3eedb4 | 25 | char buf[1]; |
| ThierryLeonard | 2:3576839565ae | 26 | afficheur.write(&ch,1,buf,1); |
| ThierryLeonard | 2:3576839565ae | 27 | } |
| ThierryLeonard | 2:3576839565ae | 28 | void Afficheur::resetDisplay() |
| ThierryLeonard | 2:3576839565ae | 29 | { |
| ThierryLeonard | 2:3576839565ae | 30 | char buf[1]; |
| ThierryLeonard | 2:3576839565ae | 31 | afficheur.write("v",1,buf,1); |
| ThierryLeonard | 2:3576839565ae | 32 | } |
| ThierryLeonard | 2:3576839565ae | 33 | void Afficheur::showDot() |
| ThierryLeonard | 2:3576839565ae | 34 | { |
| ThierryLeonard | 2:3576839565ae | 35 | char command[2] = {'w',2}; |
| ThierryLeonard | 2:3576839565ae | 36 | char buf[2]; |
| ThierryLeonard | 2:3576839565ae | 37 | afficheur.write(command,2,buf, 2); |
| ThierryLeonard | 2:3576839565ae | 38 | } |
| ThierryLeonard | 2:3576839565ae | 39 | void Afficheur::hideDot() |
| ThierryLeonard | 2:3576839565ae | 40 | { |
| ThierryLeonard | 2:3576839565ae | 41 | char command[2] = {'w',0}; |
| ThierryLeonard | 2:3576839565ae | 42 | char buf[2]; |
| ThierryLeonard | 2:3576839565ae | 43 | afficheur.write(command,2,buf, 2); |
| ThierryLeonard | 2:3576839565ae | 44 | } |
