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.
Revision 6:09a5710f6b7c, committed 2018-07-31
- Comitter:
- alejo5214416
- Date:
- Tue Jul 31 22:54:23 2018 +0000
- Parent:
- 5:790c023a3fe2
- Commit message:
- Escritura, ordenamiento, lectura, ok antes de creacion de union
Changed in this revision
| eeprom.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/eeprom.cpp Tue Jul 31 19:05:00 2018 +0000
+++ b/eeprom.cpp Tue Jul 31 22:54:23 2018 +0000
@@ -10,16 +10,14 @@
int write_data(uint8_t eepr_addr, uint16_t address, uint8_t *ptr_string)
{
- wait_ms(2);
+ wait_ms(4);
i2c.start();
int ack=i2c.write(eepr_addr<<1);
if(ack==1) {
i2c.write(address<<8);
i2c.write(address);
- int i=0;
- while(ptr_string[i]!=NULL) {
+ for(int i =0; i<4 ;i++) {
i2c.write(ptr_string[i]);
- i++;
}
i2c.stop();
return 1;//success
@@ -34,7 +32,7 @@
uint8_t data_read(uint8_t eepr_addr, uint16_t address_read)
{
- wait_ms(2);
+ wait_ms(5);
uint8_t read;
i2c.start();
int ack=i2c.write(eepr_addr<<1);