Keyboard Input
[Deleted User]
Posts: 0
Hi,
·Do I have to do this for all key's , or is there a easier way !!
·If ASCII_Key == $CB·········· 'Looks for Esc Key ($CB)
····· Start···················· 'Restarts program·
· Case ASCII_Key
···· "0" : LCD.Str(string("0"))
···········store := 0
···· "1" : LCD.Str(string("1"))
···········store := 1
···· "2" : LCD.Str(string("2"))
···········store := 2
···· "3" : LCD.Str(string("3"))
···········store := 3
···· "4" : LCD.Str(string("4"))
·········· store:= 4
···· "5" : LCD.Str(string("5"))
···········store := 5
···· "6" : LCD.Str(string("6"))
···········store := 6
···· "7" : LCD.Str(string("7"))
···········store := 7
···· "8" : LCD.Str(string("8"))
···········store := 8
···· "A" : LCD...................
Thanks,Brian···································
·
·Do I have to do this for all key's , or is there a easier way !!
·If ASCII_Key == $CB·········· 'Looks for Esc Key ($CB)
····· Start···················· 'Restarts program·
· Case ASCII_Key
···· "0" : LCD.Str(string("0"))
···········store := 0
···· "1" : LCD.Str(string("1"))
···········store := 1
···· "2" : LCD.Str(string("2"))
···········store := 2
···· "3" : LCD.Str(string("3"))
···········store := 3
···· "4" : LCD.Str(string("4"))
·········· store:= 4
···· "5" : LCD.Str(string("5"))
···········store := 5
···· "6" : LCD.Str(string("6"))
···········store := 6
···· "7" : LCD.Str(string("7"))
···········store := 7
···· "8" : LCD.Str(string("8"))
···········store := 8
···· "A" : LCD...................
Thanks,Brian···································
·
Comments
I'm trying to , 1)Enter a number(display while entering),·2) Store a Number 3), Display the stored number
PRI Input_Info
repeat
Num1 := kb.getkey
tv.out(Num1)
Num2 := Num1
until Num1 == $0D
Waitcnt (clkfreq/2 +cnt)
tv.out(Num2)
Thanks,Brian
Post Edited (truckwiz) : 12/9/2006 3:09:36 AM GMT
To output decimal numbers, you just have to use the dsp.dec() call.
Mike
That just freed up my whole weekend !!
Thanks, Brian
·Works awsome !! Have two little proplems ,1) first key you hit on enter numbers doesn't show
·2) all the operators work except add wants to subtract.
Thanks,Brian
Post Edited (truckwiz) : 12/9/2006 6:11:29 AM GMT
Mike
·Everything working great now,except first digit fails to appear when entering numbers.
Thanks,Brian
Post Edited (truckwiz) : 12/9/2006 6:33:34 AM GMT
·I Better go to bed , my wife is getting mad
Thanks,Brian
·Oh how things look differnt in the light of day . Working on cleaning this up a little . Made Mikes code into it's own object . making object for operators . How far back can you call up objects , the dsp.() is giving me a error now. Don't have time too check into it now, 50 deg. in MN on the 9th of December don't happen very often.
Brian
·Throwing away version[noparse][[/noparse]0].6 , picking back up where I left off on version [noparse][[/noparse]1].5
Brian
·Back to code from last night with some minor inprovements, Starting to work on shifts , rotates , boolean operators . Tried them a little bit , looks like I'm doing some more reading.
Brian
( I uploaded the wrong one , this is the right one)
Post Edited (truckwiz) : 12/9/2006 11:41:57 PM GMT
Is there away to shorten this ?
dsp.out($0A,0)
dsp.out(0)
dsp.out($0b)
dsp.out(6)
dsp.dec(total)
dsp.out($0A)
dsp.out(0)
dsp.out($0B)
dsp.out(7)
dsp.hex(total,8)
dsp.out($0A)
dsp.out(0)
dsp.out($0b)
dsp.out(8)
dsp.bin(total,32)
I know this don't work , but somthing like this.
dsp.out ($0a,0,$0b,0,)
Thanks,Brian
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 12/10/2006 3:17:25 AM GMT
In the Propeller OS, I've got these routines in the display interface up to 6 arguments to account for the longest display command.
Mike
Looks much cleaner
Thanks,Brian
Post Edited (truckwiz) : 12/10/2006 4:22:40 AM GMT
Anybody have any vga & mouse demo programs that I could take a peek at ?
Thanks,Brian
Chip has made similar higher resolution drivers that use more cogs to handle the higher speed necessary. I think there's a 1200 x 1024 driver that uses 4 cogs and a 1600 x 1200 driver that uses 6 cogs (just for the video). A cursor requires an additional cog and the main program itself requires one.
Post Edited (Mike Green) : 12/10/2006 8:36:08 PM GMT
Tried running it. I get a error message " missing Lincoln. txt in propeller library ".
Thanks,Brian
Brian
Brian
(if I would have read your first message all the threw ,there would have been no need for any further messages )
Post Edited (truckwiz) : 12/10/2006 9:43:25 PM GMT
The more I think about the features that should be added to this trainer, the more I’m thinking GUI. Been playing around with Chips demo and beleive that a object could be written to control all the aspects of each button. Any thoughts on this??
Brian
Now that there's a nice VGA driver with reasonable memory and cog requirements and a cursor (and some graphics capability memory permitting), a GUI would be nice. I would suggest initially doing it without a mouse, maybe moving from object to object with the keyboard tab key (and shift tab for backwards). This makes it possible to not use a mouse (and free up a cog) for now, but add a mouse later. The display interface routines for the Propeller OS use an extended version of the windowed text display routines posted long ago to this forum. They allow up to 15 windows with scrolling and other control functions limited to the current window. The number of windows could be expanded easily enough to 31 with each containing a field or button (window 0 is the whole screen). A routine could be easily added to identify the window being clicked in by the mouse. A list of windows containing GUI objects could be maintained separately along with the behavior of each type of object. Just thinking ...
Mike
·Also ,If anybody else is working on this, be carefull not to draw a box outside the screen.The propeller·will get really mad !!
Post Edited (truckwiz) : 12/11/2006 4:40:21 AM GMT
·This question has been bugging me for a long time. If you look at the diagrams of the propeller it shows a rotating cog. I know that things have really come along way in silicon fabrication, but do we really have rotating cog or is that to make us gear heads feel better. “Yah I have 500 hp in my cog, what about yours”
·
Brian
when my text look's like this , I used spell check !!
Post Edited (truckwiz) : 12/11/2006 6:38:52 AM GMT
Here is a picture of the propeller silicon (taken from http://www.circuitcellar.com/library/print/0806/Cantrell193/4.htm ).
Post Edited (Harrison.) : 12/11/2006 5:47:21 AM GMT
I don't remember the "guihires" item. A lot has gone on since that point in terms of display drivers. I'm really excited about the VGA Tiled Drivers in that they allow small areas of high resolution graphics to be embedded within a mostly text screen. The VGA 1024x768 Tiled Driver has very modest memory and cog needs, yet provides a 64x24 character screen with very crisp characters, lots of different colors, and the ability to embed small areas of high resolution bitmapped graphics (small areas to save on memory needs). Look at Chip's example of the use of the driver. He's got a couple of buttons that look very nice using some special features of the built-in character set.
Mike
I had 32 buttons up at one time,you have to be very careful how you place them. It took me a long time to get my propeller to take any code after I miss loaded with buttons that where off the screen.(trust me ,you don't want to see the code!!)
Brian
Thank you for the info Harrison !!··
Post Edited (truckwiz) : 12/11/2006 6:14:17 AM GMT