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@6:909e7877d915, 2017-09-05 (annotated)
- Committer:
- evrast
- Date:
- Tue Sep 05 05:51:17 2017 +0000
- Revision:
- 6:909e7877d915
- Parent:
- 2:3576839565ae
- Child:
- 8:5124be43c963
je dormais;
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 | 2:3576839565ae | 4 | |
| 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 | 2:3576839565ae | 11 | |
| evrast | 6:909e7877d915 | 12 | void Afficheur::write(char* characters,int length,int expo ) |
| ThierryLeonard | 2:3576839565ae | 13 | { |
| evrast | 6:909e7877d915 | 14 | |
| evrast | 6:909e7877d915 | 15 | Serial pc(USBTX, USBRX); |
| evrast | 6:909e7877d915 | 16 | pc.printf("1"); |
| ThierryLeonard | 2:3576839565ae | 17 | static char buf[20]; |
| evrast | 6:909e7877d915 | 18 | pc.printf("2"); |
| ThierryLeonard | 2:3576839565ae | 19 | resetDisplay(); |
| evrast | 6:909e7877d915 | 20 | pc.printf("3"); |
| evrast | 6:909e7877d915 | 21 | afficheur.write(characters,length,buf,20); |
| evrast | 6:909e7877d915 | 22 | pc.printf("4"); |
| evrast | 6:909e7877d915 | 23 | showDot(expo); |
| ThierryLeonard | 2:3576839565ae | 24 | } |
| ThierryLeonard | 2:3576839565ae | 25 | void Afficheur::write(char ch) |
| ThierryLeonard | 2:3576839565ae | 26 | { |
| ThierryLeonard | 2:3576839565ae | 27 | static char buf[1]; |
| ThierryLeonard | 2:3576839565ae | 28 | afficheur.write(&ch,1,buf,1); |
| ThierryLeonard | 2:3576839565ae | 29 | } |
| ThierryLeonard | 2:3576839565ae | 30 | void Afficheur::resetDisplay() |
| ThierryLeonard | 2:3576839565ae | 31 | { |
| ThierryLeonard | 2:3576839565ae | 32 | char buf[1]; |
| ThierryLeonard | 2:3576839565ae | 33 | afficheur.write("v",1,buf,1); |
| ThierryLeonard | 2:3576839565ae | 34 | } |
| evrast | 6:909e7877d915 | 35 | void Afficheur::showDot(int expo) |
| ThierryLeonard | 2:3576839565ae | 36 | { |
| evrast | 6:909e7877d915 | 37 | char command[2] = {'w',expo}; |
| ThierryLeonard | 2:3576839565ae | 38 | char buf[2]; |
| ThierryLeonard | 2:3576839565ae | 39 | afficheur.write(command,2,buf, 2); |
| ThierryLeonard | 2:3576839565ae | 40 | } |
| ThierryLeonard | 2:3576839565ae | 41 | void Afficheur::hideDot() |
| ThierryLeonard | 2:3576839565ae | 42 | { |
| ThierryLeonard | 2:3576839565ae | 43 | char command[2] = {'w',0}; |
| ThierryLeonard | 2:3576839565ae | 44 | char buf[2]; |
| ThierryLeonard | 2:3576839565ae | 45 | afficheur.write(command,2,buf, 2); |
| ThierryLeonard | 2:3576839565ae | 46 | } |
