td1
Dependencies: lib_LCD_i2c_SPTLYI mbed
main.cpp@0:dca3b291558e, 2014-10-23 (annotated)
- Committer:
- mbedo
- Date:
- Thu Oct 23 09:42:24 2014 +0000
- Revision:
- 0:dca3b291558e
tp1_exo1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedo | 0:dca3b291558e | 1 | #include "mbed.h" |
mbedo | 0:dca3b291558e | 2 | #include "lib_LCD_i2c_SPTLYI.h" |
mbedo | 0:dca3b291558e | 3 | LCD_I2C LCD(p28,p27,p26,0x7C); |
mbedo | 0:dca3b291558e | 4 | |
mbedo | 0:dca3b291558e | 5 | int main() |
mbedo | 0:dca3b291558e | 6 | { |
mbedo | 0:dca3b291558e | 7 | |
mbedo | 0:dca3b291558e | 8 | |
mbedo | 0:dca3b291558e | 9 | float i=0; |
mbedo | 0:dca3b291558e | 10 | float j=0; |
mbedo | 0:dca3b291558e | 11 | |
mbedo | 0:dca3b291558e | 12 | LCD.set_position_cursor(0,0); |
mbedo | 0:dca3b291558e | 13 | LCD.print("compteur:"); |
mbedo | 0:dca3b291558e | 14 | LCD.set_position_cursor(0,1); |
mbedo | 0:dca3b291558e | 15 | LCD.print("compteur2:"); |
mbedo | 0:dca3b291558e | 16 | while(1) { |
mbedo | 0:dca3b291558e | 17 | |
mbedo | 0:dca3b291558e | 18 | |
mbedo | 0:dca3b291558e | 19 | LCD.set_position_cursor(9,0); |
mbedo | 0:dca3b291558e | 20 | |
mbedo | 0:dca3b291558e | 21 | LCD.print(i++); |
mbedo | 0:dca3b291558e | 22 | if(i>99) i=0.0 ; |
mbedo | 0:dca3b291558e | 23 | wait(0.25); |
mbedo | 0:dca3b291558e | 24 | |
mbedo | 0:dca3b291558e | 25 | |
mbedo | 0:dca3b291558e | 26 | LCD.set_position_cursor(10,1); |
mbedo | 0:dca3b291558e | 27 | |
mbedo | 0:dca3b291558e | 28 | LCD.print(j=i/2); |
mbedo | 0:dca3b291558e | 29 | if(j>99) j=0.0 ; |
mbedo | 0:dca3b291558e | 30 | wait(0.25); |
mbedo | 0:dca3b291558e | 31 | |
mbedo | 0:dca3b291558e | 32 | } |
mbedo | 0:dca3b291558e | 33 | } |
mbedo | 0:dca3b291558e | 34 | |
mbedo | 0:dca3b291558e | 35 |