SPI From AdaFruit Trinket to ST7789 Display - arduino

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.

Related

Problems getting Arduino GSM lib to work with Nucleo L073RZ

I'm trying to use the Adafruit Fona Mini GSM together with the Nucleo L073RZ. There exists a library for the GSM module, but it's for arduino. I've setup the board manager url to make use of the link in this repository: https://github.com/stm32duino/Arduino_Core_STM32/blob/master/README.md to add support for the MCU I'm using.
It's not possible to use SoftwareSerial together with this MCU it seems like. The library disappears when the card is selected. The GSM library supports HardwareSerial by uncommenting some lines though, which I've done. Unfortunately the MCU is unable to communicate with the GSM module.
Tera Term image
This is how everything is connected.
Hardware image
In case it's not apparent by the picture, this is how the GSM module connects to the MCU.
Vio connects to 5V
GND connects to GND
RX connects to TX/D1
TX connects to RX/D0
This is the only code modification I've made in the FONATest example, just to use hardware serial instead of software serial.
// We default to using software serial. If you want to use hardware serial
// (because softserial isnt supported) comment out the following three
lines
// and uncomment the HardwareSerial line
//#include <SoftwareSerial.h>
//SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
//SoftwareSerial *fonaSerial = &fonaSS;
// Hardware serial is also possible!
HardwareSerial *fonaSerial = &Serial1;

Arduino Mega and Nextion display Serial communication

I'm working on Arduino Project using Nextion Display. At first It worked perfectly Arduino used to read and write data to display shown component, but for some reason Nextion doesn't send data to arduino anymore, I checked the Voltage supply common gnd, and wiring is perfect (TX ==> RX2 , RX ==> TX2).
I'm using Nextion Library which is working bu default for Arduino Mega , so no change is necessary.
here is the link to nextion library: https://github.com/itead/ITEADLIB_Arduino_Nextion
I'm sure the code doesn't contain any problems. It's all about serial communication from nextion display.
I have found out that the Nextion Display becomes unresponsive if you have any delays in your loop.
In several parts in the library there are timeouts of 100 millis if you have a larger time out like delay(120) you receive no data at all.
Furthermore the Library you are pointing to is related to using Serial2 look at my solution at github Serial1 or Serial2 in external library reference
This will solve your problem.

Arduino Multiple SPI devices including CC3000 and MFRC522

I'm asking if how can I implement this one. I'm aware about multiple devices being connected over SPI, like having to select individual SS pin for each. Adafruit's CC3000 works fine alone along with the default Adafruit library. CC3000 uses SPI. MFRC522 RFID module by sonmicro (bought at Sparksfun) uses SPI too. It works fine too, independently. But whenever I connect them together, only WiFi works perfectly. I dont want to turn on and off the wifi to make way for the RFID to communicate since it takes some time for it to be connected in a wireless network. I want the two to work synchronously (or having to be scheduled but really fast that's unnoticeable by the user)
here's my code as of now. i cannot post it here as strange things happen i don't know why haha
https://drive.google.com/file/d/0B0bZsYo0xMH8YV9uWXJaRFdPT3M/view?usp=sharing
I'm thinking of replacing the RFID with SonMicro's SM130 RFID Module w/ SparkFun Eval board with UART (convertible to I2c) or Adafruit's PN532 with I2c by default. Are these okay to be paired with SPIs like the CC3000? Or should I change CC3000 with the Official WiFi module (UART) or WiFly Module (SPI-to-UART)

How to make the touchscreen go to sleep?

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.

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