How to make the touchscreen go to sleep? - arduino

Hi so I have a Arduino mega 2560 with a Adafruit TFT touch shield, im using the tft library to write my things at the moment. I want to know if there is a function to turn off the screen (to save power), and then implement a physical button to turn it back on again? How do I do this?
Thanks.

You can't control the backlight directly out of the box. Check out the link from the AdaFruit website:
Controlling the Backlight
You will need to physically alter your TFT shield with a knife and soldering iron (but the soldering job should be easy).
As to using a physical button to wake it up -- yes. And good news for you, since you are using a Mega, you can attach to an I/O pin! (With a UNO, it would be more difficult).
So you can add a pushbutton switch to ground and set the pinMode to INPUT_PULLUP.

Related

SPI From AdaFruit Trinket to ST7789 Display

I am working with the ST7789 Display and my ultimate goal is to display images on the screen using the built in MicroSD slot. I have a AdaFruit Trinket 3v that I'm using for the primary logic but I cannot seem to figure out how to program the trinket to communicate with the display.
From my research, I've been able to solder the wires in place to set up an SPI compatible connection between the two using the #1 and #0 pins on the trinket along with reset pin which are connected to the SI, SO, and Reset on the display in that order. I am writing the code in C++ using VS Code and the PlatformIO plugin to add the appropriate libraries for the trinket and ST7789 display.

NodeMCU (Arduino IDE) - after power off, sketch doesn't start

I made a project that will send GPS coordinates to a MySQL database through NodeMCU wifi. I have no problem with this, but now, in the last few steps before showing it to the company owners, I have problems when I try to reboot NodeMCU after power off.
NodeMCU does not recognize the sketch inside. It is like it was deleted.
I already pulled up gpio0 and gpio2 with 2.2K Ohms resistors and pulled down gpio15 with the same resistor, something recommended by builders.
Has anyone had the same problem?
Thanks
(Sorry for my English, I need to practice more.)
You need to connect GPIO0 to 3V with a pulldown resistor once you have finished to flash your sketch. This action is setting the NODEMCU devkit to run the sketch, instead of entering in FLASH new sketch mode.
Are you using Esp8266-01 or esp8266-12E with Nodemcu development board...?
If you are using esp-01 ,after the sketch upload you need to make it Boot from the flash, to load thw sketch

GSM Module code Not Working On GSM breakout board

I'm in a situation and need some advice.
Scenario 1:
Arduino Uno/Genuino +
ICOMSAT SIM900 Module(http://www.itead.cc/icomsat.html)
(placed the jumpers such that Digital Pin 2 is rx and 3 is TX on the shield)
Code Used: The send receive SMS example code in the arduino website.(
(https://www.arduino.cc/en/Tutorial/GSMExamplesReceiveSMS)
Everything Works fine without a glitch.
Scenario 2:
Arduino Uno/genuino +
GSM breakout board(https://www.google.co.in/search?q=sim900A&espv=2&biw=1600&bih=717&source=lnms&tbm=isch&sa=X&ved=0CAYQ_AUoAWoVChMIqd748qb8yAIVYXumCh2s2Aaq#tbm=isch&q=sim900a+gsm+module&imgdii=9zJcFQBaoLAKzM%3A%3B9zJcFQBaoLAKzM%3A%3B7eDw6qGc3qZjMM%3A&imgrc=9zJcFQBaoLAKzM%3A)
Had loads of issues with softwareSeial.h library and ended up cross connecting the default on board rx/tx with GSM board's RX/TX and everything worked fine. (though I didn't liked the fact that everytime during programming I had to change connections to upload a sketch)
code used is from here (http://www.theengineeringprojects.com/2014/06/send-sms-with-arduino-uno-and-sim900d-using-at-commands.html)
Now my Problem:
Since the shields are very costly, I decided to settle on the cheaper boards for my project. But the Code used for the GSM shield was so easy to understand (since the library was doing all the heavy lifting) I tried to use that. I connected Rx of GSM board to pin 3 and TX to pin 2 of arduino and uploaded the same code I used for the GSM shield scenario. But the code won'r work, I tried to tinker a few blocking things like the enable pin code where the shield is brought up etc. but no luck. Can anyone put some light on it, has this been tried before, is it not supposed to work the was i want it to ?
Thanks a lot in advance.

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 WiFly shield with SPI

I have an Arduino Uno with the WiFly shield. I want to use 5 PWM ports on the Arduino to control motors, but some of the PWM ports are used by the WiFly. Looking into it, I think I need to use the SPI bus, but is this possible with the WiFly shield or how do I go about it?
How am I supposed to wire the motors so that they can work alongside the WiFly?
Can you point to a tutorial (I haven't been able to find one similar enough to my case to understand) or can you give me some pointers? That would be great.
All you need to get the WiFly module working is a serial link with it. One option is to use a soft serial library. This way you can choose which arduino pins you want to use (only 2 are needed leaving all the others available to control your motors). See this tutorial for a complete example.

Resources