(Topic ID: 111387)

The PIG 2 is just like an Arduino... PIGDuino?

By dkpinball

9 years ago



Topic Stats

  • 3 posts
  • 3 Pinsiders participating
  • Latest reply 9 years ago by not4tilts
  • Topic is favorited by 7 Pinsiders

You

Linked Games

No games have been linked to this topic.

    You're currently viewing posts by Pinsider dkpinball.
    Click here to go back to viewing the entire thread.

    #1 9 years ago

    TL;DR - You can connect the PIG2 to your computer with a miniUSB connector and write programs to is using the Arduino IDE.

    It’s been a few years since the inception of the PIG. When Chad and I created the PIG 2 we worked hard to make it as easy as possible for the end user. By taking out the need to worry about different pinball voltages and AC vs. DC vs. digital signals we simplified controlling mods using game signals.

    Then by doing what we could to make it both flexible and easy to configure we took away the need to know programming. The PIG 2 is set up by changing some settings in a configuration file to get a mod to flash, blink, fade, twist, and shake.

    It’s difficult to find a balance between being flexible and being complicated. For example, a light switch is easy to use and understand. Flip it one way, the lights are on. Flip it the other way and the lights are off. But if you want your lights to do anything other than turn ON or OFF, you’re out of luck.

    You can put in a dimmer switch and then lights can be ON, OFF, or at 50%, 25%, 90% or anything in between. But then controlling the lights becomes a little more complicated. You have to push the button to turn the lights on and twist the knob to go from light to dark. More flexibility means more complexity.

    We tried to make controlling mods as flexible as possible without making it overly complex. But there are users that crave that infinite flexibility and are up for the challenge of the complexity that programming presents.

    I thought now might be a good time to point out something (something that might not be a surprise) about the PIG 2 for the advanced users. The PIG 2 uses the Atmel 328p as a microcontroller. It’s the same microcontroller used on the Arduino Uno board. As a matter of fact since the PIG 2 has the USB input, the Atmel microcontroller, and the same bootloader you can use the Arduino development environment and write your programs directly to the PIG 2.

    Think of the PIG 2 as an Arduino with a stack of different shields on it. A Pinball Input Shield (Flashers, Switches, Inserts, Coils, GI, Magnets), a MicroSD shield, a Servo and High Power Output Shield. All built into a compact, purpose built board. The purpose being to control pinball mods! There are even pins that allow you expand and talk to other components using the I2C bus or even the Addressable RGB LEDs that are becoming popular.

    We’ll follow up with some code examples if there is interest. Programming the Arduino is easy, if you understand programming logic and have a familiarity with programming in C. This isn’t for the entry level user though. There’s no such thing as “easily programming an arduino”.

    Lastly, you might ask why we don’t just share the code with everyone. That’s not off the table, but we still support the PIG 2 and it would be tough to try and keep track of all of the different versions of our code. Also we don’t really want to spend all of the time necessary to document all of our code. Like, why do we alter the internal clock when the PIG 2 is in “shaker motor mode” or why use two different versions of the servo.h library. Right now I’m just posting this as a “wow, neat” kind of thing.

    If you’re not familiar with the PIG 2, you can see it here: http://www.dkpinball.com/DKWP/?page_id=457

    For the curious, this is the pinout with the equivalent Arduino pins identified.
    https://docs.google.com/spreadsheet/ccc?key=0Ao9MI5VJmWBSdHZPSWJ5TmZ2Q1VWamlmNGt2aU10dFE&usp=sharing

    You're currently viewing posts by Pinsider dkpinball.
    Click here to go back to viewing the entire thread.

    Reply

    Wanna join the discussion? Please sign in to reply to this topic.

    Hey there! Welcome to Pinside!

    Donate to Pinside

    Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


    This page was printed from https://pinside.com/pinball/forum/topic/the-pig-2-is-just-like-an-arduino-pigduino?tu=dkpinball and we tried optimising it for printing. Some page elements may have been deliberately hidden.

    Scan the QR code on the left to jump to the URL this document was printed from.