print buffer text and hex format
This commit is contained in:
parent
6a9b6ae77b
commit
201a8174c6
2 changed files with 8 additions and 8 deletions
|
@ -38,10 +38,7 @@
|
||||||
|
|
||||||
#define SICSLOWPAN_CONF_FRAG 1
|
#define SICSLOWPAN_CONF_FRAG 1
|
||||||
|
|
||||||
#define LOOP_INTERVAL (10 * CLOCK_SECOND)
|
#define LOOP_INTERVAL (15 * CLOCK_SECOND)
|
||||||
|
|
||||||
/* Save energy */
|
|
||||||
//#define RDC_CONF_PT_YIELD_OFF
|
|
||||||
|
|
||||||
/* For Debug: Dont allow MCU sleeping between channel checks */
|
/* For Debug: Dont allow MCU sleeping between channel checks */
|
||||||
//#undef RDC_CONF_MCU_SLEEP
|
//#undef RDC_CONF_MCU_SLEEP
|
||||||
|
|
|
@ -54,8 +54,6 @@ void loop (void)
|
||||||
{
|
{
|
||||||
byte buffer[32]; // Holds one page of data
|
byte buffer[32]; // Holds one page of data
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
mcu_sleep_off();
|
|
||||||
|
|
||||||
// Search for the first compatible EPROM/EEPROM on the bus.
|
// Search for the first compatible EPROM/EEPROM on the bus.
|
||||||
// If you have multiple devices you can use de.setAddress()
|
// If you have multiple devices you can use de.setAddress()
|
||||||
|
@ -84,7 +82,14 @@ void loop (void)
|
||||||
|
|
||||||
// Read the first page of memory into buffer
|
// Read the first page of memory into buffer
|
||||||
if ((status = de.readPage(buffer, 0)) == 0) {
|
if ((status = de.readPage(buffer, 0)) == 0) {
|
||||||
|
Serial1.println("Text:");
|
||||||
Serial1.println((char*)buffer);
|
Serial1.println((char*)buffer);
|
||||||
|
Serial1.println("Hex:");
|
||||||
|
for(int i = 0; i < 32; i++) {
|
||||||
|
Serial1.print(buffer[i], HEX);
|
||||||
|
Serial1.print(" ");
|
||||||
|
}
|
||||||
|
Serial1.println("");
|
||||||
} else {
|
} else {
|
||||||
sprintf((char*)buffer, "Error reading page! Code: %d", status);
|
sprintf((char*)buffer, "Error reading page! Code: %d", status);
|
||||||
Serial1.println((char*)buffer);
|
Serial1.println((char*)buffer);
|
||||||
|
@ -94,6 +99,4 @@ void loop (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Serial1.println("");
|
Serial1.println("");
|
||||||
|
|
||||||
mcu_sleep_on();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue