Pro mini sketch almost working

I am trying to construct a lost model RF transmit beacon using the instruction on this video:

I am using Linux Mint 20.3. Arduino IDE version 2.0.4
However, I am using a different board than what is recommended.
I am using an arduino pro mini that has a socket fitted that suits an android phone to USB.
Apologies: I am not sure that the correct name for this is.
This is the board I am working with: https://www.aliexpress.com/item/1005003098601899.html?spm=a2g0o.order_list.order_list_main.61.88ae1802E19mEh

When I connect the data pin of the 433Mhz to pin # 13 on the above pro mini, I do hear the output switching in the RF receiver, indicating that I at least have output and RF reception.
However, I hear no tone during the interval between the switching "clicks".
Clearly, I have something missing in either the code, or I am using the wrong pin to drive the RF tx from the pro mini.
Can someone point me in the right direction please?
Please note: I have no programming experience or understanding.

Jim.

//      ---------------------------------------------------
//     |            Vortecks Lost Model Beacon             |
//     |             www.youtube.com/vortecks              |
//     |   Recommended to use Arduino Pro Mini 8mhz 3.3v   |
//     |                                                   |
//     |  This is freely distributable, as long as I get   |
//     |  at least a mention :-)                           |
//      ---------------------------------------------------


int activationPause = 0;   // How many milliseconds to pause before activation - Default = 45 mins (2700 milliseconds)
int standbyFlash = 15;       // Frequency of internal LED flash in milliseconds
int breakBetweenLoop = 2000;  // How many milliseconds to wait until restarting tone

const byte rsOUT = 17;
int pause = 0;
void setup()
{
  pinMode(rsOUT, OUTPUT);
  pinMode(13, OUTPUT);

  int initialDelay = 0;
  while (initialDelay < (activationPause * 2))
  {
    digitalWrite(A3, HIGH);
    delay (standbyFlash / 2);
    digitalWrite(A3, LOW);
    delay (standbyFlash / 2);
    initialDelay++;
  }
}

void loop()
{
  digitalWrite(A3, HIGH);
  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delay(4);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;
  digitalWrite(A3, LOW);
  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  digitalWrite(A3, HIGH);
  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    pause++;
  }
  pause = 0;
  digitalWrite(13, LOW);

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 20)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    pause++;
  }
  pause = 0;

  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(3000);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(3200);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(3600);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delay(4);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(4000);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(4500);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(4750);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delay(4);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    pause++;
    //        digitalWrite(rsOUT, LOW);
  }
  pause = 0;

  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(2650);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 50)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    pause++;
    //        digitalWrite(rsOUT, LOW);
  }
  pause = 0;

  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delayMicroseconds(3200);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  while (pause < 70)
  {
    digitalWrite(rsOUT, HIGH);
    delay(3);
    digitalWrite(rsOUT, LOW);
    pause++;
  }
  pause = 0;

  digitalWrite(rsOUT, LOW);
  delay (breakBetweenLoop);
}

Not true. 45 minutes is 2,700,000 milliseconds. Accordingly, the variable is not an appropriate type for such a large value.

You are using pin A3 as an output without having previously set it as an output. As a whole, the program is a very good example of how NOT to program. I don't want to offend anyone, but whoever wrote the program doesn't have even minimal programming knowledge.

Deleted Post.

Ok, thanks for the reply.
I will have to look further for a better sketch.
Or, I will have to learn to compose one myself!

(Sorry, I don't know how to include a quote on this forum; they are all a bit different from each other).

Jim.

I have found another simple sketch. This one uses a arduino pro mini board.

Described here: Learn on the fly : A simple UHF beacon for fox hunt or lost rc model using arduino and 433MHZ rf module

1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// A simple uhf beacon using 433 mhz rf module
// credits to the author of the morse code generator
// more details on http://blog.riyas.org

struct t_mtab { char c, pat; } ;

struct t_mtab morsetab[] = {
 {'+', 42},   
 {'-', 97},
 {'=', 49},
 {'.', 106},
 {',', 115},
 {'?', 76},
 {'/', 41},
 {'A', 6},
 {'B', 17},
 {'C', 21},
 {'D', 9},
 {'E', 2},
 {'F', 20},
 {'G', 11},
 {'H', 16},
 {'I', 4},
 {'J', 30},
 {'K', 13},
 {'L', 18},
 {'M', 7},
 {'N', 5},
 {'O', 15},
 {'P', 22},
 {'Q', 27},
 {'R', 10},
 {'S', 8},
 {'T', 3},
 {'U', 12},
 {'V', 24},
 {'W', 14},
 {'X', 25},
 {'Y', 29},
 {'Z', 19},
 {'1', 62},
 {'2', 60},
 {'3', 56},
 {'4', 48},
 {'5', 32},
 {'6', 33},
 {'7', 35},
 {'8', 39},
 {'9', 47},
 {'0', 63}
} ;

#define N_MORSE  (sizeof(morsetab)/sizeof(morsetab[0]))
#define SPEED  (13) 
#define txpin    (13)
#define DOTLEN  (1200/SPEED)
#define DASHLEN  (3*(1200/SPEED))


void
dash()
{
  digitalWrite(txpin, HIGH);
  delay(DASHLEN);
  digitalWrite(txpin, LOW);
  delay(DOTLEN);
}

void
dit()
{
  digitalWrite(txpin, HIGH);
  delay(DOTLEN);
  digitalWrite(txpin, LOW);
  delay(DOTLEN);
}


void
send(char c)
{
  int i ;
  if (c == ' ') {
    delay(7*DOTLEN) ;
    return ;
  }
  for (i=0; i<N_MORSE; i++) {
    if (morsetab[i].c == c) {
      unsigned char p = morsetab[i].pat ;

      while (p != 1) {
          if (p & 1)
            dash() ;
          else
            dit() ;
          p = p / 2 ;
      }
      delay(2*DOTLEN) ;
 }
  Serial.print("?") ;
}
}


void
sendmsg(char *str)
{
  while (*str)
    send(*str++) ;
}


void setup() {                
  pinMode(txpin, OUTPUT);     
}

// the loop 
void loop() {
 sendmsg("VVV VVV VVV TESTING TESTING ") ; 
 delay(1500) ;  //delay can be increased to save battery
}

I have been able to get some RF output from it when uploaded and assembled on an arduino Uno board, but not on a pro mini.
Also, I am not sure I am hearing the correct, or complete, output on my 433 mhz receiver.
To explain, what I am hearing are morse code like clicks, but no tone.

Question:
Is this a better sketch to prevail with than the first one I posted above?
What output should I be hearing if it is working correctly?

Thanks for the replies so far.

Jim.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.