udamonic.com
  • Learn
  • Design
  • Videos
  • Resources
  • Firmware
  • Buy
  • About

Create : LEDS :  LED Arc-Welder Effect
​

The motivation for this was a diorama display that featuring a model arc welder. It used an Arduino to drive the LED. I decided to do a version in Forth to show how easy it is.
​
The demo code using the Scamp's onboard status LED is:
: welderdemo
  begin
     random $f00 u/ for
        random $ff u/ ms ledon
        random $ff u/ ms ledoff
     next
     random $ff u/ ms
  key? until 
;

Use an External LED
​

See the page on adding a LED for an understanding of the basic LED circuit. Choose a blue/white LED and connect it to pin 1 on your Scamp. Place the LED anywhere on your layout or diorama, where you want the arc-welding effect to be.
Let's assume we have connected the external LED to pin 1 of the Scamp. To control it, we need to make pin 1 an output.

Modifying the code to use an external LED:
: welder
  1 output
  begin  
    random $f00 u/ for
       random $ff u/ ms 1 set
       random $ff u/ ms 1 clear
    next
    random $ff u/ ms
  again
;
Picture
This word will repeat forever. To make this word run at startup:
' welder is turnkey

Site powered by Weebly. Managed by Hostwinds
  • Learn
  • Design
  • Videos
  • Resources
  • Firmware
  • Buy
  • About