Keyboard Demo
dragonvet
Posts: 17
In the following;(Keyboard_Demo)
CON
······· _clkmode······· = xtal1 + pll16x
······· _xinfreq······· = 5_000_000
OBJ
······· term··· : "tv_terminal"
······· kb····· : "keyboard"
PUB start | i
· 'start the tv terminal
· term.start(12)
· term.str(string("Keyboard Demo...",13))
· 'start the keyboard
· kb.start(26, 27)
· 'echo keystrokes in hex
· repeat
··· term.hex(kb.getkey,3)
··· term.out(" ")
{{
I assume the numbers in parentheses are pin numbers...
when I try to change term to "FullDuplexSerial"
and change the pin number to another number I get an error message saying
expected··· ·","····· (·ie list delimiter)
my goal is to type a number string·on the keyboard and have it display on an LCD
(and also create a frequency in hertz matching that number)
thanks,
Rich
CON
······· _clkmode······· = xtal1 + pll16x
······· _xinfreq······· = 5_000_000
OBJ
······· term··· : "tv_terminal"
······· kb····· : "keyboard"
PUB start | i
· 'start the tv terminal
· term.start(12)
· term.str(string("Keyboard Demo...",13))
· 'start the keyboard
· kb.start(26, 27)
· 'echo keystrokes in hex
· repeat
··· term.hex(kb.getkey,3)
··· term.out(" ")
{{
I assume the numbers in parentheses are pin numbers...
when I try to change term to "FullDuplexSerial"
and change the pin number to another number I get an error message saying
expected··· ·","····· (·ie list delimiter)
my goal is to type a number string·on the keyboard and have it display on an LCD
(and also create a frequency in hertz matching that number)
thanks,
Rich
Comments
*Peter*
I'm not really sure what your asking.
Is your problem with the use of the Keyboard object or the FullDuplexSerial object -> LCD Display?
What line of code is producing that error?
If your trying to do a "drop-in" replacement of the tv_terminal object to the FullDuplexSerialObject, you have to make a couple of more changes to the program;
While the tv_terminal object can be started with a tv_terminal.Start(basepin), the fullduplexserial object requires a bit more information to start the object (from the FullDuplexSerial Documentation):
FullDuplexSerial.start(rxpin, txpin, mode, baudrate)
Without going too much further, is the error being generated by the line:
term.start(12)?
(when changing the pin# also would apply)
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
·
Yes, the problem was with the line
term.start(12)
so when setting those 4 parameters rx and tx are obvious for me and I know where and what numbers to call the baud rate , my next question is what and/or how do you determine mode and what value to apply for it? Just plugging a number in at that spot gets me farther than before ( in terms of no error ) but I'd like to know how that value is determined. Also, how do you know what baud rate is appropriate for baud rate value?
Thanks,
Rich
There are no fixed values for the baudrate - only an upper-limit - in the FullDuplexSerial ... I believe. Dunno what the limit is, but ~100k should work. The thing with the baudrate is - you have to use the same on both sides. So, have a look at your terminal SW on PC side, check what baudrate it offers and use the same for the FullDuplex - of course up to the limit.
As far as what the values of the mode could be...you need to open the object your trying to use...and click the Documentation option on the right. I have attached a screebshot which should help explain this.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
Post Edited (CassLan) : 7/24/2009 1:33:54 PM GMT
Yes I found where the mode value options are , I just didn't know how you determined which one to pick . It is a 2x16 serial LCD non back li part #27976. Do you look at the datasheet for htis part?
thanks again ,
Rich
Once again, everybody is telling you to look at the Spin file for the object, it's like the datasheet for the lcd, it tell's you all about it.
*Peter*