Setting ESP32 as a joystick - arduino

I am going to mak a joystick and use it with mission planner. For this I need to define the ESPWroom32 as a joystick. I tried GitHub - lemmingDev/ESP32-BLE-Gamepad: Bluetooth LE Gamepad library for the ESP32 library bu it did not work. I mean it is seen as an unknown device in bluetooth. But I want it to be seen as a game controller. I need to finish this project by tomorrow but I do not know what to do. I would appreciate the help.

Related

atmega32u4 Failed to enter programming mode

I have designed a custom board using atmega32u4 with a few other components (Such as RTC, memory and etc) but left them empty to test if the microcontroller can be programmed. After just hand soldering the microcontroller and the necessary capacitors and resistors, ATMEL Studio can't read device signature.I'm using AVRISP MKII. This board was inspired by ARDUINO ProMicro in design. The things I tried to solve it:
Measure all 3.3 volt supply lines and all of the grounds. (They all correspond with PCB and schematic)
Checked SPI lines to see if microcontroller receives commands from the programmer by using oscilloscope.
I tried removing the 16MHZ crystal, still the same.
I reflowed the microcontroller since it is a QFN type (atmega32-MU package) and I have a few via holes under the micro for flux to come out.
I have properly washed the board after reflow.
I have AREF grounded with a 0.1uF capacitor and !HWB pin (PE7) is left empty. I didn't ground it.
I tested the programmer with an actual promicro board and it programs fine.
I think I'm missing something but I don't know what... I'd be grateful if you guys could help me. Attached is the schematic of the circuit.
The micro controller RESET is indicated by MICRO RST on pin 13. That RESET on PB4 is for another device which is not populated yet and left empty, I checked Pin 13 with Oscilloscope and it seemed working fine and going to zero at the first moment of programming. Also MISO and MOSI and SCK were sending signals to the relevant pins.
Thanks
If you are programming the board with ISP you have to connect RESET to the programmer. otherwise the controller could not be programmed!
Image from microcontroller.net
It seems that your RESET is on PB4 but for programming it should be connected to RESET of uC.
So, I realized the problem after almost a month! I had removed the 16MHz crystal from the circuit and this caused the problem with programming. Now, after placing the crystal the program is successfully uploaded to the ATMEGA32U4.

Getting two arduinos to interact without wiring them together

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!

Arduino Accelerometer mpu6050, No raw data

I am working on a project which uses an accelerometer with an arduino Nano.
I am using the MPU6050. However I have the same static values wether I move the MPU6050 or not... I only get -1. That's really frustrating considering that all the tutorials I have watched achieve to retrieve data.
To begin with, I connected the MPU6050 with the arduino like so :
Then I used the official code https://playground.arduino.cc/Main/MPU-6050#short
that is to say this one :
And that's what I get ...
I bought a new one, but I still have the same issue...
If someone has any Idea, I would really appreciate !
Thanks
How do you know the I2C device address is correct? You could try scanning the bus to discover all the devices and their addresses. That would confirm your bus setup is working as well. Found this quick guide on accomplishing this: http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/arduino-quick-tip-find-your-i2c-address/
"The I2C-address depends on the AD0 pin of the sensor. If it is connected to ground, the address is 0x68. If it is connected to VLOGIC (+3.3V) it is 0x69. There are a few sensor boards with the MPU-6050 sensor already soldered on it."
So it is indeed necessary to solder the pins. We didn't thought about this because we connected VCC and GND without soldering as well and the LED was working fine whereby we assumed that it should be enough to stick them together for now. Seems like we were wrong and I've got now three working gyros at home.

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.

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.

Resources