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.
Fork of Lab2_latest_version by
Revision 5:bc92e421d5f8, committed 2015-01-20
- Comitter:
- capopolito
- Date:
- Tue Jan 20 23:14:42 2015 +0000
- Parent:
- 4:c40acfb63133
- Commit message:
- Aggiornamento della precedente
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r c40acfb63133 -r bc92e421d5f8 main.cpp --- a/main.cpp Tue Jan 20 23:03:39 2015 +0000 +++ b/main.cpp Tue Jan 20 23:14:42 2015 +0000 @@ -451,15 +451,15 @@ //componente x dell'accelarazione //scrivo codice ascii delle decine nel display nel display dedicato - //command_location = char ( (command_wr) + int(loc_tens_x) ) ; //1000 000 = 0x80 - command_location = 0x80; + command_location = ( command_wr | loc_x_tens ) ; //1000 000 = 0x80 + //command_location = 0x80; slave_select.write(0); spi.write(command_location); spi.write(x_tens_ascii); slave_select.write(1); //scrivo codice ascii delle unità nel display nel display dedicato - //command_location = command_wr + loc_unit_x ; //1000 001 = 0x81 - command_location = 0x81; + command_location = command_wr | loc_x_unit ; //1000 001 = 0x81 + //command_location = 0x81; slave_select.write(0); spi.write(command_location); spi.write(x_unit_ascii); @@ -467,15 +467,15 @@ //componente y dell'accelarazione //scrivo codice ascii delle decine nel display nel display dedicato - //command_location = command_wr + loc_tens_y ; //1000 010 = 0x82 - command_location = 0x82; + command_location = command_wr | loc_y_tens ; //1000 010 = 0x82 + //command_location = 0x82; slave_select.write(0); //asserisco lo slave select attivo basso spi.write(command_location); spi.write(y_tens_ascii); slave_select.write(1); //nego lo slave select attivo basso //scrivo codice ascii delle unità nel display nel display dedicato - //command_location = command_wr + loc_unit_y ; //1000 011 = 0x83 - command_location = 0x83; + command_location = command_wr | loc_y_unit ; //1000 011 = 0x83 + //command_location = 0x83; slave_select.write(0); //asserisco lo slave select attivo basso spi.write(command_location); spi.write(y_unit_ascii); @@ -483,15 +483,15 @@ //componente z dell'accelarazione //scrivo codice ascii delle decine nel display nel display dedicato - //command_location = command_wr + loc_tens_z ; //1000 100 = 0x84 - command_location = 0x84; + command_location = command_wr | loc_z_tens ; //1000 100 = 0x84 + //command_location = 0x84; slave_select.write(0); //asserisco lo slave select attivo basso spi.write(command_location); spi.write(z_tens_ascii); slave_select.write(1); //nego lo slave select attivo basso //scrivo codice ascii delle unità nel display nel display dedicato - //command_location = command_wr + loc_unit_z ; //1000 101 = 0x85 - command_location = 0x85; + command_location = command_wr | loc_z_unit ; //1000 101 = 0x85 + //command_location = 0x85; slave_select.write(0); spi.write(command_location); spi.write(z_unit_ascii);