To start off the post is long because i wanted it to be as descriptive as possible and to present what i myself tried to do in order to fix the problem, the full code isn’t included here because it would make the post too long and the problem i have is pretty specific and doesn’t relate to the code in void start and void loop.
I have recently written a program that acts strangely when i include certain headers. the program by itself combines a vrm v3 module, tft screen (not touch) part code:2812c-sz and a servo motor.
the program should output a picture according to the voice command the vrm reads and in addition if “close” or “open” is said it should move a servo.
The problem starts when i include the Servo.h library.
all libraries in use:
#include <SoftwareSerial.h> #include "VoiceRecognitionV3.h" #include <SPI.h> #include "TFT9341.h" #include <SD.h> #include <Servo.h>
NOTE: the code i written compiles perfectly and there are no upload problems.
the pictures on the sd are in correct format and were tested separately (and work).
the voice commands of the vrm v3 were tested separately as well (and work).
the sevo sg90 itself was tested as well (and works) although it is not the problem.
there is a power supply connected to the board when testing so there is no shortage in amperes for the servo motor or the screen.
Detailed problem description: well its pretty brief - when i open the serial monitor the first thing i see is that it does read the sd card and the line after (in the code the line after should load an image) it says “file not found” and doesn’t display any pictures (note: all the module connections are correct) but after i say voice commands into the microphone it does recognize them and write the output in the serial monitor (simple test code i written) but it doesn’t want to load the accompanied pictures and outputs “file not found” when it needs to load one.
Why i think the problem is the library Servo.h ?
the answer is pretty simple when i include the libraries as following and comment out Servo.h:
#include <SoftwareSerial.h> #include "VoiceRecognitionV3.h" #include <SPI.h> #include "TFT9341.h" #include <SD.h> //#include <Servo.h>
With this small change all of the pictures load when the appropriate command is called but we exclude the servo functionality.
NOTE: not even a single servo variable was declared and nothing was written to them throughout all of the attempts to fix the problem. the only part where the code activated the servo was separate testing from the example of the servo itself (examples>servo>sweeper) on all other occasions ONLY the library Servo.h was included without writing any code that uses the library.
I think some of the libraries above cant work with the servo.h but again i cant assume that it truly is the cause of the problem.
any advice and help on fixing this problem will be much appreciated.