Real-time control from a PC?

I'm really new to this, but I'll lay out my intentions from the beginning.

I'm Trying to build a program and interface tool that has 3722 timed events over seven and a half minutes, I don't believe even a tenth of that would fit on the 8K arduino chip.

So my solution is to use the arduino as an interface, build the program and file and run it from my PC. Is it possible to do this real-time sending each event exactly timed?

Any help or input would be greatly appreciated. :slight_smile:

There isn't room in the Arduino's internal memory to store all those events, but there are a number of ways to implement your application. You could send the data to a PC or store it on an external memory EEPROM or memory card.

To decide on how to implement the application on the arduino, some information on the nature of the data is needed. What is the minimum acceptable precision needed in the timing data, what is the shortest time between two consecutive events, and are thee events evenly spread over time or do they occur in bursts?

What is it you are measuring?

I'm making a Guitar Hero Bot, the nature of the data is such that I need to close the gates of the finger buttons and strum bar with relative precision. Although the GH3 precision is fairly forgiving, I'm sure the arduino can handle it.

It should be noted that I'm not using this to cheat, but simply to build my arduino knowledge, and to see if I can.

The events are exactly like the notes of a song, there is a rigid timing structure, but the events are of 6 different types.

Thanks mem, every bit helps.

So if I understand the app, it sounds like you have over 100ms between the closest spaced events. This is plenty of time to send the data to a PC or to write it to external memory. You would also have time to do some processing of the event in the arduino before storing if you wanted to.

It's not a field I have looked at but I expect there is lots of info on capturing and processing notes from a musical instrument that may help you with you project.

Looking forward to seeing the video in the exhibition area when you are finished :wink:

My big question is:

What program do I use to send signals to the Arduino from the PC, as long as I can get that, I will be good to go.

Is it C programming, or a Serial poller, or what?

Any program that can send serial will work. You could also build a circuit that causes an interrupt if you need closer timing.

I'm making a Guitar Hero Bot...

Doug, that has to be one of the coolest things I've ever heard of. I'm pretty sure that if you complete it and share it with us, no one will complain that you are "cheating" at Guitar Hero. (I once wrote a computer program "bot" that automatically played the Windows Solitaire game over and over and that was fun to build!)

I think mem's idea of adding an external EEPROM is a good one, but the more I think about it, I wonder if you can get by without it. I think might be able to compress your 3722 events -- hey, that's "Through the Fire and Flames" on expert, isn't it? :slight_smile: -- so that they will fit in the Arduino's 16K* chip.

I assume your data is something like:

Event 0, Time 0ms, buttons 1 and 2
Event 1, Time 200ms, buttons 2 and 4
Event 2, Time 225ms, button 3


If so, you could make a static table comprised of 3722 entries. Each entry would take 2 bytes = 16 bits, of which 5 would be bound to the 5 buttons, and the remaining 11 would indicate the number of milliseconds since the previous event occurred. (This breaks down -- not irreparably though -- if there are ever two events spaced more than 2047 = 2^11-1 milliseconds apart.)

Does the above paragraph seem like gobbledegook to you? If so, I'd be happy to write a little code to explain what I mean. I want this project to work so that I can steal it. :slight_smile:


Doug, you may want to have a look at Processing, it's development environment is similar to the arduino and there is example code for handling serial data.

Thanks for all the help guys, I greatly appreciate all your ideas, and will get to work on it. :smiley:

I’m sorry to bring back such an old thread, but I am currently working on something like this as well. I already have the hardware side of it worked out (mostly), now I need software…something that will work like this:

Capture keyboard and mouse inputs, send them down to the arduino without letting windows use them (moving the mouse should not move the mouse cursor). Record the outputs in real time; so that they can be played back later. (Like if I get platinum and then I want to get it for a friend). This seems like the kind of thing that should already exists for robotic arms and such, but I have not been able to find it.

(Oh, I forgot to mention; everything in my project is digital; even the sticks…I am using a Centipede)