Dorm 3.0 Door sign .
being a Geek in college I must invent a better whiteboard .
I really want to use a IPAD but there is now way Ill stick a 600$ device out of my room .
so I am using the parallax Serial LCD module to display stuff out side of my room
and here is the kicker I can store a TON of pre made messages In the BS2 and with the needed button latch a message . Eg ( Grub time ) ( sleeping ) ( come on in !) so on .
or just default to a list of my contact info .
There was not a schematic as its just 3 wires on a BOE board .
Peter
PHOTO
AND
PHOTO
CODE>>> Attachment not found.
and a video of it VIDEO
I really want to use a IPAD but there is now way Ill stick a 600$ device out of my room .
so I am using the parallax Serial LCD module to display stuff out side of my room
and here is the kicker I can store a TON of pre made messages In the BS2 and with the needed button latch a message . Eg ( Grub time ) ( sleeping ) ( come on in !) so on .
or just default to a list of my contact info .
There was not a schematic as its just 3 wires on a BOE board .
Peter
PHOTO
AND
PHOTO
CODE>>> Attachment not found.
and a video of it VIDEO

Comments
Its no iPad, but you could move up to the uOLED-128-G1 for not too much money - http://www.parallax.com/Store/Accessories/Displays/tabid/159/CategoryID/34/List/0/SortField/0/Level/a/ProductID/452/Default.aspx
You could display your avatar and other cool color graphics too!
One day you will be older and have kids - You will show them you latest creation - they will look and you (like my daughter does) and say, "Dad, your such a nerd..." OUCH!
I may have to add a TEMP reading one of thease days .
Esp considering the weather here ..
Peter
EDIT well in true fashon I did my first RCTIME to LCD project
' {$STAMP BS2} ' {$PBASIC 2.5} TX PIN 0 ' serial output to LCD ' -----[ Constants ]------------------------------------------------------- #SELECT $STAMP #CASE BS2, BS2E, BS2PE T2400 CON 396 T9600 CON 84 T19K2 CON 32 #CASE BS2SX, BS2P T2400 CON 1021 T9600 CON 240 T19K2 CON 110 #ENDSELECT LcdBaud CON T19K2 LcdBkSpc CON $08 ' move cursor left LcdRt CON $09 ' move cursor right LcdLF CON $0A ' move cursor down 1 line LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdCR CON $0D ' move pos 0 of next line LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdOn2 CON $17 ' LCD on; cursor off, blink on LcdOn3 CON $18 ' LCD on; cursor on, blink off LcdOn4 CON $19 ' LCD on; cursor on, blink on LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdCC3 CON $FB ' define custom char 3 LcdCC4 CON $FC ' define custom char 4 LcdCC5 CON $FD ' define custom char 5 LcdCC6 CON $FE ' define custom char 6 LcdCC7 CON $FF ' define custom char 7 ' -----[ Initialization ]-------------------------------------------------- ' allow LCD to initialize Part1 VAR WORD Main: SEROUT Tx, T2400,[LcdBLon]'backlight on DO 'READ POT HIGH 1 PAUSE 1 RCTIME 1,1, Part1 DEBUG DEC part1 ,CR 'SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,[DEC part1] PAUSE 300 SEROUT Tx, T2400,[LcdCls] LOOPand a
Video
so far is super simple but ill admit getting that dev board was just what I needed to get back to building stuff .
Nice job that you did and it says geek all the way. Now, all you have to do find is a use for the rest of the 15 I/O pins.
Peter
i added the Serial RFID reader and both sections work in there own program but not in the same one ..
I used stock parallax code and did some trimming on the RFID package to make it be clean ..
If I uncommnet a section of code it gives me a Error stating "DATA occupies same location as program"
' ========================================================================= ' ' File...... Serial_LCD_Template.BS2 ' Purpose... Template for Parallax Serial LCD ' Author.... (c) Parallax, Inc. -- All Rights Reserved ' E-mail.... support@parallax.com ' Started... ' Updated... 11 FEB 2005 ' Modded By Peterthethinker peter Dekluyver ' {$STAMP BS2} ' {$PBASIC 2.5} ' ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' -----[ Revision History ]------------------------------------------------ ' -----[ I/O Definitions ]------------------------------------------------- TX PIN 0 ' serial output to LCD LastTag CON 3 #DEFINE __No_SPRAM = ($STAMP < BS2P) ' does module have SPRAM? ' -----[ Constants ]------------------------------------------------------- T2400 CON 396 T9600 CON 84 T19K2 CON 32 LcdBkSpc CON $08 ' move cursor left LcdRt CON $09 ' move cursor right LcdLF CON $0A ' move cursor down 1 line LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdCR CON $0D ' move pos 0 of next line LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdOn2 CON $17 ' LCD on; cursor off, blink on LcdOn3 CON $18 ' LCD on; cursor on, blink off LcdOn4 CON $19 ' LCD on; cursor on, blink on LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdCC3 CON $FB ' define custom char 3 LcdCC4 CON $FC ' define custom char 4 LcdCC5 CON $FD ' define custom char 5 LcdCC6 CON $FE ' define custom char 6 LcdCC7 CON $FF ' define custom char 7 ' -----[ Variables ]------------------------------------------------------- buf VAR BYTE(10) ' RFID bytes buffer tagNum VAR NIB ' from EEPROM table idx VAR BYTE ' tag byte index char VAR BYTE ' character from table ' -----[ EEPROM Data ]----------------------------------------------------- Tag1 DATA "0F03027DAA" 'My Tag Tag2 DATA "04129C1A1C" Tag3 DATA "041402CCD7" ' -----[ Initialization ]-------------------------------------------------- Reset: HIGH TX ' setup serial output pin PAUSE 100 ' allow LCD to initialize ' -----[ Program Code ]---------------------------------------------------- Main: DO SEROUT Tx, T2400,[LcdBLon]' backlight on SEROUT Tx, T2400,[LcdCLs] 'SEROUT Tx, T2400,["ROOM #129"] ' HERE to 'SEROUT Tx, T2400,[LcdLine2]'' down a line 'SEROUT Tx, T2400,["Peter Dekluyver"] 'PAUSE 2000 'SEROUT Tx, T2400,[LcdCLs] ' HERE is where the Uncomment error is active 'GOSUB NOW PAUSE 1000 LOOP 'NOW: GOSUB ROOM GOSUB PHONE GOSUB EMAIL GOSUB SKYPE GOSUB HOURS RETURN TIMER: ' PAUSE 5000 ' GOSUB ROOM ' GOSUB PHONE ' GOSUB EMAIL ' GOSUB SKYPE ' GOSUB HOURS ' SEROUT Tx, T2400,[LcdBLoff]'backlight OFF RETURN 'GOTO Main END ' -----[ Subroutines ]----------------------------------------------------- RFID: '#IF __No_SPRAM #THEN SERIN 1, 396, [WAIT($0A), STR buf\10] ' wait for hdr + ID '#ENDIF Check_List: FOR tagNum = 1 TO LastTag ' scan through known tags FOR idx = 0 TO 9 ' scan bytes in tag READ (tagNum - 1 * 10 + idx), char ' get tag data from table #IF __No_SPRAM #THEN IF (char <> buf(idx)) THEN Bad_Char ' compare tag to table #ELSE GET idx, chkChar ' read char from SPRAM IF (char <> chkChar) THEN Bad_Char ' compare to table #ENDIF NEXT GOTO Tag_Found ' all bytes match! Bad_Char: ' try next tag NEXT Tag_Found: DEBUG "gold" ,CR ' TO PC SEROUT Tx, T2400,["Welcome Peter"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["To THE ROOM"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN END ''''''''''''''''''''''''''''''''''''BLINK BLINK: SEROUT Tx, T2400,[LcdBLon]'backlight OFF PAUSE 50 SEROUT Tx, T2400,[LcdBLoff]'backlight OFF PAUSE 50 RETURN ''''''''''''''''''''''''''''''''''''MYROOM ROOM: SEROUT Tx, T2400,["Welcome to"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["My Room"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''PHONE PHONE: SEROUT Tx, T2400,["My Phone # Is"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["(909)-634-4250"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''EMAIL EMAIL: PAUSE 100 SEROUT Tx, T2400,["My Email is "] PAUSE 750 SEROUT Tx, T2400,[LcdCls] SEROUT Tx, T2400,["Peterthethinker"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["@yahoo.com"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''SKYPE SKYPE: PAUSE 100 SEROUT Tx, T2400,["Skype Me @"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["MVP-studios"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''HOURS HOURS: SEROUT Tx, T2400,["My Hours are "] PAUSE 1000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["MON/WED"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["OPEN ALL DAY!"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] SEROUT Tx, T2400,["TUES/THRS"] PAUSE 1000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["BIO 8AM-NOON"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["History 3PM-5PM"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["WEEKENDS"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["OPEN ALL DAY"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURNPeter
I did a copy paste in to a fresh BS2 file on a second computer and its not giving me any fits
' ========================================================================= ' ' File...... Serial_LCD_Template.BS2 ' Purpose... Template for Parallax Serial LCD ' Author.... (c) Parallax, Inc. -- All Rights Reserved ' E-mail.... support@parallax.com ' Started... ' Updated... 11 FEB 2005 ' Modded By Peterthethinker peter Dekluyver ' {$STAMP BS2} ' {$PBASIC 2.5} ' ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' -----[ Revision History ]------------------------------------------------ ' -----[ I/O Definitions ]------------------------------------------------- TX PIN 0 ' serial output to LCD LastTag CON 3 #DEFINE __No_SPRAM = ($STAMP < BS2P) ' does module have SPRAM? ' -----[ Constants ]------------------------------------------------------- T2400 CON 396 T9600 CON 84 T19K2 CON 32 LcdBkSpc CON $08 ' move cursor left LcdRt CON $09 ' move cursor right LcdLF CON $0A ' move cursor down 1 line LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdCR CON $0D ' move pos 0 of next line LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdOn2 CON $17 ' LCD on; cursor off, blink on LcdOn3 CON $18 ' LCD on; cursor on, blink off LcdOn4 CON $19 ' LCD on; cursor on, blink on LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdCC3 CON $FB ' define custom char 3 LcdCC4 CON $FC ' define custom char 4 LcdCC5 CON $FD ' define custom char 5 LcdCC6 CON $FE ' define custom char 6 LcdCC7 CON $FF ' define custom char 7 ' -----[ Variables ]------------------------------------------------------- buf VAR BYTE(10) ' RFID bytes buffer tagNum VAR NIB ' from EEPROM table idx VAR BYTE ' tag byte index char VAR BYTE ' character from table ' -----[ EEPROM Data ]----------------------------------------------------- Tag1 DATA "0F03027DAA" 'My Tag Tag2 DATA "04129C1A1C" Tag3 DATA "041402CCD7" ' -----[ Initialization ]-------------------------------------------------- Reset: HIGH TX ' setup serial output pin PAUSE 100 ' allow LCD to initialize ' -----[ Program Code ]---------------------------------------------------- Main: DO SEROUT Tx, T2400,[LcdBLon]' backlight on SEROUT Tx, T2400,[LcdCLs] SEROUT Tx, T2400,["ROOM #129"] ' HERE to SEROUT Tx, T2400,[LcdLine2]'' down a line SEROUT Tx, T2400,["Peter Dekluyver"] PAUSE 2000 SEROUT Tx, T2400,[LcdCLs] ' HERE is where the Uncomment error is active GOSUB NOW PAUSE 1000 LOOP NOW: GOSUB ROOM GOSUB PHONE GOSUB EMAIL GOSUB SKYPE GOSUB HOURS RETURN TIMER: ' PAUSE 5000 ' GOSUB ROOM ' GOSUB PHONE ' GOSUB EMAIL ' GOSUB SKYPE ' GOSUB HOURS ' SEROUT Tx, T2400,[LcdBLoff]'backlight OFF RETURN 'GOTO Main END ' -----[ Subroutines ]----------------------------------------------------- RFID: '#IF __No_SPRAM #THEN SERIN 1, 396, [WAIT($0A), STR buf\10] ' wait for hdr + ID '#ENDIF Check_List: FOR tagNum = 1 TO LastTag ' scan through known tags FOR idx = 0 TO 9 ' scan bytes in tag READ (tagNum - 1 * 10 + idx), char ' get tag data from table #IF __No_SPRAM #THEN IF (char <> buf(idx)) THEN Bad_Char ' compare tag to table #ELSE GET idx, chkChar ' read char from SPRAM IF (char <> chkChar) THEN Bad_Char ' compare to table #ENDIF NEXT GOTO Tag_Found ' all bytes match! Bad_Char: ' try next tag NEXT Tag_Found: DEBUG "gold" ,CR ' TO PC SEROUT Tx, T2400,["Welcome Peter"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["To THE ROOM"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN END ''''''''''''''''''''''''''''''''''''BLINK BLINK: SEROUT Tx, T2400,[LcdBLon]'backlight OFF PAUSE 50 SEROUT Tx, T2400,[LcdBLoff]'backlight OFF PAUSE 50 RETURN ''''''''''''''''''''''''''''''''''''MYROOM ROOM: SEROUT Tx, T2400,["Welcome to"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["My Room"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''PHONE PHONE: SEROUT Tx, T2400,["My Phone # Is"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["(909)-634-4250"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''EMAIL EMAIL: PAUSE 100 SEROUT Tx, T2400,["My Email is "] PAUSE 750 SEROUT Tx, T2400,[LcdCls] SEROUT Tx, T2400,["Peterthethinker"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["@yahoo.com"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''SKYPE SKYPE: PAUSE 100 SEROUT Tx, T2400,["Skype Me @"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["MVP-studios"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''HOURS HOURS: SEROUT Tx, T2400,["My Hours are "] PAUSE 1000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["MON/WED"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["OPEN ALL DAY!"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] SEROUT Tx, T2400,["TUES/THRS"] PAUSE 1000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["BIO 8AM-NOON"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["History 3PM-5PM"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["WEEKENDS"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["OPEN ALL DAY"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURNwhat I am trying to do is If a valid card is at the reader at the time of scan GOSUB hello peter yada yada . but if no card is there at the time of scan pass on to the next message in the list ..
I think is the wait command thats messing with me //
Peter
' ========================================================================= ' ' File...... Serial_LCD_Template.BS2 ' Purpose... Template for Parallax Serial LCD ' Author.... (c) Parallax, Inc. -- All Rights Reserved ' E-mail.... support@parallax.com ' Started... ' Updated... 11 FEB 2005 ' Modded By Peterthethinker peter Dekluyver ' {$STAMP BS2} ' {$PBASIC 2.5} ' ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' -----[ Revision History ]------------------------------------------------ ' -----[ I/O Definitions ]------------------------------------------------- TX PIN 0 ' serial output to LCD LastTag CON 3 #DEFINE __No_SPRAM = ($STAMP < BS2P) ' does module have SPRAM? ' -----[ Constants ]------------------------------------------------------- T2400 CON 396 T9600 CON 84 T19K2 CON 32 LcdBkSpc CON $08 ' move cursor left LcdRt CON $09 ' move cursor right LcdLF CON $0A ' move cursor down 1 line LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdCR CON $0D ' move pos 0 of next line LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdOn2 CON $17 ' LCD on; cursor off, blink on LcdOn3 CON $18 ' LCD on; cursor on, blink off LcdOn4 CON $19 ' LCD on; cursor on, blink on LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdCC3 CON $FB ' define custom char 3 LcdCC4 CON $FC ' define custom char 4 LcdCC5 CON $FD ' define custom char 5 LcdCC6 CON $FE ' define custom char 6 LcdCC7 CON $FF ' define custom char 7 ' -----[ Variables ]------------------------------------------------------- buf VAR BYTE(10) ' RFID bytes buffer tagNum VAR NIB ' from EEPROM table idx VAR BYTE ' tag byte index char VAR BYTE ' character from table ' -----[ EEPROM Data ]----------------------------------------------------- Tag1 DATA "0F03027DAA" 'My Tag Tag2 DATA "04129C1A1C" Tag3 DATA "041402CCD7" ' -----[ Initialization ]-------------------------------------------------- Reset: HIGH TX ' setup serial output pin PAUSE 100 ' allow LCD to initialize ' -----[ Program Code ]---------------------------------------------------- Main: SEROUT Tx, T2400,[LcdBLon]' backlight on SEROUT Tx, T2400,[LcdCLs] DO IF IN3 =0 THEN GOSUB RFID ELSE GOSUB RoomNum IF IN3 =0 THEN GOSUB RFID ELSE GOSUB WELCOME IF IN3 =0 THEN GOSUB RFID ELSE GOSUB Phone IF IN3 =0 THEN GOSUB RFID ELSE GOSUB EMAIL IF IN3 =0 THEN GOSUB RFID ELSE GOSUB SKYPE IF IN3 =0 THEN GOSUB RFID ELSE GOSUB Hours PAUSE 1000 LOOP ' -----[ END OF Program Code ]---------------------------------------------------- ' -----[ RFID Subroutine ]----------------------------------------------------- RFID: LOW 2' NOT USED #IF __No_SPRAM #THEN SERIN 1, T2400, [WAIT($0A), STR buf\10] ' wait for hdr + ID #ELSE SERIN 1, T2400, [WAIT($0A), SPSTR 10] #ENDIF HIGH 2 ' NOT USED Check_List: FOR tagNum = 1 TO LastTag ' scan through known tags FOR idx = 0 TO 9 ' scan bytes in tag READ (tagNum - 1 * 10 + idx), char ' get tag data from table #IF __No_SPRAM #THEN IF (char <> buf(idx)) THEN Bad_Char ' compare tag to table #ELSE GET idx, chkChar ' read char from SPRAM IF (char <> chkChar) THEN Bad_Char ' compare to table #ENDIF NEXT GOTO Tag_Found ' all bytes match! RETURN Bad_Char: ' try next tag NEXT RETURN Bad_Tag: tagNum = 0 GOTO tagdone Tag_Found: DEBUG buf,CR SEROUT Tx, T2400,["Welcome Peter"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["TO THE ROOM"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 TOGGLE 10 ' for alarm later on GOSUB blink GOSUB blink GOSUB blink GOSUB blink GOSUB blink GOTO tagdone tagdone: RETURN ' -----[ Subroutines ]----------------------------------------------------- ''''''''''''''''''''''''''''''''''''BLINK BLINK: SEROUT Tx, T2400,[LcdBLon]'backlight on PAUSE 50 SEROUT Tx, T2400,[LcdBLoff]'backlight OFF PAUSE 50 SEROUT Tx, T2400,[LcdBLon]'backlight on PAUSE 50 SEROUT Tx, T2400,[LcdBLoff]'backlight OFF PAUSE 50 SEROUT Tx, T2400,[LcdBLon]'backlight on PAUSE 50 SEROUT Tx, T2400,[LcdBLoff]'backlight OFF PAUSE 50 SEROUT Tx, T2400,[LcdBLon]'backlight on RETURN ''''''''''''''''''''''''''''''''''RoomNum RoomNum: SEROUT Tx, T2400,["ROOM #129"] SEROUT Tx, T2400,[LcdLine2]'' down a line SEROUT Tx, T2400,["Peter Dekluyver"] PAUSE 2000 SEROUT Tx, T2400,[LcdCLs] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''WELCOME Welcome: SEROUT Tx, T2400,["Welcome to"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["My Room"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''PHONE PHONE: SEROUT Tx, T2400,["My Phone # Is"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["(909)-634-4250"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''EMAIL EMAIL: PAUSE 100 SEROUT Tx, T2400,["My Email is "] PAUSE 750 SEROUT Tx, T2400,[LcdCls] SEROUT Tx, T2400,["Peterthethinker"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["@yahoo.com"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''SKYPE SKYPE: PAUSE 100 SEROUT Tx, T2400,["Skype Me @"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["MVP-studios"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURN ''''''''''''''''''''''''''''''''''''HOURS HOURS: SEROUT Tx, T2400,["My Hours are "] PAUSE 1000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["MON/WED"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["OPEN ALL DAY!"] PAUSE 2000 SEROUT Tx, T2400,[LcdCls] SEROUT Tx, T2400,["TUES/THRS"] PAUSE 1000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["BIO 8AM-NOON"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["History 3PM-5PM"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 SEROUT Tx, T2400,["WEEKENDS"] PAUSE 500 SEROUT Tx, T2400,[LcdLine2] PAUSE 250 SEROUT Tx, T2400,["OPEN ALL DAY"] PAUSE 3000 SEROUT Tx, T2400,[LcdCls] PAUSE 100 RETURNThis might help you in what you want to
' -----[ Subroutines ]----------------------------------------------------- Tag_Found: ON tagNum GOSUB Routine0, Routine1, Routine2, Routine3 ' -----[Card's Subroutines ]----------------------------------------------------- ' To use differnet Card for differnet amount of Time ' Card # 0 is fot Unauthorized CARD ' Card # 1 is fot 15 Minutes and 00 Seconds ' Card # 2 is fot 30 Minutes and 00 Seconds ' Card # 3 is fot 59 Minutes and 59 Seconds ' 'Unauthorized CARD Routine 'Unauthorized CARD Led Light...... Routine0: mins=$00 secs=$00 GOSUB Set_Time HIGH Invaild_Card 'Turn ON Led DO HIGH tick PAUSE 500 LOW tick GOSUB Get_Time IF mins=$00 AND secs=$20 THEN EXIT DEBUG HOME, HEX2 mins, ":", HEX2 secs, CR DEBUG CR, CR, "Unauthorized CARD", CR LOOP DEBUG CLS, CLS ' Turn OFF Led LOW Invaild_Card GOTO main '15 Minutes CARD Routine Routine1: mins=$00 secs=$00 GOSUB Set_Time GOSUB Get_Time DO HIGH tick PAUSE 30 LOW tick IF mins=$00 AND secs=$05 THEN HIGH relay HIGH card15 ENDIF ' Turn ON Relay IF mins=$15 AND secs=$00 THEN EXIT GOSUB Get_Time DEBUG HOME, HEX2 mins, ":", HEX2 secs, CR DEBUG CR, CR, "15 MIN CARD ", CR LOOP DEBUG CLS, CLS LOW relay LOW card15 ' Turn OFF Relay GOTO main '30 Minutes CARD Routine Routine2: mins=$00 secs=$00 GOSUB Set_Time GOSUB Get_Time DO HIGH tick PAUSE 30 LOW tick IF mins=$00 AND secs=$05 THEN HIGH relay HIGH card30 ENDIF ' Turn ON Relay IF mins=$30 AND secs=$00 THEN EXIT GOSUB Get_Time DEBUG HOME, HEX2 mins, ":", HEX2 secs, CR DEBUG CR, CR, "30 MIN CARD " LOOP DEBUG CLS, CLS LOW relay LOW card30 ' Turn OFF Relay GOTO main '60 Minutes CARD Routine Routine3: mins=$00 secs=$00 GOSUB Set_Time GOSUB Get_Time DO HIGH tick PAUSE 30 LOW tick IF mins=$00 AND secs=$05 THEN ' Turn ON Relay HIGH relay HIGH card60 ENDIF IF mins=$59 AND secs=$59 THEN EXIT GOSUB Get_Time ' 60 MIN CARD DEBUG HOME, HEX2 mins, ":", HEX2 secs, CR DEBUG CR, CR, "60 MIN CARD " LOOP DEBUG CLS, CLS LOW relay LOW card60 ' Turn OFF Relay GOTO mainit runs BUT here is the kicker . Unless I scan a card ( good or bad ) it will not pass over the RFID code back to the main code .
GOTO tagdone
tagdone:
RETURN
You have to tell your code where to go next
My device goals were 2 things . it reads a RFID reader so I can disarm a alarm and display a " welcome home peter " message .
it also displays a constant message if no RFID card is present ..
the last function is where I had to cheat .
I used a push tact switch to enable the GOSUB . IN3 is low then read .
as if I just go to it and do the RFID SUB as a poor mans polling ,
the code will hang and wait for a serial input .til the end of time .
I think its the wait command in the RFID read section .
I feel a Prop or some other 2 or more core MCU is needed .. OR interrupts.. both a BS2 cant do as far as i am aware
peter
DO 'SEROUT CommPin, BaudValue, [CLRP] ' Clears any prior position info LOW H25_Fan ' Turn OFF Cooling Fan DEBUG " Pick_One" ,CR cntr = cntr + 1 * ByPass_Switch ' This Routine was add because if you pushed the ByPass IF ( cntr = 5 ) THEN ' switch again it would go HOME not just STOP IF Home_Switch = 0 THEN ' This is the HOME INPUT SWICH on the GOSUB Backwards ' gate opener arm retracked postion switch ELSEIF IN2 = 1 THEN GOSUB Forwards ' This part of the routine need to be fix ELSE ' ELSEIF IN2 = 1 THEN GOSUB Start ENDIF ENDIF Reader1: LOW Enable1 ' activate the reader - 1 DEBUG "Reader1" #IF __No_SPRAM #THEN SERIN RX1, T2400, 150, Reader2, [WAIT($0A), STR buf\10] ' wait for hdr + ID #ELSE SERIN RX1, T2400, 150, Reader2, [WAIT($0A), SPSTR 10] #ENDIF HIGH Enable1 ' deactivate reader - 1 PAUSE 200 GOTO Check_List Reader2: LOW Enable2 ' activate the reader - 2 DEBUG "Reader2" #IF __No_SPRAM #THEN SERIN RX2, T2400, 150, Pick_One, [WAIT($0A), STR buf\10] ' wait for hdr + ID #ELSE SERIN RX2, T2400, 150, Pick_One, [WAIT($0A), SPSTR 10] #ENDIF HIGH Enable2 ' deactivate reader - 2 PAUSE 200 GOTO Check_List LOOPThis what you have now
SERIN RX, T2400, [WAIT($0A), STR buf\10] ' wait for hdr + ID
Use this
This line time out then gose to other card reader
SERIN RX1, T2400, 150, Reader2, [WAIT($0A), STR buf\10]
Here where you would put your own code name routine I have this Reader2