Pinguino Forum
Pinguino C code - Printable Version

+- Pinguino Forum (http://forum.pinguino.cc)
+-- Forum: General (http://forum.pinguino.cc/forumdisplay.php?fid=5)
+--- Forum: Frequently-Asked Questions (http://forum.pinguino.cc/forumdisplay.php?fid=9)
+--- Thread: Pinguino C code (/showthread.php?tid=4280)



Pinguino C code - ahmedebeed555 - 22-02-2014

Hello, I 'm new to Pinguino. Can I open C code for PIC18F4550 in Pinguino , compile and upload hex file ?


RE: Pinguino C code - gtcbreizh - 22-02-2014

(22-02-2014, 09:34 PM)ahmedebeed555 Wrote: Hello, I 'm new to Pinguino. Can I open C code for PIC18F4550 in Pinguino , compile and upload hex file ?

Hello,
Would you attach an C code example you would like to compile and upload in your Pic18f4550 in order we could put it in a format acceptable by the Pinguino IDE and show you the way to follow ?
André


RE: Pinguino C code - ahmedebeed555 - 22-02-2014

(22-02-2014, 10:58 PM)gtcbreizh Wrote:
(22-02-2014, 09:34 PM)ahmedebeed555 Wrote: Hello, I 'm new to Pinguino. Can I open C code for PIC18F4550 in Pinguino , compile and upload hex file ?

Hello,
Would you attach an C code example you would like to compile and upload in your Pic18f4550 in order we could put it in a format acceptable by the Pinguino IDE and show you the way to follow ?
André

Thank you for your reply. I attached a blink program in C that I 've tried before to be working and uploaded it using IcSP programmer.

Now , I want to upload it using Pinguino.

Is this possible ?


RE: Pinguino C code - gtcbreizh - 23-02-2014

(22-02-2014, 11:13 PM)ahmedebeed555 Wrote:
(22-02-2014, 10:58 PM)gtcbreizh Wrote:
(22-02-2014, 09:34 PM)ahmedebeed555 Wrote: Hello, I 'm new to Pinguino. Can I open C code for PIC18F4550 in Pinguino , compile and upload hex file ?

Hello,
Would you attach an C code example you would like to compile and upload in your Pic18f4550 in order we could put it in a format acceptable by the Pinguino IDE and show you the way to follow ?
André

Thank you for your reply. I attached a blink program in C that I 've tried before to be working and uploaded it using IcSP programmer.

Now , I want to upload it using Pinguino.

Is this possible ?

Would you use the Pinguino IDE and Library ? If yes, did you already install them ?
Would you use the Pinguino bootloader either V2.12 or V4.14 or would you simply use your board in ICSP mode ?
Did you look at the Wiki. There you could study several examples to understand the Pinguino philosophy very closed to the Arduino one.


RE: Pinguino C code - ahmedebeed555 - 23-02-2014

Hello. I am using Pinguino IDE x4v959 and bootloader v4.14. And programmed some successful *.pde files and uploaded them and worked good.

I just wanted to open C code into Pinguino IDE and compile it then upload the Hex file using Pinguino IDE to Pinguino 18F4550 board.

Is this possible ?

Is this mentioned in the Wiki ?

If yes please send me the link to it.

Thank you all.


RE: Pinguino C code - gtcbreizh - 23-02-2014

(23-02-2014, 11:11 AM)ahmedebeed555 Wrote: Hello. I am using Pinguino IDE x4v959 and bootloader v4.14. And programmed some successful *.pde files and uploaded them and worked good.

I just wanted to open C code into Pinguino IDE and compile it then upload the Hex file using Pinguino IDE to Pinguino 18F4550 board.

Is this possible ?

Is this mentioned in the Wiki ?

If yes please send me the link to it.

Thank you all.

You cannot directly compile a C code. You must at least put this in your program :

void setup() {
//run once:

}

void loop() {
//run repeatedly:

}
and complete like this (for your example) :
-----------------------------------------------------*/
/* *************** TIMER *************** */
void delayzz(void)
{ int i, j;
for(i=0;i<5000;i++)
{
for(j=0;j<2;j++)
{ /* Well its Just a Timer */ }
}
}



void setup() {
//run once:
TRISB = 0xF0 ; // PORT B Setting: Set all the pins B0 B1 B2 B3 to Output.

}

void loop() {
//run repeatedly:
LATBbits.LATB0 = 1; // RB-1 to High
LATBbits.LATB1 = 1; // RB-1 to High

delayzz();

LATBbits.LATB0 = 0; // RB-0 to LOW
LATBbits.LATB1 = 0; // RB-0 to LOW

delayzz();


}
Good luck


RE: Pinguino C code - ahmedebeed555 - 23-02-2014

Thank you very much.