Members | Sign In
Legacy MOVI User Community Forum (readonly) > MOVI Question & Answers
avatar

Uploading new code

posted Jul 02, 2017 22:27:34 by Craig Morgan
For some reason when I upload a new callSign or even a different code, the MOVI does not recognize the changes.
Any idea why?
page   1
9 replies
avatar
GeraldFriedland said Jul 03, 2017 16:25:28
I am sorry, MOVI didn't work for you on first try. Unfortunately, there could be many reasons. There is a reason this forum exists...

Could you send me more details on the board you are using, your Arduino IDE version, the MOVI version, and the library version? Also, if you can, let me know what you were trying to do exactly and if the LowLevelInterface is responding and how?

Thank you,
Gerald
avatar
Craig Morgan said Jul 03, 2017 17:08:34
Arduino Mega2560
Arduino IDE version 1.8.3
MOVI hardware version 1.0
MOVI firmware version 1.1
MOVI Library version 1.12


I will attach my code, I am trying to control a DC motor, a Servo motor, and an Ultrasonic sensor.


Here is the code:

#include "MOVIShield.h" // Include MOVI library, needs to be *before* the next #include

#if defined(ARDUINO_ARCH_AVR) // defined(ARDUINO_ARCH_PIC32)
#include <SoftwareSerial.h> // This is nice and flexible but only supported on AVR and PIC32 architecture, other boards need to use Serial1
#endif

#include <Servo.h>
#include <Ultrasonic.h>
MOVI recognizer(true); // Get a MOVI object, parameter true enables serial monitor interface, rx and tx for alternative communication pins on AVR architecture boards

Servo myservo;
Ultrasonic ultrasonic(36,37);

int val=0;

void setup()
{
Serial.begin(9600);
motorsetup();
myservo.attach(9);
recognizer.init(); // Initialize MOVI (waits for it to boot)
recognizer.callSign("beehive"); // uncomment if you want to make the call sign 'computer'.
recognizer.setVoiceGender(FEMALE_VOICE);
recognizer.setSynthesizer(SYNTH_PICO,"-l=en-US");

recognizer.addSentence(F("search the perimeter")); // Add sentence 1
recognizer.addSentence(F("stop search")); // Add sentence 2
recognizer.addSentence(F("open door")); // Add sentence 3
recognizer.addSentence(F("close door")); // Add sentence 4

//recognizer.addSentence(passKey); // uncomment to train the passkey. This will lower the false negative rate at the price of lower security due to an increase of false positives.
recognizer.train(); // Train (first one takes about 20seconds)
recognizer.setThreshold(15);


}

void loop()
{
signed int res=recognizer.poll();
if (res==1)
{
recognizer.say("searching perimeter");
for (int pos = 0; pos <= 180; pos += 1)
{ // goes from 0 degrees to 180 degrees
// in steps of 1 degree
Serial.print("Distance in CM: ");
Serial.println(ultrasonic.distanceRead());
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (int pos = 180; pos >= 0; pos -= 1)
{ // goes from 180 degrees to 0 degrees
Serial.print("Distance in CM: ");
Serial.println(ultrasonic.distanceRead());
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
if (res==2)
{
recognizer.say("search terminated");
myservo.write(val);
}
if (res==3)
{
recognizer.say("opening door");
for (int i=0; i<100; i++)
{
digitalWrite(12, LOW);
analogWrite(3, 75);
delay(500);
}
digitalWrite(9, HIGH);
}
if (res==4)
{
recognizer.say("closing door");
for (int i=100; i!=0; i--)
{
digitalWrite(12, HIGH);
analogWrite(3, 75);
delay(500);
}
digitalWrite(9, HIGH);
}

}
void motorsetup()
{
pinMode(12,OUTPUT);//direction
pinMode(3, OUTPUT);//pwm
pinMode(9, OUTPUT);//brake
}
[Last edited Jul 03, 2017 17:34:05]
avatar
GeraldFriedland said Jul 04, 2017 21:02:11
MOVI library 1.12 is very buggy. We pulled it after one week or so. You must have been unlucky. Please use 1.13 and let me know if that fixed the problem.

Sorry again,
Gerald
avatar
Craig Morgan said Jul 04, 2017 22:36:56
Ok, after downloading the zip how should I install it to MOVI?
avatar
GeraldFriedland said Jul 06, 2017 04:46:38
There is guide from Arduino here:
https://www.arduino.cc/en/Guide/Libraries

which is linked in our "getting started" guide:
http://www.audeme.com/getting-started.html
avatar
Craig Morgan said Jul 07, 2017 02:47:42
I checked in my library and it seems as if I have the 1.13 version already downloaded in my libraries, but when I run the version check example, it is telling me that I have the 1.12 version installed.
avatar
GeraldFriedland said Jul 09, 2017 15:58:55
Hmmm... then you probably have both libraries lying around somewhere.

I would search my hard disk for MOVIShield.h and get rid of every single directory that contains the library. Start your IDE again and make sure you get an error message when you compile the example. Then, install 1.13 again.

There is a longer discussion on how to remove libraries:
https://github.com/arduino/Arduino/issues/2878

Hope that helps,
Gerald
avatar
Craig Morgan said Aug 22, 2017 13:57:19
Hi Gerald

I am still having issues with my shield, is there any way that I can send it to you guys to troubleshoot and upgrade as needed. I have been trying to do as you said and still no results, I am in the U.S. so sending it to you guys would not be a problem. Also, it seems as if the SD card is corrupted, when I plug the SD card into my PC, it says that it might be corrupted, I didn't format the card. I backed up the card when I received the shield, and even the back up file seems to be corrupted. I am in urgent need of assistance because I am using this for a project presentation in about 2 weeks.
avatar
GeraldFriedland said Aug 30, 2017 04:05:55
Yes. Let me respond to your private contact request. Sorry it took me so long to respond but I wanted to find out what happened first.
Login below to reply: