Scope

I have a sketch in the following format

void function1

void function2

void loop

I want function 1 to call function2.

however I get function2 was not declared in this scope.

I have played with public statement,. playing being the word.
I just do not know the required syntax to use, online searches keep referring to classes and I am rather inexperienced atm.

Post the code (or a reduced version) so we can see the problem.
Have you missed a close bracket and both functions run into one another?

im away atm. ill try to grt the original code later.

but code works without the call.

main loop can call both functions, just one function calling the other causes the compile error.

#include <string.h>
#include <SPI.h>

int data = 9;
int strob = 8;
int clock = 10;
int oe = 11;
int count = 0;
int braille = 0;
int braillearray[]={25,2,3,18,26,10,19,27,11,17,0,0,0,0,0,0,0,4,6,36,52,20,38,34,22,34,50,5,7,37,53,21,39,55,23,35,51,13,15,58,45,61,29};
char braillemessage[25];
byte ascbraille =0;
int index=0;

void setup(void) {
  Serial.begin(9600);
  pinMode(data, OUTPUT);
  pinMode(clock, OUTPUT);
  pinMode(strob, OUTPUT);
  pinMode(oe, OUTPUT);

}


void showbraillemessage()  
{
  Serial.println(braillemessage);  
  int c=1;
  do
  {
  ascbraille = (byte)braillemessage[c]; // get asci value of character
  index = ascbraille - 47;              //index to array 
  braille = braillearray[index];        //gets number for shift register to display the correct character 
  showbraillchar(braille);              //shows the character
  c++; 
  }
  while ((braillemessage[c] != 0)&&(c<25));  // repeat until null found or length exceeds 24 char.
  
}

 void showbraillechar(int braille) // Takes an integer and shifts out binary value to led register
{
digitalWrite(strob, HIGH);
digitalWrite(oe, HIGH);
for (count = 0; count < 8; count++) {
digitalWrite(data, !!(braille & (1<<(7-count))));
digitalWrite(clock, LOW);
delayMicroseconds(20);
digitalWrite(clock, HIGH);
delayMicroseconds(50);
digitalWrite(clock, LOW);
 }
  delayMicroseconds(20);
  digitalWrite(oe, LOW);
  digitalWrite(strob, LOW);
}




void loop(void) {
//main prog
}

(deleted)

Doh.
Many thanks, been looking at that all weekend and totally missed it.

int braillearray[]={25,2,3,18,26,10,19,27,11,17,0,0,0,0,0,0,0,4,6,36,52,20,38,34,22,34,50,5,7,37,53,21,39,55,23,35,51,13,15,58,45,61,29};

You got the elusive two terabyte model? If not, explain why this array type is int.

  int c=1;
  do
  {
  ascbraille = (byte)braillemessage[c]; // get asci value of character

Arrays start at 0. Unless you have a REALLY good reason to not store the first character in position 0, which should be documented by comments here, this is WRONG.

There is also a clue there as to the proper type of the array.

  showbraillchar(braille);              //shows the character

You do NOT have a function of this name. If you followed convention, that would be more obvious. Why do you suppose that analogRead(), digitalWrite(), delayMicroseconds(), etc., have capital letters in their names?

Thank you Type byte, of course.

arrays start at 0,

I have a 3rd party library that returns arrays with a leading nul.
I had assumed it was my inexperience at fault.