need guidance and help with project

Hi to all, I am new to this of the arduino I have non expirience in programming but I am a radio operator, trying to make a fox hunt for ham project, is beacon that will transmit a code, a cw some minutes apart of each transmission, the sketch that I am using is from NT1K, got it working in amy arduino uno with no problemLINK TO NT1K

did some modifications to the sketch, add it a pin out so it can active a voice module, is a ISD1820 voice board module recorder, ok now for my problem, wen it star it will go high in bot pin’s the one for the cw code and for the voice module and they will be mix, i will like that the cw go first and at the end it will star the voice module, and the other is that having real hard to do the time between transmissions, the far that I have got is 9 minutes, and will like to be like space of 30 to 45 or 60 minutes of space, like I said I am not a programmer and been reading a lot from the learning section and from google but wit no help for my question’s, hope that some one can help I really will appreciated, this is the sketch that I modify.

int const CWLED = 13; // LED to show CW Connect to PIN 13
int const TXLED = 12; // LED to show TX is active to PIN 12
int const CW = 11; // Hook up Microphone to PIN 11
int const TX = 9; // Hook TX up to PIN 9
int const SW = 7; // Momentary Pushbutton to PIN 7
int const AUDIO = 10; // Activar audio Externo to PIN 10
int const AUDIOLED = 6; // Activar Led de audio

int TONEHZ = 600; // Tone of the CW Signal
int DITLENGTH = 65; // CW Speed, Change for faster/slower CW
int BEEPLENGTH = 200; // Length of soild tone in ms
int MSGSPACE = 6000; // Space Between Transmissions 6000=1 minuto

int val = 0;
int old_val = 0;
int state = 0;

char message = “XE2JEC”; //Message Beint Sent

// Following Makes the DAH tone

void dah() {
digitalWrite(CWLED, HIGH); // Turns LED on
tone(CW, TONEHZ); // Sending out tone at 600hz
delay(3 * DITLENGTH);
digitalWrite(CWLED, LOW); // Turns off LED
noTone(CW); // Turns off Tone
delay(DITLENGTH);
}

// Following Makes the DIT tone

void dit() {
digitalWrite(CWLED, HIGH);
tone(CW, TONEHZ);
delay(DITLENGTH);
digitalWrite(CWLED, LOW);
noTone(CW);
delay(DITLENGTH);
}

// Following is the Space Between Letters

void letterBreak() {
delay(2 * DITLENGTH);
}

// Following is the Space Between Words

void wordBreak() {
delay(4 * DITLENGTH);
}

// Following replaces each char with its morse code equiv

void send(char letter) {
switch (letter) {
case ‘A’:
case ‘a’: dit(); dah(); break;
case ‘B’:
case ‘b’: dah(); dit(); dit(); dit(); break;
case ‘C’:
case ‘c’: dah(); dit(); dah(); dit(); break;
case ‘D’:
case ‘d’: dah(); dit(); dit(); break;
case ‘E’:
case ‘e’: dit(); break;
case ‘F’:
case ‘f’: dit(); dit(); dah(); dit(); break;
case ‘G’:
case ‘g’: dah(); dah(); dit(); break;
case ‘H’:
case ‘h’: dit(); dit(); dit(); dit(); break;
case ‘I’:
case ‘i’: dit(); dit(); break;
case ‘J’:
case ‘j’: dit(); dah(); dah(); dah(); break;
case ‘K’:
case ‘k’: dah(); dit(); dah(); break;
case ‘L’:
case ‘l’: dit(); dah(); dit(); dit(); break;
case ‘M’:
case ‘m’: dah(); dah(); break;
case ‘N’:
case ‘n’: dah(); dit(); break;
case ‘O’:
case ‘o’: dah(); dah(); dah(); break;
case ‘P’:
case ‘p’: dit(); dah(); dah(); dit(); break;
case ‘Q’:
case ‘q’: dah(); dah(); dit(); dah(); break;
case ‘R’:
case ‘r’: dit(); dah(); dit(); break;
case ‘S’:
case ‘s’: dit(); dit(); dit(); break;
case ‘T’:
case ‘t’: dah(); break;
case ‘U’:
case ‘u’: dit(); dit(); dah(); break;
case ‘V’:
case ‘v’: dit(); dit(); dit(); dah(); break;
case ‘W’:
case ‘w’: dit(); dah(); dah(); break;
case ‘X’:
case ‘x’: dah(); dit(); dit(); dah(); break;
case ‘Y’:
case ‘y’: dah(); dit(); dah(); dah(); break;
case ‘Z’:
case ‘z’: dah(); dah(); dit(); dit(); break;
case ‘0’: dah(); dah(); dah(); dah(); dah(); break;
case ‘1’: dit(); dah(); dah(); dah(); dah(); break;
case ‘2’: dit(); dit(); dah(); dah(); dah(); break;
case ‘3’: dit(); dit(); dit(); dah(); dah(); break;
case ‘4’: dit(); dit(); dit(); dit(); dah(); break;
case ‘5’: dit(); dit(); dit(); dit(); dit(); break;
case ‘6’: dah(); dit(); dit(); dit(); dit(); break;
case ‘7’: dah(); dah(); dit(); dit(); dit(); break;
case ‘8’: dah(); dah(); dah(); dit(); dit(); break;
case ‘9’: dah(); dah(); dah(); dah(); dit(); break;
case ‘.’: dit(); dah(); dit(); dah(); dit(); dah(); break;
case ‘,’: dah(); dah(); dit(); dit(); dah(); dah(); break;
case ‘?’: dit(); dit(); dah(); dah(); dit(); dit(); break;
case ‘-’: dah(); dit(); dit(); dit(); dit(); dah(); break;
case ‘/’: dah(); dit(); dit(); dah(); dit(); break;
case ‘’’: dah(); dah(); dah(); dit(); dit(); dit(); break;
case ’ ': wordBreak(); break;
}
letterBreak();
}

// Following is the setup for the loop

void setup() {
pinMode (AUDIOLED, OUTPUT); //Defines audioled to see is on
pinMode (TX, OUTPUT); // Defines TX (PTT)as an Output
pinMode (TXLED, OUTPUT); // Defines that the TX (RED) LED is an Output
pinMode (CW, OUTPUT); // Defines CW (Audio) as an Output
pinMode (CWLED, OUTPUT); // Defines that the LED is an OUTPUT
pinMode (AUDIO, OUTPUT); // Defines AUDIO is a OUTPUT
pinMode (SW, INPUT); // Defines that the Switch is an INPUT

}

// Following is the acutal program using the above information

void loop() {

val = digitalRead(SW); // Looking for information from the switch

if ((val == HIGH) && (old_val == LOW)) {
state = 1 - state;
delay (100);
}

old_val = val;

// When the button is pushed, it will perform the following

if (state == 1) {

digitalWrite(TX, HIGH); // Turns on transmitter PTT
digitalWrite(TXLED, HIGH); // Turns on the TX LED
digitalWrite(AUDIO, HIGH); // activar audio
digitalWrite(AUDIOLED, HIGH); // activar led de audio
for (byte j = 0; j < sizeof(message); j++) {
send(message[j]);
} // Sends Message

delay(4 * DITLENGTH); // Wait
tone(CW, TONEHZ); // Sends out solid tone
delay(BEEPLENGTH); // Wait
noTone(CW); // Shuts off tone
digitalWrite(AUDIO, LOW); //Turns off Audio
digitalWrite(AUDIOLED, LOW); // Apagar audio led
digitalWrite(TX, LOW); // Turns off TX
digitalWrite(TXLED, LOW); // Turns off TX LED
delay(MSGSPACE); // Wait time until repeat

} else {
digitalWrite(AUDIOLED, LOW);
digitalWrite(AUDIO, LOW);
digitalWrite(CWLED, LOW);
digitalWrite(TX, LOW);
digitalWrite(TXLED, LOW);
}
}

Most of us could use some guldens.

int MSGSPACE = 6000; // Space Between Transmissions 6000=1 minuto

I think you should check your math.

jremington:
Most of us could use some guldens.

sorry did not see that gonna edit it

I am having difficulty in working out what you are doing.

You refer to CW and audio. Please define what audio you mean.

Do you want the XE2JEC to be transmitted as morse code using pulses of CW then be followed by a spoken message referred to as "audio"?

Weedpharma

vicreo:
sorry did not see that gonna edit it

well that is my problem that I did increasing bay adding a 0 and run the program in the arduino and it will only star and wait it for 1 hr and it will not repeat, don't now ware I am wrong.

weedpharma:
I am having difficulty in working out what you are doing.

You refer to CW and audio. Please define what audio you mean.

Do you want the XE2JEC to be transmitted as morse code using pulses of CW then be followed by a spoken message referred to as "audio"?

Weedpharma

yes that will transmitted XE2JEC in morse code and wen it end will star transmitted a pre record voice massage will be high thru pin 10 to active the voice module

The largest value you can store in an int is 32767, or just over 32 seconds, if you're using milliseconds.

You should put all your delays in unsigned long which will allow you to specify delays up to 72 days.

MorganS:
The largest value you can store in an int is 32767, or just over 32 seconds, if you're using milliseconds.

You should put all your delays in unsigned long which will allow you to specify delays up to 72 days.

sorry but I do not understand, if int is 32 seconds and I have to change it to unsigned long to specify 30, 45 or 60 minutes, ware do I have to change it, in the sketch, I did not make the sketch so I do not now how was the build was in milliseconds, sorry for the nob questions but I don now noting of programming

int MSGSPACE = 6000; // Space Between Transmissions 60000=1 minuto

This is called a declaration. It declares that there will be a variable called MSGSPACE which is int type. It also sets the initial value of the variable to 6000.

If you wanted to make this 60 minutes, then this code will work:

unsigned long MSGSPACE = 3600000; // Space Between Transmissions 60000=1 minuto

Of course, since the code uses delay(MSGSPACE); the Arduino can do nothing else during that delay period. It can't respond to any button pushes or any other inputs. That might be what you want but eventually you will want it to be more responsive and you will need to use the https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay technique.

vicreo:
I did not make the sketch so I do not now how was the build was in milliseconds, sorry for the nob questions but I don now noting of programming

So your first assignment should be to try to understand the code you've got. If modifying it feels over your head, then start working through some examples and tutorials until you get the basics of writing code and can understand how it works.

Copying and pasting and trying to blindly modify code you don't understand is a recipe for frustration for both you and us.

MorganS:

int MSGSPACE = 6000; // Space Between Transmissions 60000=1 minuto

This is called a declaration. It declares that there will be a variable called MSGSPACE which is int type. It also sets the initial value of the variable to 6000.

If you wanted to make this 60 minutes, then this code will work:

int MSGSPACE = 3600000; // Space Between Transmissions 60000=1 minuto

Of course, since the code uses delay(MSGSPACE); the Arduino can do nothing else during that delay period. It can’t respond to any button pushes or any other inputs. That might be what you want but eventually you will want it to be more responsive and you will need to use the https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay technique.

morgans, thank you for the help and the patience, gonna try today and I will report back.

Delta_G:
So your first assignment should be to try to understand the code you’ve got. If modifying it feels over your head, then start working through some examples and tutorials until you get the basics of writing code and can understand how it works.

Copying and pasting and trying to blindly modify code you don’t understand is a recipe for frustration for both you and us.

delta g thank for the advise, and yes I have been reading a lot so I can understand and now how the sketch is built and and the sequences of each command, got stuck in this issues that is way hay asking for help, did a lot of copy and building new sketch’s trying to figure out, been working in this proyec for 3 week now in my free time, thanks for the advise

Whoops! I forgot to change to unsigned long. (I've edited my previous post so that it is correct now.)

unsigned long MSGSPACE = 3600000; // Space Between Transmissions 60000=1 minuto