'Serial comm example for MedeaWiz DV-68 digital video player using 'Parallax Basic Stamp model BS2 'Program to step through JPEG files using a single pushbutton '02/05/07 Team Kingsley LLC 'www.teamkingsley.com '{$STAMP BS2} ' {$PBASIC 2.5} '188 on BS2 Serout / Serin = 4800 baud rec VAR Byte(18) 'var to hold incomming data from the DV-68 jpeg VAR Byte 'counter for current JPEG file index VAR Byte 'iteration register jpeg = 1 'JPEG files on flash start with jpeg.001, then jpeg.002 etc. PAUSE 7000 'allow DV-68 to initialize when first powered on Top: IF IN0 = 0 THEN shownext 'using I/O 0 for button, tied high w/ 10K R GOTO top 'if button not pressed, go check again shownext: 'button was pressed: run this code SEROUT 15, 188, [jpeg] 'show slide - Using I/O 14 for data sent to DV-68 IF jpeg < 5 THEN '5 is for 5 JPEGS on flash. Set as needed jpeg = jpeg + 1 'increment counter if not on last file ELSE jpeg = 1 'after last file reset to 1st file ENDIF SERIN 14, 188, [STR rec\18] 'retrieve data from DV-68 FOR index = 0 TO 17 DEBUG HEX? rec(index) 'show data on Debug screen NEXT DEBUG "File ", DEC jpeg, CR SEROUT 15, 188, [246] 'pause DV-68 on current file PAUSE 1000 'hold time before allowing another button press/ file change GOTO top END