0

i am working on a distance sensing app for android using arduino and ultrasound sensor.I found code that uses Abd for communication between android and arduino. The Abd used is for Arduino mega which has many more ports as compared to arduino Uno.I searched for Adb for uno but couldn't find it can anyone help me in finding Adb for Uno.If nothelp me with mapping of I/O ports form mega to uno. int the adb of Mega :

DDRE 0x40 refers to Port E bit 6
DDRJ 0x08 refers to Port J bit 3
DDRJ 0x04 refers to Port J bit 2

So I need to move those IO pins to pins that Uno supports within Ports A,B,C,D and change the the DDRE & DDRJ references accordingly.

dhiraj uchil
  • 113
  • 10

1 Answers1

1

For two devices to communicate through USB one of them must act as a HOST device.

  • When connecting Arduino to your PC, your PC is the host.
  • When connecting Android to your PC, your PC is the host.
  • When connecting Android to the USB port of Arduino Mega, Arduino is the host.
  • If you (somehow) connected Android to Arduino UNO's single USB, There are no host and so they can't communicate.

You can over come this limitation by buying Arduino Uno's Host Usb Shield and connect Android to that Shield.

Ramast
  • 7,157
  • 3
  • 32
  • 32