0

I am trying to run a Geeetech Voice Recognition Module to recognize my commands and change the color of Neopixels with them. The problem is, that my Arduino never receives the output from the voice recognition module. When connect it to my computer and use AccessPort to communicate, everything works fine. The module is connected to the Rx and Tx pins correctly and it even receives the startup data from the Arduino Uno.

I've already tried sending a command via serial monitor, the Arduino Rx LED blinks shortly, by it never blinks when my Voice Recognition Module should send data. I even tried to power it through a separate power supply, but it didn't change anything. I disconnect the Rx pin while uploading, connect the pin after that and then I use the reset button of the Arduino.

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

#define PIN 5
Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
byte com = 0;

void setup()
{
Serial.begin(9600);
  strip.begin();
  strip.show();
  delay(2000);
  Serial.write(0xAA);
  Serial.write(0x37);
  delay(1000);
  Serial.write(0xAA);
  Serial.write(0x21);
}

void loop() // run over and over again
{ 
  if(Serial.available() > 0)
  {
    com = lowByte(Serial.read());
    switch(com)
    {
      case 0x11:
        strip.setPixelColor(0, strip.Color(255,255,255));
         break;
      case 0x12:
         strip.setPixelColor(0, strip.Color(255,0, 0));
         break;
      case 0x13:
          strip.setPixelColor(0, strip.Color(0,255, 0));
          break;
      case 0x14:
          strip.setPixelColor(0, strip.Color(0, 0, 255));
          break;
      case 0x15:
          strip.setPixelColor(0, strip.Color(0,0,0));
          break;
    }
  }
  delay(250);
}

I expect the LED color to change, but it never changes.

Nick is tired
  • 6,860
  • 20
  • 39
  • 51
  • Are you disconnecting TX/RX of your module while uploading your code? As you are using an UNO, you have only one Serial interface which is occupied, while uploading, by the Arduino IDE. – Tom Jun 21 '19 at 08:04
  • I disconnect the Rx pin while uploading, connect the pin after that and then I use the reset button of the arduino. – capkaempfer Jun 21 '19 at 08:07
  • And close the Serial monitor of the IDE? – Tom Jun 21 '19 at 08:33
  • @TomCombriat The Serial Monitor is closed while i do this – capkaempfer Jun 21 '19 at 08:42
  • Alright, hard to know what is going… Have you tried following this [example](http://www.geeetech.com/wiki/index.php/Arduino_Voice_Recognition_Module) (thus removing the `delay`, putting a `while` instead of `if` to speed up and removing the `lobByte`? Another try, if you have a Mega is to monitor instructions sent and received from another Serial port. – Tom Jun 21 '19 at 08:59
  • @TomCombriat I've just tried that, and it didn't change anything, those changes were made due to some other recomendations I've found while researching problems with serial – capkaempfer Jun 21 '19 at 09:13
  • Isnt the RX pin now sharing between USB interface on the UNO and the voice module? SO are most like interfearing with each other (even thogh you aren't sending any data via the USB) – lostbard Jun 21 '19 at 12:11

0 Answers0