From 60aef7eb3617787edfc21cded3718b06e0f7a21e Mon Sep 17 00:00:00 2001 From: crazyjaws69 <169078243+crazyjaws69@users.noreply.github.com> Date: Mon, 6 May 2024 09:34:42 -0700 Subject: [PATCH] Update giga-usb.md Hi, I noticed discrepancies between the Working "Read", "List", and the non-working "Write" programs. As a result, I fixed as noted from my Updates. I believe this will be useful for the Programing Community. If you have any Questions feel free to contact me directly. Thanks Paul --- .../giga-r1-wifi/tutorials/giga-usb/giga-usb.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md index 662a5b5ccc..a1a0c7ed43 100644 --- a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md +++ b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md @@ -254,7 +254,7 @@ void loop() { ### File Write -Below is an example sketch that can be used to **write** files from a USB mass storage device. +Below is an example sketch that can be used to **write** files to a USB mass storage device. ```arduino #include @@ -264,8 +264,7 @@ Below is an example sketch that can be used to **write** files from a USB mass s USBHostMSD msd; mbed::FATFileSystem usb("usb"); -// mbed::DigitalOut pin5(PC_6, 0); -mbed::DigitalOut otg(PB_8, 1); +mbed::DigitalOut otg(PB_15, 1); void setup() { Serial.begin(115200); @@ -274,11 +273,13 @@ void setup() { digitalWrite(PA_15, HIGH); while (!Serial); + + delay(2500); msd.connect(); - while (!msd.connected()) { - //while (!port.connected()) { + while (!msd.connect()) { + //while (!port.connect()) { delay(1000); } @@ -574,4 +575,4 @@ The goal with this guide was to provide a summary of all the GIGA R1's features, - Enabling and disabling the USB-A port. - Read & Write to a USB mass storage device (MSD). - Connecting keyboards and reading key presses. -- Emulate a mouse/keyboard through the HID interface. \ No newline at end of file +- Emulate a mouse/keyboard through the HID interface.