![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
Any one here worked on projects that involve the pic sending keyboard commands to the computer? I would like to see some code if possible ![]() I want the pic to send numbers to Rhino 3D so I can do some simple 2D digitizing. The numbers will come from rotory encoders with wheels rolling on a X Y plane. Thanks
__________________ Dennis |
|
#2
| |||
| |||
| can you not use the Rs232 interface rather than the AT keyboard. I made benchsaw fence DRO using a couple if pics and the encoders from a mouse had to gear it right down but it worked a treat. there are plenty of microchip programing sites about. |
|
#3
| |||
| |||
| Have a look at http://users.picbasic.org/?page=howtolist there are articles on how to talk to pc keyboards, should give you a good starting point. |
|
#5
| |||
| |||
| PS/2 Library mikroBasic provides a library for communicating with common PS/2 keyboard. The library does not utilize interrupts for data retrieval, and requires oscillator clock to be 6MHz and above. Library Example This simple example reads values of keys pressed on PS/2 keyboard and sends them via USART. program ps2_test dim keydata, special, down as byte main: CMCON = $07 ' Disable analog comparators (comment this for P18) INTCON = 0 ' Disable all interrupts Ps2_Init(PORTA) ' Init PS/2 Keyboard on PORTA Delay_ms(100) ' Wait for keyboard to finish do if Ps2_Key_Read(keydata, special, down) = 1 then if (down = 1) and (keydata = 16) then ' Backspace ' ...do something with a backspace... else if (down = 1) and (keydata = 13) then ' Enter Usart_Write(13) else if (down = 1) and (special = 0) and (keydata <> 1) then Usart_Write(keydata) end if end if end if end if Delay_ms(10) ' debounce loop until FALSE end. http://www.mikroe.com/en/compilers/ http://www.mikroe.com/en/compilers/ |
| Sponsored Links |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |