mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
EEPROM: examples: fix Serial for board Leonardo
This commit is contained in:
parent
bd2b9d1afd
commit
54da627789
@ -14,6 +14,9 @@ void setup(){
|
|||||||
|
|
||||||
//Start serial
|
//Start serial
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
//Print length of data to run CRC on.
|
//Print length of data to run CRC on.
|
||||||
Serial.print( "EEPROM length: " );
|
Serial.print( "EEPROM length: " );
|
||||||
|
@ -23,6 +23,9 @@ void setup(){
|
|||||||
int eeAddress = 0; //EEPROM address to start reading from
|
int eeAddress = 0; //EEPROM address to start reading from
|
||||||
|
|
||||||
Serial.begin( 9600 );
|
Serial.begin( 9600 );
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
Serial.print( "Read float from EEPROM: " );
|
Serial.print( "Read float from EEPROM: " );
|
||||||
|
|
||||||
//Get the float data from the EEPROM at position 'eeAddress'
|
//Get the float data from the EEPROM at position 'eeAddress'
|
||||||
|
@ -25,6 +25,9 @@ struct MyObject{
|
|||||||
void setup(){
|
void setup(){
|
||||||
|
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
float f = 123.456f; //Variable to store in EEPROM.
|
float f = 123.456f; //Variable to store in EEPROM.
|
||||||
int eeAddress = 0; //Location we want the data to be put.
|
int eeAddress = 0; //Location we want the data to be put.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user