Jump to content

Attention: RC-CAM.com will be closing down August 2021.

The RC-Cam.com forum was the very first online community dedicated to the advancement of wireless video cameras on radio controlled (R/C) models. This is now called "FPV" (First Person View). We are proud of the contributions that our members have made to the FPV hobby.

We've seen significant changes over the last twenty years. Initially there were a lot of eager R/C hobbyist that built their own video systems. Allowing these creative individuals to share their work was the purpose of this site. Now the FPV market is flooded with low cost systems; Sadly DiY FPV video projects are now rarely discussed.

RC-CAM.com (main site and forum) will be closing down August 2021. This is being announced now (March 2021) so that everyone has time to download any information that is important to them. After the site is shutdown the information will no longer be available here.

We appreciate every member's involvement with advancing the FPV hobby. It is indeed sad to say goodbye to all our online friends. Be safe and stay healthy.

Can anyone help me?

Recommended Posts

I have made RC-Cam's landtastic and i wondered if there was any way someone could make like an example code filethat would show me the basics of using the signal wire of a radio control unit to do stuff so i could possibly make a little unit that plugs into a receiver then when you flick a switch it lights up an LED or something, i would love it if you could help me!!!


Link to post
Share on other sites

It provides the HEX code, and it's a ppm input code I presume but not proportional output. You mentioned in your post that you wanted to light up an LED or something which is a binary output, not an analog output.

Link to post
Share on other sites

sorry im not too familliar with C, is there another source file with that?

#include <12F675.h>

// Camera has 2 lines for focus and shutter, 3.3V pulled down by 2-pos switch

#define Servo_in	PIN_A5 //PIN_A0

#define Focus_out	PIN_A1 //PIN_A4

#define	Shutter_out	PIN_A0 //PIN_A1

void main(void)



	ENABLE_INTERRUPTS(INT_RA5); // Pin state change interrupt on pin GP5




#INT_RA // Port state change interrupt

void servo_int(void)


	int16 Width=0;

	if(input(Servo_in)) // rising edge



		SETUP_TIMER_1(T1_INTERNAL|T1_DIV_BY_1);	//reset and start timer


	else	// falling edge


		SETUP_TIMER_1(T1_DISABLED);	//stop timer

		Width = GET_TIMER1();

		if(Width > 1333)




		if(Width > 1666)






EDIT: ah, i think i understand, there is a .h file for all the different PICs with all the relevant inputs then you #include the one for the PIC you use, could you upload or link me to where i would be abkle to get them all? thanks

Edited by vane
Link to post
Share on other sites

The .h file is specific to the compiler. If you install the same compiler as me (CCS PICC compiler), the headers will be installed at the same time and you'll be able to compile the code as it is here.

If you use another compiler, you might need to change that, maybe it won't even need a header, and you'll have to adapt the code a bit to its workings (the output_low(), SETUP_TIMER_1(), and other ENABLE_INTERRUPTS() might not exist in that compiler).

C in the microcontroller world is different to that in the PC world - on a PC all compilers will behave more or less the same and have all the same base standard built-in functions. In the microcontroller world all compilers are different, and the way each one requires you to code can differ a lot. For example if I was to port that code for another compiler I use now, I'd have to change all the function calls, because those who made that compiler didn't find worth it to include a level of abstraction for all those basic functions, so instead of writing a simple



that is device-independent, I would have to look at the datasheet of the specific PIC controller I'm using, find the registers that hold the bits that enables all interrupts and the pin change interrupt and set those bits to 1 directly at the lowest level, for example for a 12F675 with

INTCON.GIE=1; // global

INTCON.GPIE=1; // GPIO interrupt

IOC.5=1; //pin GP5

So my posting was obviously more of an example. The advantage of that compiler is that the very descriptive function names are close to pseudo-code, easy to understand without even commenting, so you should grasp the idea easily to reproduce it in the way your compiler will expect it.

Link to post
Share on other sites


They have a 30-day demo. However after that the $350 would not make much sense just for hobby projects unless you really want to get deep into it...

An intermediate solution could be http://www.mikroe.com/en/compilers/mikroc/pic/

A bit cheaper at $250, and they have very good experimentation boards too. They have cheaper $150 compilers for other languages (basic and pascal) too.

There's still no free C compilers for PIC that I know of. If that's what you're looking for you'd better have a look at Atmel's AVRs.

Edited by Kilrah
Link to post
Share on other sites

Oh, I see HI-TECH have released an unlimited free version of theirs which just lacks optimization, back when I tried it the free version had a pretty small code size limit that was too quickly reached.


That might suit you.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...