Problems with R/C 6ch transmission

no...
here are :

7105
FT24C02A
TG48754
CA33g
a clock...

well if is imposible to use the APins(or so complicated) i could sacrify one RGBLed an cut the shield for use the Digiltal 7 to 13, is less beuty but yes i am in this point. ]:smiley:

What is the receiver make and model - I will have a scan around and see what alternatives might be inside - we are looking for a counter IC or a shift register IC.

Duane B

here is the model

if you want i can make a picture and sen you

Post the picture here, if we find the right chip, it will be useful for others to follow

Duane B

Ok, it looks like you might have a PPM output on the battery pin.

Write a quick test sketch using pulse in on one of your digital pins and connect the arduino pin to the receiver pin which is nearest the word 'bat'.

If you get a consistent stream of short pulse, you have PPM on that pin.

Duane B

ok here is the photo....

ill try the sketch

This post gets very off topic but seems to suggest that earlier versions of the receiver have PPM on the battery pin (pin nearest bat). Later versions do not.

Yours has ZLH which some people have suggested means it is a later board and does not have PPM, try it anyway, the post is not very clear.

Duane B

well.. two things...

first one The Apins works perfectly in the arduino Mega the mistake was that i have selected nano board.... (mmm juyuuu i am discovering how much stupid can i be, no limit for my....)

the second one i have try this sketch:

/*
Prueba de mando R\C
*/
int Ch1Pin =2;

//// variables donde mapeamos la lectura de 0 1024 a 0 256

unsigned long Ch1Var;

//////////////////////////////////////////////////

void setup() {
Serial.begin(9600);
pinMode(Ch1Pin,INPUT);

}

void loop() {
Ch1Var = pulseIn(Ch1Pin,HIGH,200000);
Serial.println("POSITIVO");
Serial.println('Ch1Var,DEC');
Ch1Var = pulseIn(Ch1Pin,LOW,200000);
Serial.println("negativo");
Serial.println('Ch1Var,DEC');
}

and what i have obtain in the serial monitor is read 17731 for high and 17731 for low every time like in the beginning of the post....

well and thing taht i had the dremel in one hand and i was screaming CUT the shield nobody know.... jeje i little idiot...

one more time Thanks for your help and time

So no need for plan B - which is a good thing because from your findings it looks like the other link is correct -

boards with ZLH printed on them do not have PPM, older boards found inside the same receiver do have PPM.

Duane B

Well in this days I will try to include RC to the puppet, I´ll tell you how get I on.
XD

Hi,
I have a question again,becouse in am trying to include R/C in a big sketch that I am working.
I have some menus,and only in two option I want to use R/C contol.
So I need to activate and deactivate the interrupt but only this that come from the pins change
becouse I don´t need that the arduino hear all the time to the rc transeiver.

is this possible and how?

Thanks!!!!!!

Hi,
Two ways to do this

  1. Have a mode variable and just ignore the RC Pulses when you don't need them

  2. Detach the interrupts using void PCintPort::detachInterrupt(uint8_t arduinoPin)

In and ideal world option 2 would be your best choice, but in Arduino this is not a good choice - it uses the delete function to free the pin memory, this function is not properly supported on Arduino so every time you attach an detach pins a small amount of memory is used up that you sketch cannot use again until it is reset - technically its know as a memory leak.

Option 1 is easy to do and just means that you sketch will be about 1% less efficient.

A third option is to disable individual interrupt flags - but lets not get into that because 1) is easy and has so little impact on your sketch that you will not notice.

so wrap the code in something like this -

if(gMode == RC_CONTROL)
{
  read channels
  
  update channels
}

this way the RC Code will only be processed when your sketch sets gMode to RC_CONTROL

Duane B

rcarduino.blogspot.com

So, if i have understand you well, for use mode variable, the gMode is a variable that I must declare before setup or is something that I can use becouse the library have it.
And when I use if stament I understand that I am allowing to read and copy, but when I am out the flags from rc control will change but the arduino don´t go becouse gMode != RC_CONTROL but Will I need to change gMode to oder value in the code,not? which value/state is this??

You have the idea mostly right.

You mentioned that you have a menu and in two menu options you want RC Control - you could represent each of your menu options as a mode - MODE_MANUAL, MODE_RC_NORMAL, MODE_RC_XXX etc

Then you can have a 'switch case' statement inside loop which does different things depending on the value of gMode -

switch(gMode)
{
 case MODE_MANUAL:
  // put your manual control code here
 break;
 case MODE_RC_NORMAL:
  // put your manual control code here
 break;
 case MODE_RC_XXX:
  // put your manual control code here
 break;
}

If you modes are very different, one way that I have done this in the past is to have the code I want for each mode in a separate function -

switch(gMode)
{
 case MODE_MANUAL:
  doModeManual();
  break;
 case MODE_RC_NORMAL:
  doModeRCNormal();
 break;
 case MODE_RC_XXX:
 doModeRCXXX();
 break;
 // etc etc etc
}

This might also help - http://www.arduino.cc/en/Reference/SwitchCase

Duane B

rcarduino.blogspot.com

Yes,i have use switch/case stament for built the menus, and the thing is gMode tath is a variable that i don´t need to define becouse is created by library which values can take( mode_manual,mode_rc,rc_control....)

do you know what I mean?? where can I see the values that i can espect from gMode or i need to define the variable gmode and decide whitch values will contain... and in this case witch kind of variables are this?

Hi,
gMode was just a suggestion, its not in the library ,if you already have a switch/case set up with your modes, add the RC Code to the modes you need it in and leave it out of the others, thats enough to achieve what you want.

Duane B

sorry I am not understanding well, what kind of variable will be gMode(int,boolean...)?
becouse I am understanding that will be one that I can define the spected values (RC_MODE,NO_RC_MODE)

Thanks!!!

Hi,
Can you PM me your sketch so that I can make a suggestion based your current structure ?

Duane B

Good morning,
the sketch have 49 pages of code,i was looking in github and google proyect for upload there but it was a little dificult for me( i supposo that it will be easy like a dropbox or something like this....)
if you sendme one email to alehop@mononokeproducciones.com I´ll send you the .pde code.
i am using in this code:

1 arduino Mega 2560
1 4x3 matrix keypad
1 lcd
1 sd21 servo controller
3 thumb joystick (6 potentiometers)
8 buttoms
1 udrive microSDcard (2gb uSD card)
1 RGB led

and now I am changuin to only 1 thumb joystick and 5 buttoms and 6 chanels r/c control.

the structure is:

one menu with 3 posibilities:

PLAY
REC
Config

and inside of this posibilities you have more posibilioties:

Play:

play from memory,
play from the joysticks
and now i want to add here another posibility from RC

Record:

record move (here I need to add the rc control too)
record a secuence of pre recorder movement
erase movement
erase secuence

config:
Format sd card
calibrate joystick

I explain all this becouse went I send you the code you will see that is uncoment, only have comment for me and in spanish...
When I finnish I want to document it in a blog but now... is a little unreadable... sorry

For this reason I only need that arduino hear the RC control in two moments.what i am thinkin is the gMode variable for me only have two posibilities so it is a boolean variable,but how can i create one tath have more posibilities(Manual,RC1,RC",RC)

thanks for your interest!!!!!