Let's Make Robots!

Need help "translating" a C program to work in Arduino

I need an expert in C/C++ programming to help me translate a fairly complex piece of C code into Arduino specific code, perhaps even create a library. The original author of the code can't do it, but we have his permission to do it, as the code is released for hobby use only.

 The code is very interesting for many Arduino based robots, lots of people will benefit if we can make it work.

Please reply here or PM me if you're interested. Thanks. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I'm sorry I really don't have the time at all these days, otherwise I'd be glad to help.

But still I'm curious..what is it all about?

Text to Speech. Instead of a SpeakJet, import a library or a piece of code in your application.



send me the code I will take a shot at it.



As I have permission from the original author to post the code and ask for help from other people, here are the links:

Original code and description (see the attachment at the bottom of the page):


My attempt to make it work in Arduino:


Dohh! Just realised that my Google Chrome did not let me make the links clickable, I had to use Internet Explorer!!! I was wondering how on Earth people did those links and I couldn't... Perhaps it's just something this simple I'm missing in my code...

Any help will be greatly appreciated!

Is it really necessary to convert it to Arduino? If it can be compiled as a C library the Arduino should be able to use it.

Text-to-speech is not an easy thing on a micro. The SpeakJet doesn't do text-to-speech translation on its own without a bit more hardware or software (I'll be blogging soon on exactly this!). This does remind me of another software-only Arduino speech synthesis project called Cantarino. But  Cantarino has the same problem as the SpeakJet - it only handles the "speech" part of the equation and not the "text to" part of it.

Just from looking at the SocietyOfRobots link, it looks this thing will tie up a good portion of the Arduinos memory and there wouldn't be much left to do anything else. But with then multiple Arduino's thats not really a problem. :-) Any idea just how good the translation is or for that matter how good the speech is? I looked for a demo audio or video but didn't find one.

I just wish I had the time to help. This sounds like it could be fun...


I could have modified the original main file to wait for I2C commands and speak the stored phrases as I needed, but I want this robot to use Arduino only code. There will be one I2C slave mega168 that will take care of all of the speech stuff on my robot, along with 4 other I2C boards, some of them being master-slave, one will be master only and others will be slave only. All together 5 boards, I2C connected, Arduino code. Can't wait to get the boards in the mail! I hope I can fit some AI on the main brain (mega328) so the robot will be more entertaining and more useful than the regular robots we see here and there. But more on this later.

About the TTS code. I know it uses lots of resources and need not to be bothered while speaking, so it will make sense to be used as a stand alone board, just like a regular SpeakJet, however, sometimes the user might want to add simple functionality and just use a single board, as most of the time it doesn't need to do anything while speaking. So, I think it is a good idea to be able to use it both ways. I was even thinking of a Speech library, but one doesn't need to use more than one instance of the class, so a second tab file added to a project will be good enough.

So, if you think you can help (anyone!), please do it as soon as possible. It drives me crazy that I can't do anything to make it work...


Thank you very much for your time and effort!


Interesting. Did you use a similar code with mini-Eric in order for him to take voice commands? 

I have managed to translate it to Arduino and make a libray. You can find it attached on my MiniEric robot page. But this is only the Speech code.

The Voice Recognition is done by a VRbot module I bought from RobotShop. The VRbot module connects to any microcontroller using a standard TTL serial port. There is sample code for using the module with Arduino, I just adapted the code to my robot. Last night I managed (with help from GearMotion) to make the Bridge mode work with my Arduino, original code did not make the connection. What deos this mean? Well, the VRbot module has TTL serial interface. To program new voice commands, you need to use a RS232 or USB FTDI serial adapter. That means, every time you need to update the commands, you need to unplug the module from your robot and connect it to the PC. So, instead of doing this, there is a simple code that creates a bridge between the Arduino UART and the digital serial port where the VRbot is connected. The problem I had was the Arduino syntax for digitalRead and digitalWrite takes too much time to execute and the connection times out. Replacing them with direct register reading and writing solved the problem, so now I can connect to the VRbot module through Arduino and I can select the Bridge mode by pressing a button at start.