Remote control system

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Remote control system

Post by Monie Jacobsen »

HI all
Remote control system
Receiver type FS-R9B
FS-R9B.jpg
FS-R9B.jpg (25.59 KiB) Viewed 9852 times
Recivere.JPG
Recivere.JPG (12.96 KiB) Viewed 9851 times
Have tried all weekend to try to read the signal flowcode V7, but without success
Is there anyone here who will be assisting with reading signal into the flowcode V7.
Create a small program code for Flowcode V7

Info user:
Arduino Mega 2560 R3
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Remote control system

Post by Benj »

Hi Monie,

I might do something like this.

Wait for signal to go high. Start timer counting. Wait for signal to go low. Stop Timer Counting. Record timer count value to collect the length of pulse.

If you post what you have so far then we may be able to help point you in the right direction.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

Thank Benj

Can not read signal in Flow Code V7...

The Arduino Mega 2560 R3 works following code.
Look here!

Code: Select all

byte CH1 = 10; //Bytes raw data

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x20, 20, 4);

float Channel1; // CutterSpeed

void setup() {
  // put your setup code here, to run once:
  pinMode(CH1, INPUT);
  Serial.begin(9600);
  lcd.begin(20, 4);
  lcd.init();
  lcd.backlight(); // backlight on
}
void loop() {
  Channel1 = pulseIn(CH1, HIGH);
  Channel1 = map(Channel1, 1450, 1950, 0, 255); //Laver inputet om til 0 - 255 Bytes
  
  Serial.println(Channel1);
  lcd.setCursor(0, 0);
  lcd.print("Mower Cutter...!");// Projekt
  lcd.setCursor(0, 1);
  lcd.print("CutterSpeed: ");// Channel 1
  lcd.print(Channel1);
}
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Remote control system

Post by Benj »

Hello Monie,

I've not tested it but hopefully this should work and includes a Flowchart version of the Arduino Map function.
PulseTiming.fcfx
(14.07 KiB) Downloaded 370 times

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

Hi Benj
Thank you very much for your codes.
By simulation codes think work.
But in practice the codes not works!

User:
Mega 2560 R3
I2C

I have attached the codes to use the devices.
Look here!
PulseTiming-Mega2560-I2C.fcfx
(12.19 KiB) Downloaded 356 times
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Remote control system

Post by Benj »

Hi Monie,

By "not works" what are you getting on the hardware? always 0, always 255?

Maybe print out the number before and after the map to make sure it is not the map macro at fault.

Not getting anything at all? Then check the pulse is correctly going into pin RA0 otherwise you will get stuck in the while loops.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

HI Benj
In display getting on the hardware? always 0, always 255?
Gets no signal in practice value in display
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Remote control system

Post by Benj »

Hi Monie,

Really not sure what you mean by the last message. I take it the display shows nothing.
Not getting anything at all? Then check the pulse is correctly going into pin RA0 otherwise you will get stuck in the while loops.
Note Pin RA0 is not the same as Arduino Analog0 which is actually RF0 on the Arduino Mega 2560.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

HI Benj
RA0 OK - from oscilloscope can seen a signal when the remote control system is activated!
The display shows nothing.
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Remote control system

Post by Benj »

Hi Monie,

Have you tried a simple program to print something out to the display. Is the display's address property correct?

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

HI Benj
You must excuse me, that I did not answer you now!
I have been sick.
I will now drave your suggestion.
Coming back with the answer;-)
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

Hi Benj
Have test Remote control system.
With signal in the A0. I see not result in display.
User Mega 2560 and I2C display.
And use flow code v7
Has attach my version:
PulseTiming-Mega2560-I2C.fcfx
(12.19 KiB) Downloaded 322 times
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

Hi Benj
Very fine codes you have created.

The Arduino Mega 2560 works by reading from A0.
Attached se here!

Code: Select all

[code]byte CH2 = A0; //Bytes raw data
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x20, 20, 4);

float Channel2; // CutterSpeed

void setup() {
  // put your setup code here, to run once:
  pinMode(CH2, INPUT);
  Serial.begin(9600);
  lcd.begin(20, 4);
  lcd.init();
  lcd.backlight(); // backlight on
}
void loop() {
  Channel2 = pulseIn(CH2, HIGH);
  Channel2 = map(Channel2, 970, 1970, 0, 255); //Laver inputet om til 0 - 255 Bytes
  
  Serial.println(Channel2);
  lcd.setCursor(0, 0);
  lcd.print("CH2 Speed: ");// Projekt
  lcd.print(Channel2);
  
}
[/code]

And here's version of Flowcode V7 which does not work by reading from A0.
PulseTiming-Mega2560-I2C.fcfx
(14.91 KiB) Downloaded 238 times
Where does it go wrong?
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Remote control system

Post by Benj »

Hi Monie,

First of all is the display working at all? Can you display anything on it? e.g. a fixed string.

If the display is working then is there a point in the program where the code stops running and hangs? If so then where does this happen, use the display to test.

If the display is not working then do you have the I2C address correct? Maybe also worth doing a 1 second flash test to confirm the configuration settings are right etc.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Remote control system

Post by Monie Jacobsen »

HI Benj
I had failed the A0 and for Mega 2560 F0
Very sorry the failed was my...
Many thanks for you help;-)
Best Regard
Monie

Post Reply