Getting two arduinos to interact without wiring them together - arduino

Okay, I've been working on this project for months with this being what has stopped me, heres the situation.
I am making a glove that can move a robot arm. The glove has an Arduino Nano iot 33 attached. The board measures the orientation with the built in imu, and sends it to my laptop (will be a raspberry pi in the future) through a usb cable. Also connected to the laptop is an Arduino Uno r3. This board is what makes the robot move (the servos are wired to it and I attached a display that shows the orientation of the glove here). I pondered how to make the Arduino Nano communicate to the Arduino Uno for a while, and I settled on keyboard presses. The Arduino Nano would press certain buttons based on its orientation and the Uno would wait for them to be pressed to move the robot. Turns out that after over 1000 lines of code, the Arduino uno can't use the keyboard library, and I'm stuck again. Is there a better way to go about this?? or is there a way to get the Arduino uno to get keyboard commands (I'm sixteen, tryin to save for college, I know theres a way to buy something to bypass the boards chip, I've already spent quite a bit on arduinos and PLA and such, and if im gonna buy something I want to use it again, please keep that in mind)
How would you have gone about this? How can I recover this project? Please help me...

this is an amazing project.
Great idea the link over SerialUSB, but it is very very slow...
You should use a radio transmitter like this.
Else, there is a great tutorial for communication using Bluetooth master & slave (warning: the post is in Italian).
If you still want to use SerialUSB, you should use a program that reads input from Nano and send a hex. code into Arduino Uno.
Library for serial communication with java or ruby.
Library for serial communication with Arduino.
I hope this can help you. Good luck!

Related

Is it possible to factory reset an arduino from hardware to remove bad user code?

I was troubleshooting why Serial1 was always throwing undefined errors in sketches I was trying to run when I found a solution posted online for a slightly different board that suggested this line:
HardwareSerial Serial1(2);
I uploaded it and now the Arduino doesn't show up in the IDE, did I remap it's serial communications? Why is this possible!
Is there any hardware factory reset option available on these boards? Did I just brick my device?
edit: It seems the STM32Cube programmer app can be used to communicate with the device but I'm not sure where to get the original firmware to flash. https://imgur.com/a/LbiHenf
Assuming from the tag in your question, I guess you have an STM32 – (BluePill) Development Board (STM32F103C8).
If you think that your board is not handling serial communication properly then you might consider burning bootloader to your board. This will reset the complete configuration of your board.
There are many ways in which you can burn bootloader to your board.
Using another Arduino board like Uno / Nano / Mega
Using an FTDI USB to TTL Serial Adapter.
You might want to go through tutorials list below:
Getting Started with STM32 using Arduino IDE: Blinking LED
Programming STM32F103C8 Board using USB Port

PWM/PPM Output misses some edges

I am using ESP8266 (NODEMCU 3.0 or something) to make a quadcopter. Ive connected ardu pro mini to RC receiver so I am reading PPM values from it. Pro mini sends data with tx to ESP8266. ESP reads it with software serial with 115200 baudrate. I am communicating with MPU9255 (Waveshire) via I2C either.
My problem is that I cant fully controll my brushless motors. When I was using arduino instead of ESP8266, servo library was the best and reliable. But ESP's servo library is different, since its not AVR, and problems occurs. First of the servo library didnt want to work on most frequencies. I mean default is 50Hz (20000uS) and in this state ESC of motors did armed but unfortunatelly when changes was fast and short (1250-> 1370 -> 1250) it did miss that change like nothing happnd... This makes my D value in PID controller useless...
Sometimes on 100Hz freq all was working fine, but sometimes not...
When Ive started to use analogWrite only 500Hz was working fine, rest of freq didnt want to arm ESCs.
PS. I am using 3.3V to 5V converter for PPM/PWM pins so I am sure that the signal is fine for ESCs.
PS2. I dont have any osciloscope unfortunately.
The ESP82266 present on your module is a RF transceiver integrated circuit that can handle WiFi communication, both configured as a slave to a microcontroller such as the ones present on various Arduino boards, or as a standalone chip by having it's on-board Tensilica L106 32-bit processor programmed via an external SPI flash memory. If used as a slave, the communication between, for example, an Arduino an the ESP82266 can be done using different protocols such as SPI / SDIO or I2C / UART interfaces. Googling a comprehensive Tensilica L106 user guide on the internet doesn't seem an easy task, and it looks as if some people have already failed to find it. If you're seeking to add Wi-Fi capabilities to your quadcopter the solution I suggest is having the Arduino take control over the servos, motors, etc. and hand off messages via SPI to your ESP82266 module. If this isn't the answer you are looking for, please try to be clearer about it, maybe find someone to do as an English translator for you.
However, if this is what you're concerned about, and you would like to use the ESP82266 module as as standalone solution, please link its built-in processor datasheet and the relevant parts of the quadcopters code that might need debugging.

avrdude : stk500_getsync not in sync:resp=0x87

I am using arduino uno r3 board and arduino 1.6.5 on windows 8. When Itried to upload my program on ATMEGA328 microcontroller it is showing:
avrdude:stk500_getsync not in sync:resp=0x87.
help me to solve this error
This boils down to 3 problems usually..
The bootload on the chip is missing (unlikely if you purchased the board from Arduino).
The serial connection between the arduino and the computer is disconnected or interrupted.
You've simply selected the wrong board type or port when programming, and thus the IDE is searching for a signal that the arduino isn't coming back with.
This problem is most likely due to option 3, however it can occur in odd situations especially on the Arduino Micro where the board does all USB comms on chip and can be flooded by main without an appropriate delay to the point it can't communicate with the IDE. However this is just most likely a bad board selection or a bad port selection.
I've tried many things but this worked for me. If you have a working Arduino lying around (in my case Uno) you can use it as an intermediate in-system programmer (ISP).
Follow this guide to first load the ISP sketch into your working Arduino.
Once you are done, for your non-working Arduino, select from the Tools > Programmer menu and choose Arduino as ISP, and set Board and Processor accordingly. To program choose Sketch > Upload using programmer.
Hope this works.
I think the reason that this work is that it will bypass the CH340/FTDI chip, and all those synchronization issue. Given that that is your problem.

How do I add Xinput to a gamepad arduino project?

I have successfully running push buttons and analog sticks working on a board of mine through the serial connection via the Arduino IDE. How do I get that data to work with Xinput?
I have my own emulation software that works in Xinput beyond that. I just need to get the gamepad device xinput support. What are the neccessary steps to get this working with a driver and how I can get this up in running in the least amount of timing possible without having to edit someone else's driver too much?
You can turning an Arduino Leonardo into a joystick, use a teensy board and the teensy joystick library, use a HID-compatible bluetooth chip (such as RN-42 HID or something similar) with a joystick/gamepad profile or just remove a controller's existing joystick parts and replace with your components.

Arduino controlled robot : without uploading every time

I've recently built an Arduino-controlled robot(4WD platform) using a beginner's kit.
After uploading compiled program into Arduino, I was able to get 4WD motors working.
But when I disconnect the USB cable after successful "uploading" and I turn on the mobile platform switch, it doesn't move a bit.
What procedure is required for getting it to move (I mean.. having machine language permanently stored in AVR microcontroller's memory) without again connecting USB cable to Arduino and uploading program after I find the code working so that just turning on the switch of the robot make it start to move as programmed?
It REALLY sounds like a power issue.
-What is powering your arduino when the USB is disconnected?
The USB from a computer is often pretty strong (hight current) and a 9V battery might not cut it for electric motors and such.
If this is the problem you may want to try a more powerfull battery setup, like 4 AAs.
You may go the LiPo battery route from a source like Adafruit or Sparkfun. Then the problem is that a LiPo battery only produces 3.3V. Ugh, you'll need an circuit to bump the voltage to 5 (which Adafruit sells) and a charger. This may be your best choice if you're planning to use the robot a lot.

Resources