Adb for arduino UNO - arduino

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.

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.

Related

Sony Spresense + Arduino: connect a W5500 based Ethernet if

I try to use the Spresense board to build a NTP server.
Ethernet should be done with W5500 chip connected over SPI. Seems that the Arduino Ethernet library got a problem with the Apresense SPI library.
Someone out there who tried this already and have some ideas on it?
Code from Ethernet DhcpAddressPrinter example compiles just fine after changing Arduino/libraries/Ethernet/src/EthernetClient.cpp in Line 51
if (ip == IPAddress((uint32_t)0) || ip == IPAddress(0xFFFFFFFFul)) return 0;
I always get the message from the serial terminal that "Ethernet shield was not found". The W5500 PCB should not be the problem as it works on a normal Arduino Uno just fine. (It is not the original Arduino Ethernet shield, as this shield uses the ICSP header which is not present on Spresense board)
The Arduino IDE is 1.8.8
Hardware Problem solved: The W5500 and Spresense want the I/O level jumper on the board set to 3.3V. Ethernet lib seems to work now, at least on the SPI.
I´m looking forward to work on the software now.

SIM900 module not responding on hardware COM port

I've got my sim900 module working with arduino by using their software serial library, however, I want to eliminate arduino from the equation and have serial communication directly to sim900 module.
I'm using putty as my terminal emulator. It's serial is configured to COM1 19200 8 N 1 the same as device manager configuration for this port.
I connect straight from hardware serial on my PCs motherboard into serial-to-ttl interface board which connects to sim900 module. The board has 4 pins - VCC GND TX RX. They're all connected to my sim900 hardware serial as follows: VCC=5V GND=GND TX=TX RX=RX (Yes I know that it's always actually TX=RX and RX=TX, but when I connect it that way my interface board doesn't blink any led to indicate a transfer whereas it does when I connect TX=TX and RX=RX). The switch on the module is set to hardware serial pins as well.
So the only thing that happens when I send AT commands such as AT or ATI and press enter is that puttys cursor comes back to the beginning of command that I typed. No response.
I'm thinking that I'm not doing something that the arduinos software serial port is doing when it sends commands to sim900.
Can anyone help please ? It's literally been days of trying different configurations with no results.
In that time besides getting sim900 working with arduino software serial I verified that the hardware serial port on my motherboard is working correctly and the interface board is working correctly as well.

How to connect Pins input/output for the IDE

I have project that need to connect USB device to PC using arduino, The device have power from external power supply and 2 cables of data , so I have do like this :
Pin1,Pin2 = device usb data cabels.
Pin3,Pin4 = Pc usb data cabels.
My question is, how to connect Pin1 to Pin3, and Pin2 to Pin4. is there special Pins I need to connect those cables?
Thank you so much

Arduino can not communicate serial (MIDI), when the USB is unplugged

I wanted to test the arduino MIDI example code:
https://www.arduino.cc/en/Tutorial/Midi
I tried it with a 9V 500mA AC/DC adapter, and i used a MIDI-USB cable to get the MIDI messages to my software (Hauptwerk).
When the Arduino's USB cable was connected to the computer (the MIDI-USB cable was connected too) it worked fine, but when I tried with the adapter and plugged out Arduino's USB cable, the software didn't received the MIDI messages.
To the serial communication I used the TX-pin like in the tutorial.

XBee and Arduino communication

I am in the middle of my project, and I am now trying to make a connection between two XBees, exactly like in this the YouTube video XBee Basics - Lesson 2 - Simple Chat Program Between Two XBees in AT Mode. I setup the network in the X-CTU first, and now I am trying to connect the XBees with Arduinos.
In the Arduino programming software, the side of the router works fine - I can see in the serial monitor that it's sending the "Hello World" messages, but on the side of the coordinator, it does not receive any massages.
Platform:
Arduino IDE version 1.03-1.05.
XBee Series 2
Arduino Uno
I suppose that the "Hello word" message on the router side is due to a Serial.print() instruction that you have included for debbuging purpose.
Arduino Uno like my Arduino nano have only one serial port (the usb) and if you use it for power purpose or debugging or transmitting data to the PC it is considered busy and anything connected to the pin 0 and 1 will be ignored.
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip. it is from arduino site).
You need to create a software serial port with the library SoftwareSerial (is it included in Arduino IDE since version 1.0)
to call the library and define the software serial port you can use this piece of code
#include <SoftwareSerial.h>
uint8_t rxxbee = 2;
uint8_t txxbee = 3;
SoftwareSerial Serial_xbee(rxxbee,txxbee);
Rember to connect the RX of the arduino to TX of the XBee and viceversa.

Resources