PR26 (Build Failed)

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

Re: PR26 (Build Failed)

Postby ober » Tue Mar 29, 2011 10:47 pm

WSTOK WROTE:Hi Ober,

i had try the mouse source code and i facing some error when i build all. Kindly advice.


Er... most of the missing are from C18 Compiler. Try to search the header folder of MCC18.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: PR26 (Build Failed)

Postby WSTOK » Wed Mar 30, 2011 9:27 pm

Hi Ober,

Sorry i am not very familiar with this c18 compiler :P . Are u mean that the header folder of MCC18 as highlighted as picture below?Thanks

And yonghui thanks for ur sharing.
Attachments
mcc18.jpg
Select language toolsuite for microchip c18 toolsuite
WSTOK
Newbie
 
Posts: 13
Joined: Thu Sep 02, 2010 7:19 pm

Re: PR26 (Build Failed)

Postby yonghui » Wed Mar 30, 2011 11:38 pm

hi,

for my installation, i found the file in C:\Program Files\Microchip\mplabc18\v3.37.01\h
u should be able to find in some similar directory, u should check how the file is included in ur c code.
isit by specifying the directories?
u can delete the path. and directly #include "file name"
u copy all those required file into ur project directory
then u will sure find it.
or else u will need to set the include search path from project setting.


regards,
yh
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: PR26 (Build Failed)

Postby WSTOK » Thu Mar 31, 2011 11:36 pm

Hi Yonghui,

Thank you for your patient to sharing with me. Now i got it already and this video clip also showing the method that u trying to tell me. Thanks! http://www.youtube.com/watch?v=84Tu4eLTLVY
WSTOK
Newbie
 
Posts: 13
Joined: Thu Sep 02, 2010 7:19 pm

Re: PR26 (Build Failed)

Postby Innovative » Sat Aug 13, 2011 2:10 am

I have succefully build the Game Console and mouse functioning. Is anybody can teach me how to convert to Keyboard function? I just would like to make it able to key in something in the notepad.
I have search around the net, but they don't have comprehensive solution. It is better can provide the main.c, USB_descriptor.c, USB_config.h...etc.
Innovative
Newbie
 
Posts: 10
Joined: Thu Jan 27, 2011 1:11 pm

Re: PR26 (Build Failed)

Postby A380 » Sat Aug 13, 2011 10:15 am

Hi, actually Microchip also provide the keyboard USB framework on its site for free. You try replace your PR26 usb_config.h, usb_descriptors.c and main.c files with attached files. Then build it and load your program to your PR26. When you press Button 1, some characters should be sent to your PC.
CODE: SELECT_ALL_CODE
if(b_1 == 0)      // test button 1
        {
           //Load the HID buffer
           hid_report_in[0] = 0;
           hid_report_in[1] = 0;
           hid_report_in[2] = key++;    // ASCII
           hid_report_in[3] = 0;
           hid_report_in[4] = 0;
           hid_report_in[5] = 0;
           hid_report_in[6] = 0;
           hid_report_in[7] = 0;
              //Send the 8 byte packet over USB to the host.
              lastINTransmission = HIDTxPacket(HID_EP, (BYTE*)hid_report_in, 0x08);
   
            if(key == 40)
            {
                key = 4;
            }
        }

Under void Emulate_Joystick(void) function, you can simply change the sending character by replace the "key++". ASCII table, http://www.asciitable.com/
User avatar
A380
Discoverer
 
Posts: 120
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

Re: PR26 (Build Failed)

Postby Innovative » Sat Aug 13, 2011 6:58 pm

Hi A380,
Thank you for your prompt response!
I have followd your way to modify the code from Joystick, it builded failed. Nevertheless, i tried the .zip file you uploaded, it shown the same faliure as well.
Error [1105] symbol 'lastINTransmission' has not been defined
Error [1105] symbol 'key' has not been defined

Can you tell me how to define the 'lastINTransmission' and 'key'

Thanks!
Innovative
Newbie
 
Posts: 10
Joined: Thu Jan 27, 2011 1:11 pm

Re: PR26 (Build Failed)

Postby A380 » Sat Aug 13, 2011 8:28 pm

Hi,

Sorry.. Try again with attached files now.. I tried it, compiled successful.
Attachments
PR26 Keyboard.zip
(17.9 KiB) Downloaded 241 times
User avatar
A380
Discoverer
 
Posts: 120
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

Re: PR26 (Build Failed)

Postby Innovative » Sat Aug 13, 2011 10:11 pm

A380 WROTE:Hi,

Sorry.. Try again with attached files now.. I tried it, compiled successful.



Yeah!! it work well, now let me try feel ASCII code and see..
But weird thing is..
I follow the ASCII code put "0x35".. but it come out "' ' "
then i put "0x38... it come out " / "
how come is it not come out number "5" and number "3"?
it is enuf.. i can figure out it.. as long as can get input from the PIC18F2550 then I happy d...
Thank you very much!!

Thank you!!
Innovative
Newbie
 
Posts: 10
Joined: Thu Jan 27, 2011 1:11 pm

Re: PR26 (Build Failed)

Postby A380 » Sun Aug 14, 2011 11:35 am

Hi,

Glad to hear that. Sorry again, USB keyboard should not refer to ASCII table.. hahaha.. should refer to this table, http://www.usb.org/developers/devclass_docs/Hut1_11.pdf page 53 under "10 Keyboard/Keypad Page (0x07)". "Usage ID (Hex)" column is what you need.
User avatar
A380
Discoverer
 
Posts: 120
Joined: Tue May 19, 2009 2:44 pm
Location: Malaysia

PreviousNext

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 2 guests