Page 1 of 1

Trigger arduino by a pulse?

Trigger arduino by a pulse?

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
Examples: "MacOS X - Your question", "MS Word - Your Tip or Trick".

Please note that switching to another language when reading a post will not work!
Posts will not have a translated counterpart.




RSS Feed

Home Forums Hardware Arduino Trigger arduino by a pulse?

This topic contains 3 replies, has 2 voices, and was last updated by  jlpicard 1 week, 3 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • 11498

    jlpicard
    Participant

    I am a great fan of your sketches here hans and have done the all effects in one sketch with a lot of fun and I am ready to get going with a practical application.  I build virtual pinball cabinets as a hobby and would like to incorporate the marquee effect, one on right side of playing field and second on the left.  I need them to initiate when certain events trigger in a game which the installed microcontroller would then generate a pulse (negative or positive can be set).  Can you tell me if I can trigger an arduino with a pulse like I describe?

    11502

    jlpicard
    Participant

    Pin 2 with gnd pulse?

    11506

    hans
    Keymaster

    Hi jlpicard!

    Thanks for the compliments and great to hear you’ve had a lot of fun with the code. 

    For your purpose you could work indeed with an Arduino.
    I assume that you want to tap the signal of a solenoid? In that case (since I don’t know the voltage of the solenoid), you could try placing a relay (same voltage as solenoid) in parallel with the solenoid. When the solenoid fires, the relay would trigger as well – the switch part of the relay then can be used as a “switch” for the Arduino.

    To apply the Marquee effect, you could use the All-in-one sketch and slightly butcher it, so it restarts and runs the marquee effect only once. Something like this;

    ...
    void setup()
    {
      FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
      digitalWrite (BUTTON, HIGH); // internal pull-up resistor
      attachInterrupt (digitalPinToInterrupt (BUTTON), buttonTriggered, CHANGE); // pressed
      theaterChase(0xff,0,0,50); // or whichever effect you have in mind to run only once
    }
    void loop() { 
      // do nothing
    }
    void buttonTriggered() {
      if (digitalRead (BUTTON) == HIGH) {
        asm volatile (" jmp 0");
      }
    }
    ...

    Here we call one of the effects in setup() instead of in loop() – this way it doesn’t keep repeating itself.
    The function “buttonTriggered” will reset the Arduino, which then will run setup() again and show the effect.
    Once setup() is completed, it will go to loop() and do nothing … until you reset again (with the switch/relay).

    Hope this gets you started – curious about your project! 

    11508

    jlpicard
    Participant

    No i am going to use one of the events in your all in one and tie it to probably the flippers in the pinball game.  Hit a flipper and my microcontroller sends a grounding pulse to pin2 on arduino triggering the addressable leds.  This is virtual pinball all run by a gaming pc in my cabinet.  I can send a link to a youtube video if its permitted.

    • This reply was modified 1 week, 3 days ago by  jlpicard.
    • This reply was modified 1 week, 3 days ago by  jlpicard.
Viewing 4 posts - 1 through 4 (of 4 total)



You must be logged in to reply to this topic.