fl \ a simple terminal which interfaces to a serial port \ term ( n1 -- ) n1 - the cog : term ." Hit CTL-F to exit comterm" cr cogid swap iolink begin key dup 6 = if drop 1 else emit 0 then until cogid iounlink ; : demo 7 7 19200 4 startserialcog 10 delms 4 term ; fl \ a simple terminal which interfaces to a serial port \ term ( n1 -- ) n1 - the cog : term ." Hit CTL-F to exit comterm" cr cogid swap iolink begin key dup 6 = if drop 1 else emit 0 then until ; : demo 7 7 19200 4 startserialcog 10 delms 4 term ; fl fswrite lcdserlnk.f { LCD Serial Link Routines to setup a serial process in a cog to permit writing to a serial enabled LCD. You initialize the serial cog with 'startLCD' and display text with 'strlnk' (still to be completed - routines for formatted numbers). All display routines start with a 'maklnk' and conclude with 'brklnk', which, effectively, turns console mirroring on then off. 3 October 2011 Brian Riley, Underhill Center, VT, USA } { create console link to LCD using cog 4 maklnk ( -- ) } : maklnk 4 cogid swap iolink ; { break console link to LCD brklnk ( -- ) } : brklnk cogid iounlink ; { display string ( cstr -- ) - based upon string write word from CasKaz's parallel LCD routines - the 10 ms delay just before brklnk MUST be there to give the iolink routines time to flush its buffer } : strlnk maklnk C@++ dup if bounds do i C@ emit loop else 2drop then 10 delms brklnk cr ; { clear/home screen of LCDpa clrlcd ( -- ) - "?f" is the string for a Peter Anderson serial LCD chip, edit this to your flavor } : clrlcd c" ?f" strlnk ; { initiate serial process in cog 4 startLCD ( -- ) - by using the same pin spec for tx and rx, pin 7, you get a simple loopback and mirroring of main console whenever iolink is active } : startLCD 7 7 19200 4 startserialcog 10 delms clrlcd ; ... fl : tst2 begin key? if ." key hit" cr exit then until cr cr ." over " cr cr ;