Odd question...

Hey, I'm absolutely 100% new to arduino and the like; the closest thing to it I've come is an intro level comp engineering class in college.

Anyway, me and some buddies are putting together an interactive beer pong table. It'll have a monitor embedded into the center with a plexiglass covering, and 10+ sensors on each side for the cups (we're thinking it will be more like 10 buttons/switches that setting the cup on top of will set). It is for this part that the arduino board is needed.

Now, knowing NOTHING about arduino: what kind of input can I get into a computer directly from the board? Is the board's sole purpose to be a standalone controller, who's only purpose for plugging into the computer is to program it? Or can I treat it more as in interface in between a computer and the switches?

I want to ask all of these questions before I invest any money in a potentially non-working solution.

Some more, very important, details: I'm using a mac (I know, please don't hate me) and using Flash Actionscript 3.0 to program the GUI/ data processing/ everything except the direct input of the switches (YES this goes against everything arduino stands for: Open source, high efficiency low level processing, etc... and I'm SORRY! But the GUI in Flash is SO EASY haha).

So, if I CAN get input from the switches, to the arduino board, to the computer, can I do anything to convert that input to something Flash will understand? I've been looking around the forum, and it seems the programming has been done in mostly a 'C' based thing (C++?). I do know C, but am no master by a long shot- does anyone know if C/C++ can output something Actionscript can input?

Sorry for the ridiculously long winded/complicated discription, but I didn't want to leave anything out. :)

Thanks!

tl;dr: Can I treat an arduino board as an interface between switches and a computer, and then parse this input into something Adobe Flash Actionscript 3.0 will understand?

If flash can read a serial socket, then yes, if it can't, you'll need a go-between written in a language that can.

I'm 99% sure that it can't...

any recommendations on what to use/how to implement said go-between language? I've never really had to do anything like this before... my only idea would be to output a file in one language and read it from another, but that seems TERRIBLY inefficient. I have no idea how I could access a memory buffer from two languages at the same time, but that seems like the optimal solution...

Also, really ridiculous workaround, but would this idea work:

plug in a USB keyboard, and solder the buttons/switches to individual keys? I know it's ridiculous, but it's not like I plan on mass producing these or anything; I just want to get this one table to work.

Any opinions would be appreciated :)

we're thinking it will be more like 10 buttons/switches that setting the cup on top of will set).

You can use microswitches or IR sensors. You'll want to look at both. Keep in mind that depending on the board you use, you have about 16 I/O lines. You'll want to draw a block diagram so you know just how many inputs you need.

what kind of input can I get into a computer directly from the board?

Arduino boards have a Serial to USB connection, that emulates a serial port on the computer. So any application that can talk to a serial port can talk to the Arduino.

Is the board's sole purpose to be a standalone controller, who's only purpose for plugging into the computer is to program it? Or can I treat it more as in interface in between a computer and the switches?

The Arduino doesn't have a sole purpose.

I'm using a mac (I know, please don't hate me)

So? Quite a few people here are, myself included. Grow up.

Flash Actionscript 3.0 to program the GUI/ data processing/ everything except the direct input of the switches

Well you will need to program the Arduino with C. It is easiest to use the Arduino IDE to do that programming. Once you have programmed the Arduino to read your inputs and output appropriate data on the serial port whatever you use on the computer is up to you.

(YES this goes against everything arduino stands for: Open source, high efficiency low level processing, etc... and I'm SORRY! But the GUI in Flash is SO EASY haha).

It does? That's weird, I guess I didn't get the memo. Neither did the many people who use FLASH programs that talk to their Arduino-based project.

I do know C, but am no master by a long shot- does anyone know if C/C++ can output something Actionscript can input?

You seem to misunderstand the use of C. It is to program the microcontroller. If you want to use a high-level abstracted language to program an 8-bit microcontroller, you might want to look at a different platform like Netduino. (Which has nothing to do with Arduino, except that they capitalize on a similar name.)

If you want the application that runs on your computer to use a language like Flash or VisualBasic (or RealBasic on the mac), you can. As long as that language gives you a way to talk to a Serial-Port device.

Download the Arduino IDE to look at the examples "Blink" and "DigitalReadSerial". You'll see it doesn't really take much C to get the arduino to read a digital input and send a character over the serial port.

I'd say your biggest problem will be all the liquid that is spilled everywhere getting into your electronics. I've never once seen a beer pong table that wasn't half covered in a beer lake.

My suggestion is make the table Plexiglas and use IR to sense your cups through the plexi. Micro switches need to be in direct contact and then you've got a hole in the table for liquids above the table to meet the electronics underneath the table.

*EDIT* Actually, I think a QTI would work better than a legit IR and would be cheaper. It's a modified IR sensor/receiver that can be made to only see black (cup) or white (no cup) so it'd be a go/no-go sensor.

Thanks James, tons of help! I'll look at those examples- but pretty sure Flash does not have the ability to read directly from a serial port. I could be wrong... By: "...it doesn't really take much C to get the arduino to read a digital input and send a character over the serial port" do you mean like it sends a signal such that the computer would interpret it as a character input from a keyboard? Or do you just mean send the ascii code of a character...? Anyways, if you know of any examples of someone using flash/arduino in tandem, that would be of great help!

Schmidtn- we've thought of that, but $6*20(+)= way over budget haha. We think we're going to stick with the switches, and it's kinda hard to explain, but heres how:

There will be three layers, one- Wood top with holes the size of cups two- One sheet solid tarp-like thing three- another layer wood similar to top layer, with the buttons pressed up against the tarp. That way, a cup pressing down on the tarp will also press the switch.

So, heres my new question: Say I can get the input in to the computer from the cups with no problem- how can I get this data into flash, either directly or indirectly? Any details appreciated!

waoh- should have done my research before posting:

I guess flash CAN get data directly from an arduino! Cool!

Thanks for all your help everybody!