USB Module USB HOST/HID with MAX3421E SPI Interface Output*5 Input*5
Save 0
SKU: U2I-BG-1549723
Share this product
Description
Description:
USB is a USB driver module, integrated MAX3421E which adds USB host or peripheral capability to any system with an SPI interface. Ever up for adding the standard USB features on your project? this M5 moudle is the perfect solution.
1.EasyLoader is a simple and fast program burner. Every product page in EasyLoader provides a product-related case program. It can be burned to the mas ter through simple steps, and a series of function verification can be performed.(Currently EasyLoader is only available for Windows OS)
2.After downloading the software, double-click to run the application, connect the M5 device to the computer via the data cable, select the port parameters, and click "Burn" to start burning.
Before compile this example code, you need to download the corresponding USB library fromhere. Unzip and copy this library folder to Ardui no library pa th.( This is my pa thC:UsersDocumentsArdui nolibraries)
Download the example usb_m o u se.ino
Plug the USB m o u se into USB A port.
Hold down the left button to draw white lines.
Hold down the right button to draw green line.
Press the middle wheel button to clear the screen.
#include <M5Stack.h> #include <SPI.h> #include <Usb.h> #include <hiduniversal.h> #include <hidboot.h> #include <usbhub.h> #include "M5Mou se.h" // new objects USB Usb; USBHub Hub(&Usb); HIDBoot<USB_HID_PROTOCOL_M O U SE> HidMouse(&Usb); MouseRptParser Pr s; // initialization M5.begin(); Usb.Init(); HidMouse.SetReportParser(0,(HIDReportParser*)&Pr s); // handle event coming from usb device Usb.Task(); if(Usb.getUsbTaskState() == USB_STATE_RUNNING) { M o u se_Pointer(mou_px, mou_py); mou_px = 0; mou_py = 0; /* left button pressed: draw white point */ if (mou_button == 1) M5.Lcd.drawCircle(StaPotX, StaPotY, 1, WHITE); /* right button pressed: draw green point */ if (mou_button == 2) M5.Lcd.drawCircle(StaPotX, StaPotY, 1, GREEN); /* middle button pressed: clear screen */ if (mou_button == 4) M5.Lcd.fillScreen(BLACK); }
Schematic:
Also Purchased
Recently viewed
Free delivery
Providing Free Delivery Across India
Satisfied or refunded
Don't Like It ? No Worries , We will take it Back.
Top-notch support
Any Queries, Contact us Anytime at Support@shop2india.com