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.
Diff: main.cpp
- Revision:
- 3:edb0044a1052
- Parent:
- 2:bdf472bb6179
- Child:
- 4:a139a18be4a5
--- a/main.cpp Tue Apr 26 04:41:15 2022 +0000
+++ b/main.cpp Tue Apr 26 05:20:38 2022 +0000
@@ -3,7 +3,6 @@
#include <mbed.h>
Serial pc(USBTX, USBRX);
-
I2CSlave slave(I2C_SDA, I2C_SCL);
char addr = 0xA0;
@@ -12,7 +11,6 @@
{
char buf[30];
char msg[] = "Respuesta de Slave";
- //pc.printf("\033[1;1H"); //Mueve cursor al origen
pc.printf("\r");
pc.printf("I'M SLAVE\r\n");
@@ -25,8 +23,8 @@
int i = slave.receive();
switch (i) {
case I2CSlave::ReadAddressed:
- slave.write(msg, strlen(msg) + 1); // Includes null char
- NVIC_SystemReset();
+ slave.write(msg, strlen(msg) + 1);
+ NVIC_SystemReset();
break;
case I2CSlave::WriteGeneral:
slave.read(buf, 30);