CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 CON ColPos = 8 OBJ 'pst : "Parallax Serial Terminal" console : "FullDuplexSerial" VAR long div PUB Main ' pst.Start(57_600) 'Set Parallax Serial Terminal to 115200 baud div :=100 console.start(31, 30, 0, 9600) repeat ' ' ping dureation , count LED_Flash(16, 1, 1) 'Flash led LED_Flash(17, 1, 1) 'Then another LED_Flash(18, 1, 1) 'And finally a third LED_Flash(19, 1, 1) LED_Flash(20, 1, 1) LED_Flash(21, 1, 1) LED_Flash(22, 1, 1) LED_Flash(23, 1, 1) LED_Flash(22, 1, 1) LED_Flash(21, 1, 1) LED_Flash(20, 1, 1) LED_Flash(19, 1, 1) LED_Flash(18, 1, 1) 'And finally a third LED_Flash(17, 1, 1) 'Then another div := div + 2 ' div := div +2 PUB LED_Flash(Pin, Duration, Count) {Flash led on PIN for Duration a total of Count times. Duration is in 1/100th second units.} Duration := clkfreq / div * Duration 'Calculate cycle duration dira[16..23]~~ 'Set pins to output repeat Count * 2 'Loop Count * 2 times... !outa[Pin] ' Toggle I/O pin waitcnt(Duration + cnt) ' Delay 'console.Clear console.str(string("test",13)) console.Dec(div) 'Announce output