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.
Dependencies: mbed Servo KeypadLib TextLCD
main.cpp@1:02c938489de7, 2018-12-04 (annotated)
- Committer:
- AndreaS97
- Date:
- Tue Dec 04 11:50:39 2018 +0000
- Revision:
- 1:02c938489de7
- Parent:
- 0:5f8790dfc90c
- Child:
- 2:74c155c71eb5
Yo
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Virgi97 | 0:5f8790dfc90c | 1 | #include "Cassaforte.h" |
| AndreaS97 | 1:02c938489de7 | 2 | #include "mbed.h" |
| Virgi97 | 0:5f8790dfc90c | 3 | //#include <TextLCD.h> |
| Virgi97 | 0:5f8790dfc90c | 4 | //I2C i2c(D14, D15); |
| Virgi97 | 0:5f8790dfc90c | 5 | //TextLCD_I2C lcd(&i2c, 0x4E, TextLCD_I2C::LCD16x2, TextLCD_I2C::HD44780); |
| Virgi97 | 0:5f8790dfc90c | 6 | /*DigitalOut led(LED1); |
| Virgi97 | 0:5f8790dfc90c | 7 | void scrivi(char parola[]); |
| Virgi97 | 0:5f8790dfc90c | 8 | void cambioCodice(); |
| Virgi97 | 0:5f8790dfc90c | 9 | void inserisci();*/ |
| Virgi97 | 0:5f8790dfc90c | 10 | InterruptIn button(PC_13); |
| AndreaS97 | 1:02c938489de7 | 11 | char v[4]; |
| Virgi97 | 0:5f8790dfc90c | 12 | int main() { |
| Virgi97 | 0:5f8790dfc90c | 13 | /*lcd.setMode(TextLCD_I2C::DispOn); |
| Virgi97 | 0:5f8790dfc90c | 14 | lcd.setCursor(TextLCD_I2C::CurOn_BlkOn);*/ |
| Virgi97 | 0:5f8790dfc90c | 15 | inizializza(); |
| AndreaS97 | 1:02c938489de7 | 16 | scrivi("Immetti codice:"); |
| AndreaS97 | 1:02c938489de7 | 17 | inserimento(v,4); |
| AndreaS97 | 1:02c938489de7 | 18 | |
| Virgi97 | 0:5f8790dfc90c | 19 | } |
| Virgi97 | 0:5f8790dfc90c | 20 | |
| Virgi97 | 0:5f8790dfc90c | 21 | /*void scrivi(char parola[]){ |
| Virgi97 | 0:5f8790dfc90c | 22 | lcd.cls(); |
| Virgi97 | 0:5f8790dfc90c | 23 | lcd.printf("%s\n", parola); |
| Virgi97 | 0:5f8790dfc90c | 24 | } |
| Virgi97 | 0:5f8790dfc90c | 25 | |
| Virgi97 | 0:5f8790dfc90c | 26 | void cambioCodice(){ |
| Virgi97 | 0:5f8790dfc90c | 27 | scrivi("Cambio codice di apertura"); |
| Virgi97 | 0:5f8790dfc90c | 28 | lcd.setAddress(11,1); |
| Virgi97 | 0:5f8790dfc90c | 29 | wait(3); |
| Virgi97 | 0:5f8790dfc90c | 30 | lcd.cls(); |
| Virgi97 | 0:5f8790dfc90c | 31 | scrivi("Digitare il nuo_ vo codice:"); |
| Virgi97 | 0:5f8790dfc90c | 32 | lcd.setAddress(10,1); |
| Virgi97 | 0:5f8790dfc90c | 33 | inserisci(); |
| Virgi97 | 0:5f8790dfc90c | 34 | } |
| Virgi97 | 0:5f8790dfc90c | 35 | |
| Virgi97 | 0:5f8790dfc90c | 36 | void inserisci(){ |
| Virgi97 | 0:5f8790dfc90c | 37 | wait(1); |
| Virgi97 | 0:5f8790dfc90c | 38 | lcd.putc('1'); |
| Virgi97 | 0:5f8790dfc90c | 39 | wait(1); |
| Virgi97 | 0:5f8790dfc90c | 40 | lcd.setAddress(11,1); |
| Virgi97 | 0:5f8790dfc90c | 41 | lcd.putc('2'); |
| Virgi97 | 0:5f8790dfc90c | 42 | wait(1); |
| Virgi97 | 0:5f8790dfc90c | 43 | lcd.setAddress(12,1); |
| Virgi97 | 0:5f8790dfc90c | 44 | lcd.putc('3'); |
| Virgi97 | 0:5f8790dfc90c | 45 | wait(1); |
| Virgi97 | 0:5f8790dfc90c | 46 | lcd.setAddress(13,1); |
| Virgi97 | 0:5f8790dfc90c | 47 | lcd.putc('4'); |
| Virgi97 | 0:5f8790dfc90c | 48 | wait(1); |
| Virgi97 | 0:5f8790dfc90c | 49 | }*/ |