Grove OLED library not active due to Tetrix prizm library interference

Like this?

/* Motor Channel 1 is controlled by PS4 Left Joystick Y axis
 * Motor Channel 2 is controlled by PS4 Right Joystick Y axis
 * Servo 1 is controlled by the Triangle and Cross Buttons
 * Servo 2 is controlled by the Right Trigger Button and the Left Trigger Button
 * Servo 3 is controlled by the Square and Circle Buttons
 * Hardware: TETRIX PRIZM, TeleOp module and SONY PS4 gaming controller, Grove - OLED Display 0.96.
 * Date: 02/03/2023
 * Author: BenElyon Molgeri
 */


#include "Arduino_SensorKit.h"                                        // Arduino Sensorkit library
#include "TELEOP.h"                                                   // TETRIX TeleOp module Library
#include "PRIZM.h"                                                    // TETRIX PRIZM Library
//Library class instance creation
PRIZM prizm;                                                          // Create an instance within the PRIZM Library class named prizm
PS4 ps4;                                                              // Create an instance within the PS4 Library class named ps4
//Motor
int PowerM1;                                                          // Channel 1 Motor Power 
int PowerM2;                                                          // Channel 2 Motor Power
//Servo
int Servo1 = 90;                                                      // variables for each servo channel set initially to 90
int Servo2 = 90;
int Servo3 = 90;
//Sensor
int Temp = Environment.readTemperature();
int roomTemp = 20;
void setup() {
//Initialize OLED screen
  Oled.begin();
  Oled.setFlipMode(true); // Sets the rotation of the screen
//Initialize sensors
  Environment.begin();
//Start Serial Monitor
  Serial.begin(115200);
//Initialize controls
  prizm.PrizmBegin();                                                 // Intializes the PRIZM controller and waits here for press of green start button
//Deadzone
  ps4.setDeadZone (LEFT, 10);
  ps4.setDeadZone (RIGHT, 10);
}

void Main() {
  //Main Control
  if (ps4.Connected){                                                 // If PS4 controller has been succesfully connected, control motors
      ps4.setLED(BLUE);                                               // LED shows ps4 connection
//Temperature Indication
      if (Temp <= roomTemp){
        ps4.setLED(BLUE);
        }
      else if (Temp >= roomTemp + 2.5){
        ps4.setLED(GREEN);
        }
      else if (Temp >= roomTemp + 5){
        ps4.setLED(YELLOW);
        }
      else if (Temp >= roomTemp + 7.5){
        ps4.setLED(RED);
        }
  //Motor
      PowerM1 = ps4.Motor(LY);                                        // Power (speed) and direction of Motor 1 is set by position of Left Y-axis Joystick
      PowerM2 = ps4.Motor(RY);                                        // Power (speed) and direction of Motor 2 is set by position of Right Y-axis Joystick
      prizm.setMotorPowers(PowerM1, PowerM2);                         // set motor output power levels for PRIZM DC motor channels 1 and 2
            
      prizm.setServoPosition(1, 90);                                   // Leaves 360 degree servo on hold
      prizm.setServoPosition(2, 90);
      prizm.setServoPosition(3, 90);

  //Elevator Pinion 
      if (ps4.Button(CROSS)){
        Servo1 = ps4.Servo(CROSS);
        prizm.setServoPosition(1, 0);
        }
      else if (ps4.Button(TRIANGLE)){
        Servo1 = ps4.Servo(TRIANGLE);
        prizm.setServoPosition(1, 180);
        }
      else{
        prizm.setServoPosition(1, 90);
        }
  //Gripper
      if (ps4.Button(R1)){
        Servo2 = ps4.Servo(R1);
        prizm.setServoPosition(2, 0);
        }
      else if (ps4.Button(L1)){
        Servo2 = ps4.Servo(L1);
        prizm.setServoPosition(2, 180);
        }
      else{
        prizm.setServoPosition(2, 90);
        }
  //Support Pinion
    if (ps4.Button(DOWN)){
      Servo3 = ps4.Servo(DOWN);
      prizm.setServoPosition(3, 0);
      }
    else if (ps4.Button(UP)){
      Servo3 = ps4.Servo(UP);
      prizm.setServoPosition(3, 180);
      }
    else{
      prizm.setServoPosition(3, 90);
      }
  } 

// If PS4 is not connected, stop motors and servos
  else{ 
      prizm.setMotorPowers(0,0);
      
      prizm.setServoPosition(1,90);
      prizm.setServoPosition(2,90);
      prizm.setServoPosition(,90);
      
      Serial.print("Droid Name: ??? \n Status: Offline \n Rebooting ***");
      delay(5000);
      }
}
void Initialize() {
  //Initialize Controller   
  ps4.getPS4();                                                       // Get (read) PS4 connections status and all PS4 button and joystick data value
//Initialize Servo Speed
  prizm.setServoSpeed(1, 75);
  prizm.setServoSpeed(2, 75);
  prizm.setServoSpeed(3, 75);

}
void Diagnostics() {
  //Diagnostics
  Oled.setFont(u8x8_font_chroma48medium8_r);
  Oled.setCursor(0, 0);
  Oled.print("Droid Name:");
  Oled.print("Gimli");
  Oled.setCursor(0, 2);
  Oled.print("Status: Primed");
  Oled.setCursor(0, 3);
  Oled.print("Voltage mV: ");
  Oled.print(prizm.readBatteryVoltage());
  Serial.print("Motor 1 Current Draw:");
  Serial.print(prizm.readMotorCurrent(1));
  Serial.print("Motor 2 Current Draw:");
  Serial.print(prizm.readMotorCurrent(2));
  Oled.setCursor(0, 4);
  Oled.print("Servo Temp = ");
  Oled.print(Environment.readTemperature()); //print temperature
  Oled.println(" C");
  Oled.display();
}


void loop() {
  Initialize();
  Diagnostics();
  Main();
}


  

Looks good at a glance. Change the word "Main" to something else, maybe myMain()?. main is a reserved word.

What difference would this make if in the setup it has already been intialized.

Is "this" meaning calling a function main()? It's a reserved word, like calling a function BOOL();

I can't find your drawing of your project. Did I overlook it?

No making custom functions while in the setup the problems, ps4 and prizm, still exist?

Test each device individually, using its custom function. I would initialize ([instance.begin()] only what you are testing. You can initialize all of them as your get each function (device) working. I must leave now. Keep looking for things that work, and things that do not.

Thank you for your help, if I cannot make this work I will post a detailed summary of the issue.

When nothing is commented out: OLED displays nothing
When the function initialization and the prizm and ps4 (in the setup) are commented out OLED prints diagnostics once power is supplied but does not update after that
When Initialization function, and Control function and prizm and ps4 in setup are commented out OLED works fine.

@tadashi-hamada

please read this advice very carefully and then take this advice to your heart and follow it from now on:

Each time you write a posting take 5 minutes more time to save 55 minutes of time
The posting above is unprecise !

You don't have a function named "initialization" !
You have a function named "Initialize()"

very unprecise too ! "The prizm and the ps4"
what the prizm and the ps4

You may think that I am a very excessive pedant. No me personally I'm not. But programming is a very excessive pedant. Everything has to be correct down to each single letter to make it work.

You have no "Control function" you have a function named "Main".
But it is still unclear what exactly did you comment out

Answering this could be very easy seen if you would have posted your actual and complete sketch.

You can post even three ore more code-sections into a single posting. Code-Sections have a limited height and having the real code is a huge advantage and has unbeatable detail-information over any description of lines of code and it takes maybe 20 seconds to post a complete sketch with the "copy-for-forum-function" of the arduino-IDE

headline: Add one thing at a time - then test IMMIDIATELY

You have put together

  • OLED display
  • temperature sensor
  • ps4
  • servos

these are four things. Not a single one.
This means there are much more possabilities what could cause a malfunction than if you only put into your code one single thing and then test immidiately.

headline: put together code into senseful sub-units = functions

you have mutliple lines of code that do something with the motors
specifically these lines that handle the motors should be put together into their own function

headline: give each function and each variable a SELF-explaining name

all names that you use in your code should be SPOT-ON self-explaining what these lines of code do. This requires taking some time to think over it what would be a spot-on selfexplaining name. Take once time to find a good self-explaining name to save time each time you read your code because then the name does explain itself.

After analysing your code:
You use a OLED-display to show information.
You use a ps4-controller to

  • control motors
  • control servos

compare your original setup-function

void setup() {
  //Initialize OLED screen
  Oled.begin();
  Oled.setFlipMode(true); // Sets the rotation of the screen
  //Initialize sensors
  Environment.begin();
  //Start Serial Monitor
  Serial.begin(115200);
  //Initialize controls
  prizm.PrizmBegin();                                                 // Intializes the PRIZM controller and waits here for press of green start button
  //Deadzone
  ps4.setDeadZone (LEFT, 10);
  ps4.setDeadZone (RIGHT, 10);
}

with this setup-function

void setup() {
  Serial.begin(115200); // ABSOLUTE first thing to code serial monitor
  Serial.println("setup-Start");

  initOled();    // no comments needed because has a SELF-explaining name 
  initSensors(); // no comments needed because has a SELF-explaining name 
  initps4();     // no comments needed because has a SELF-explaining name 
}

and the init-functions

void initOled() {
  Oled.begin();
  Oled.setFlipMode(true); // Sets the rotation of the screen 
  Oled.setFont(u8x8_font_chroma48medium8_r); 
}

void initSensors() {
  Environment.begin();  
}

void initps4() {
  prizm.PrizmBegin();                                                 // Intializes the PRIZM controller and waits here for press of green start button
  //Deadzone
  ps4.setDeadZone (LEFT, 10);
  ps4.setDeadZone (RIGHT, 10);  
}

void initServos() {
  prizm.setServoSpeed(1, 75);
  prizm.setServoSpeed(2, 75);
  prizm.setServoSpeed(3, 75);
}

needs a little bit more time to write the functions but after that it is very comfortable to work with
very easy to follow structure of the code with self-explaining names
commenting out reduces to a single line of code which is very easy to find

void setup() {
  Serial.begin(115200); // ABSOLUTE first thing to code serial monitor
  Serial.println("setup-Start");

  initOled();
  //initSensors();
  //initps4();
  //initServos();
}

First test is to add test-text direct below initOled();

void setup() {
  Serial.begin(115200); // ABSOLUTE first thing to code serial monitor
  Serial.println("setup-Start");

  initOled();
  Serial.println("initOled() done");
  Oled.setCursor(0, 0);
  Oled.print("Test direct below initOled");
  Oled.display();

  Serial.println("Does OLED show Test direct below initOled???");
  
  //initSensors();
  //initps4();
}

next step is to add initps4(); (= uncommenting initps4(); )
and test again does displaying text on the OLED work?

void setup() {
  Serial.begin(115200); // ABSOLUTE first thing to code serial monitor
  Serial.println("setup-Start");

  initOled();
  Serial.println("initOled() done");
  Oled.setCursor(0, 0);
  Oled.print("Test direct below initOled");
  Oled.display();
  
  Serial.println("Does OLED show Test direct below initOled???");
  
  initps4();
  Serial.println("initps4() done");

  Oled.setCursor(0, 2);
  Oled.print("Test after initps4()");
  Oled.display();
  Serial.println("Does OLED show Test after initps4()???");

  //initSensors();
  //initServos();
}

in parallel the code always prints to the serial monitor how far the code-execution is done

remember how many times you tried this, you tried that, tried this, you tried that, tried this, you tried that, tried this, you tried that, and how much time this more or less randomly trying this, trying that consumed without proceeding.

If you remember this wasting time
I hope you can see that such a very well structured way to write the code with functions and a very well structured way of adding a few lines of code and then test again immitiately saves time in the long run.

Next step is to add a few lines of code that read in data from your ps4-controller and then
directly print this data to the OLED and in parallel to the serial monitor
no motordriving yet! direct printing of the read-in data

here is your code re-organised in functions with self-explaining names
All parts that build a senseful sub-unit are put into their own function with a self-explaining name.

So your function "myMain" looks like this

void myMain() {
  // Get (read) PS4 connections status 
  // and all PS4 button and joystick data value
  // this function-call must be done very often
  // otherwise you can't control 
  ps4.getPS4(); 

  if (ps4.Connected) {   // If PS4 controller has been succesfully connected, control motors
    updateTemperatureLEDs(); // no comment needed has SELF-explaining name
    setMotorPower(); // no comment needed has SELF-explaining name

    stopServos(); // no comment needed has SELF-explaining name

    manageElevatorPinion(); // no comment needed has SELF-explaining name

    manageGripper(); // no comment needed has SELF-explaining name

    manageSupportPinion(); // no comment needed has SELF-explaining name 
  }

  else { // If PS4 is not connected, stop motors and servos
    prizm.setMotorPowers(0, 0);
    stopServos();

    Serial.println("ps4.Connected = false PS4 NOT connected");
    Serial.println("Motors and servos stopped");
    delay(2000);
  }
}

loop does nothing yet because we are in the stage of testing does the OLED show data after
initps4()?

here is the complete code not tested if it does compile because I don't have your libraries
There might be some minor typos in the code the compiler might complain about

/* Motor Channel 1 is controlled by PS4 Left Joystick Y axis
   Motor Channel 2 is controlled by PS4 Right Joystick Y axis
   Servo 1 is controlled by the Triangle and Cross Buttons
   Servo 2 is controlled by the Right Trigger Button and the Left Trigger Button
   Servo 3 is controlled by the Square and Circle Buttons
   Hardware: TETRIX PRIZM, TeleOp module and SONY PS4 gaming controller, Grove - OLED Display 0.96.
   Date: 02/03/2023
   Author: BenElyon Molgeri
*/

#include "Arduino_SensorKit.h"                                        // Arduino Sensorkit library
#include "TELEOP.h"                                                   // TETRIX TeleOp module Library
#include "PRIZM.h"                                                    // TETRIX PRIZM Library
//Library class instance creation
PRIZM prizm;                                                          // Create an instance within the PRIZM Library class named prizm
PS4 ps4;                                                              // Create an instance within the PS4 Library class named ps4
//Motor
int PowerM1;                                                          // Channel 1 Motor Power
int PowerM2;                                                          // Channel 2 Motor Power
//Servo
int Servo1 = 90;                                                      // variables for each servo channel set initially to 90
int Servo2 = 90;
int Servo3 = 90;
//Sensor
int Temp = Environment.readTemperature();
int roomTemp = 20;

void initOled() {
  Oled.begin();
  Oled.setFlipMode(true); // Sets the rotation of the screen
  Oled.setFont(u8x8_font_chroma48medium8_r);
}


void initSensors() {
  Environment.begin();
}


void initps4() {
  prizm.PrizmBegin();                                                 // Intializes the PRIZM controller and waits here for press of green start button

  ps4.setDeadZone (LEFT, 10);
  ps4.setDeadZone (RIGHT, 10);
  ps4.getPS4();                                                       // Get (read) PS4 connections status and all PS4 button and joystick data value
}


void initServos() {
  prizm.setServoSpeed(1, 75);
  prizm.setServoSpeed(2, 75);
  prizm.setServoSpeed(3, 75);
}


void setup() {
  // ABSOLUTE first thing to code 
  // init serial monitor
  Serial.begin(115200); 
  Serial.println("setup-Start");

  initOled();
  Serial.println("initOled() done");
  Oled.setCursor(0, 0);
  Oled.print("Test direct below initOled");
  Oled.display();

  Serial.println("Does OLED show Test direct below initOled???");

  initps4();
  Serial.println("initps4() done");

  Oled.setCursor(0, 2);
  Oled.print("Test after initps4()");
  Oled.display();
  Serial.println("Does OLED show Test Test after initps4()???");
  
  //initServos();
  
  //initSensors();
}


void myMain() {
  // Get (read) PS4 connections status 
  // and all PS4 button and joystick data value
  // this function-call must be done very often
  // otherwise you can't control 
  ps4.getPS4(); 

  if (ps4.Connected) {                                                // If PS4 controller has been succesfully connected, control motors
    updateTemperatureLEDs();
    setMotorPower();

    stopServos();

    manageElevatorPinion();

    manageGripper();

    manageSupportPinion();
  }

  else { // If PS4 is not connected, stop motors and servos
    prizm.setMotorPowers(0, 0);
    stopServos();

    Serial.println("ps4.Connected = false PS4 NOT connected");
    Serial.println("Motors and servos stopped");
    delay(2000);
  }
}


void Diagnostics() {
  Oled.setCursor(0, 0);
  Oled.print("Droid Name:");
  Oled.print("Gimli");
  Oled.setCursor(0, 2);
  Oled.print("Status: Primed");
  Oled.setCursor(0, 3);
  Oled.print("Voltage mV: ");
  Oled.print(prizm.readBatteryVoltage());
  Serial.print("Motor 1 Current Draw:");
  Serial.print(prizm.readMotorCurrent(1));
  Serial.print("Motor 2 Current Draw:");
  Serial.print(prizm.readMotorCurrent(2));
  Oled.setCursor(0, 4);
  Oled.print("Servo Temp = ");
  Oled.print(Environment.readTemperature()); //print temperature
  Oled.println(" C");
  Oled.display();
}


void loop() {
  // Diagnostics();
  // myMain();
}


void updateTemperatureLEDs() {
  Temp = Environment.readTemperature();

  if (Temp <= roomTemp) {
    ps4.setLED(BLUE);
  }
  else if (Temp >= roomTemp + 2.5) {
    ps4.setLED(GREEN);
  }
  else if (Temp >= roomTemp + 5) {
    ps4.setLED(YELLOW);
  }
  else if (Temp >= roomTemp + 7.5) {
    ps4.setLED(RED);
  }
}


void setMotorPower() {
  PowerM1 = ps4.Motor(LY);                                        // Power (speed) and direction of Motor 1 is set by position of Left Y-axis Joystick
  PowerM2 = ps4.Motor(RY);                                        // Power (speed) and direction of Motor 2 is set by position of Right Y-axis Joystick
  prizm.setMotorPowers(PowerM1, PowerM2);                         // set motor output power levels for PRIZM DC motor channels 1 and 2
}


void stopServos() {
  prizm.setServoPosition(1, 90);                                   // Leaves 360 degree servo on hold
  prizm.setServoPosition(2, 90);
  prizm.setServoPosition(3, 90);
}


void manageElevatorPinion() {
  if (ps4.Button(CROSS)) {
    Servo1 = ps4.Servo(CROSS);
    prizm.setServoPosition(1, 0);
  }
  else if (ps4.Button(TRIANGLE)) {
    Servo1 = ps4.Servo(TRIANGLE);
    prizm.setServoPosition(1, 180);
  }
  else {
    prizm.setServoPosition(1, 90);
  }
}


void manageGripper() {
  if (ps4.Button(R1)) {
    Servo2 = ps4.Servo(R1);
    prizm.setServoPosition(2, 0);
  }
  else if (ps4.Button(L1)) {
    Servo2 = ps4.Servo(L1);
    prizm.setServoPosition(2, 180);
  }
  else {
    prizm.setServoPosition(2, 90);
  }
}

void manageSupportPinion() {
  if (ps4.Button(DOWN)) {
    Servo3 = ps4.Servo(DOWN);
    prizm.setServoPosition(3, 0);
  }
  else if (ps4.Button(UP)) {
    Servo3 = ps4.Servo(UP);
    prizm.setServoPosition(3, 180);
  }
  else {
    prizm.setServoPosition(3, 90);
  }
}

best regards Stefan

headline using constants with self-explaining names

example
your code in this early stage of development has already five lines of code that deeal with the elevator-servo

  prizm.setServoSpeed(1, 75);
  prizm.setServoPosition(1, 90);                                   // Leaves 360 degree servo on hold
    prizm.setServoPosition(1, 0);
    prizm.setServoPosition(1, 180);
    prizm.setServoPosition(1, 90);

If you ever want to change the servo-port the elevator-pistion servo is connected to
you have 5 places to lookup in your code to change the number "1"

If you define a self-explaining name for this as a constant

const byte Elev = 1;

and all the other code-lines dealing with this servo use this name "Elev"

  prizm.setServoSpeed(Elev, 75);
  prizm.setServoPosition(Elev, 90);                                   // Leaves 360 degree servo on hold
    prizm.setServoPosition(Elev, 0);
    prizm.setServoPosition(Elev, 180);
    prizm.setServoPosition(Elev, 90);

you simple change one single line of code

const byte Elev = 4;

and you are done and you can be sure to have not forgotten a line of code
with the "1" because all lines dealing with the elevator-piston-servo use the name
"Elev"

So here is a code-version that uses self-explaining names for almost everything making the code easier to understand and easier to maintain. Same principle as before invest a limited time
at the beginning to save a lot of time in the future if you develop your code further

Another thing for this is the neutral position to stop the servos
It might be that a servo does not stop at value 90
it might be that it stops at 91 or 89
with using a constant for this there is one central place to change the value and you are done
neutral position = servo does not move is always the same it is neutral position = servo does not move

for one servo which means it makes sense to have such a constant for each servo
with a self-explaining name

const byte ElevServoNeutralPos = 90;
const byte GripServoNeutralPos = 90; 
const byte SuppServoNeutralPos = 90;

there are a few things left that should be modified in this way

void manageElevatorPinion() {
  if (ps4.Button(CROSS)) {
    ElevServoPos = ps4.Servo(CROSS);
    prizm.setServoPosition(Elev, 0); // what does Elev,0 mean? elevator-pinion up? down? left? / right???
    //prizm.setServoPosition(Elev, ??); // what does Elev,0 mean? elevator-pinion up? down? left? / right???
  }
  else if (ps4.Button(TRIANGLE)) {
    ElevServoPos = ps4.Servo(TRIANGLE);
    prizm.setServoPosition(Elev, 180); // what does Elev,180 mean? elevator-pinion up? down? left? / right???
    //prizm.setServoPosition(Elev, ??); // what does Elev,180 mean? elevator-pinion up? down? left? / right???
  }
  else {
    prizm.setServoPosition(Elev, ElevServoNeutralPos);
  }
}


void manageGripper() {
  if (ps4.Button(R1)) {
    GripServoPos = ps4.Servo(R1);
    prizm.setServoPosition(Grip, 0); // what does Grip,0 mean? Gripper opend or closed?
    //prizm.setServoPosition(Grip, GripperOpenedPos);
    // or
    //prizm.setServoPosition(Grip, GripperClosedPos);
    
  }
  else if (ps4.Button(L1)) {
    GripServoPos = ps4.Servo(L1);
    prizm.setServoPosition(Grip, 180); // what does Grip,180 mean? Gripper opend or closed?
    //prizm.setServoPosition(Grip, GripperClosedPos);
    //or
    //prizm.setServoPosition(Grip, GripperOpenedPos);
  }
  else {
    prizm.setServoPosition(Grip, GripServoNeutralPos);
  }
}

This code does compile

/* Motor Channel 1 is controlled by PS4 Left Joystick Y axis
   Motor Channel 2 is controlled by PS4 Right Joystick Y axis
   Servo 1 is controlled by the Triangle and Cross Buttons
   Servo 2 is controlled by the Right Trigger Button and the Left Trigger Button
   Servo 3 is controlled by the Square and Circle Buttons
   Hardware: TETRIX PRIZM, TeleOp module and SONY PS4 gaming controller, Grove - OLED Display 0.96.
   Date: 02/03/2023
   Author: BenElyon Molgeri
*/

#include <Arduino_SensorKit.h> // Arduino Sensorkit library
#include <TELEOP.h>            // TETRIX TeleOp module Library
#include <PRIZM.h>             // TETRIX PRIZM Library
//Library class instance creation
PRIZM prizm;                   // Create an instance within the PRIZM Library class named prizm
PS4 ps4;                       // Create an instance within the PS4 Library class named ps4
//Motor
int PowerM1;                   // Channel 1 Motor Power
int PowerM2;                   // Channel 2 Motor Power

//Servo
const byte Elev = 1;
const byte Grip = 2;
const byte Supp = 3;

const byte ElevServoNeutralPos = 90;
const byte GripServoNeutralPos = 90;
const byte SuppServoNeutralPos = 90;

const byte SuppDownPos =   0;
const byte SuppUpPos   = 180;

const byte GripperOpenedPos =   0;
const byte GripperClosedPos = 180;

// const byte SuppServoWhatIsIT ?? =   0;
// const byte SuppServoWhatIsIT ?? = 180;


int ElevServoPos = 90;
int GripServoPos = 90;
int SuppServoPos = 90;

int measuredTemp = Environment.readTemperature();
int normalTemp = 20;

void initOled() {
  Oled.begin();
  Oled.setFlipMode(true); // Sets the rotation of the screen
  Oled.setFont(u8x8_font_chroma48medium8_r);
}


void initSensors() {
  Environment.begin();
}


void initps4() {
  prizm.PrizmBegin(); // Intializes the PRIZM controller and waits here for press of green start button

  ps4.setDeadZone (LEFT, 10);
  ps4.setDeadZone (RIGHT, 10);
  ps4.getPS4(); // Get (read) PS4 connections status and all PS4 button and joystick data value
}


void initServos() {
  prizm.setServoSpeed(Elev, 75);
  prizm.setServoSpeed(Grip, 75);
  prizm.setServoSpeed(Supp, 75);
}


void setup() {
  // ABSOLUTE first thing to code
  // init serial monitor
  Serial.begin(115200);
  Serial.println("setup-Start");

  initOled();
  Serial.println("initOled() done");
  Oled.setCursor(0, 0);
  Oled.print("Test direct below initOled");
  Oled.display();

  Serial.println("Does OLED show Test direct below initOled???");

  initps4();
  Serial.println("initps4() done");

  Oled.setCursor(0, 2);
  Oled.print("Test after initps4()");
  Oled.display();
  Serial.println("Does OLED show Test Test after initps4()???");

  //initServos();

  //initSensors();
}


void myMain() {
  // Get (read) PS4 connections status
  // and all PS4 button and joystick data value
  // this function-call must be done very often
  // otherwise you can't control
  ps4.getPS4();

  if (ps4.Connected) {                                                // If PS4 controller has been succesfully connected, control motors
    updateTemperatureLEDs();
    set_MotorPower();

    stopServos();

    manageElevatorPinion();

    manageGripper();

    manageSupportPinion();
  }

  else { // If PS4 is not connected, stop motors and servos
    prizm.setMotorPowers(0, 0);
    stopServos();

    Serial.println("ps4.Connected = false PS4 NOT connected");
    Serial.println("Motors and servos stopped");
    delay(2000);
  }
}


void Diagnostics() {
  Oled.setCursor(0, 0);
  Oled.print("Droid Name:");
  Oled.print("Gimli");
  Oled.setCursor(0, 2);
  Oled.print("Status: Primed");
  Oled.setCursor(0, 3);
  Oled.print("Voltage mV: ");
  Oled.print(prizm.readBatteryVoltage());
  Serial.print("Motor 1 Current Draw:");
  Serial.print(prizm.readMotorCurrent(1));
  Serial.print("Motor 2 Current Draw:");
  Serial.print(prizm.readMotorCurrent(2));
  Oled.setCursor(0, 4);
  Oled.print("Servo Temp = ");
  Oled.print(Environment.readTemperature()); //print temperature
  Oled.println(" C");
  Oled.display();
}


void loop() {
  // Diagnostics();
  // myMain();
}


void updateTemperatureLEDs() {
  measuredTemp = Environment.readTemperature();

  if (measuredTemp <= normalTemp) {
    ps4.setLED(BLUE);
  }
  else if (measuredTemp >= normalTemp + 2.5) {
    ps4.setLED(GREEN);
  }
  else if (measuredTemp >= normalTemp + 5) {
    ps4.setLED(YELLOW);
  }
  else if (measuredTemp >= normalTemp + 7.5) {
    ps4.setLED(RED);
  }
}


void set_MotorPower() {
  PowerM1 = ps4.Motor(LY);                                        // Power (speed) and direction of Motor 1 is set by position of Left Y-axis Joystick
  PowerM2 = ps4.Motor(RY);                                        // Power (speed) and direction of Motor 2 is set by position of Right Y-axis Joystick
  prizm.setMotorPowers(PowerM1, PowerM2);                         // set motor output power levels for PRIZM DC motor channels 1 and 2
}


void stopServos() {
  prizm.setServoPosition(Elev, ElevServoNeutralPos);                                   // Leaves 360 degree servo on hold
  prizm.setServoPosition(Grip, GripServoNeutralPos);
  prizm.setServoPosition(Supp, SuppServoNeutralPos);
}


void manageElevatorPinion() {
  if (ps4.Button(CROSS)) {
    ElevServoPos = ps4.Servo(CROSS);
    prizm.setServoPosition(Elev, 0); // what does Elev,0 mean? elevator-pinion up? down? left? / right???
    //prizm.setServoPosition(Elev, ??); // what does Elev,0 mean? elevator-pinion up? down? left? / right???
  }
  else if (ps4.Button(TRIANGLE)) {
    ElevServoPos = ps4.Servo(TRIANGLE);
    prizm.setServoPosition(Elev, 180); // what does Elev,180 mean? elevator-pinion up? down? left? / right???
    //prizm.setServoPosition(Elev, ??); // what does Elev,180 mean? elevator-pinion up? down? left? / right???
  }
  else {
    prizm.setServoPosition(Elev, ElevServoNeutralPos);
  }
}


void manageGripper() {
  if (ps4.Button(R1)) {
    GripServoPos = ps4.Servo(R1);
    prizm.setServoPosition(Grip, 0); // what does Grip,0 mean? Gripper opend or closed?
    //prizm.setServoPosition(Grip, GripperOpenedPos);
    // or
    //prizm.setServoPosition(Grip, GripperClosedPos);
    
  }
  else if (ps4.Button(L1)) {
    GripServoPos = ps4.Servo(L1);
    prizm.setServoPosition(Grip, 180); // what does Grip,180 mean? Gripper opend or closed?
    //prizm.setServoPosition(Grip, GripperClosedPos);
    //or
    //prizm.setServoPosition(Grip, GripperOpenedPos);
  }
  else {
    prizm.setServoPosition(Grip, GripServoNeutralPos);
  }
}

void manageSupportPinion() {
  if (ps4.Button(DOWN)) {
    SuppServoPos = ps4.Servo(DOWN);
    prizm.setServoPosition(Supp, SuppDownPos);
  }
  else if (ps4.Button(UP)) {
    SuppServoPos = ps4.Servo(UP);
    prizm.setServoPosition(Supp, SuppUpPos);
  }
  else {
    prizm.setServoPosition(Supp, SuppServoNeutralPos);
  }
}

best regards Stefan

HI there @StefanL38 I immensely appreciate your feedback, I know that if someone responded to me the way I did I would not answer any of their questions, I will practice these henceforth.

Updated Code:

#include "PRIZM.h"
#include "TELEOP.h"
#include "Arduino_SensorKit.h"

PRIZM prizm;                                                          // Create an instance within the PRIZM Library class named prizm
PS4 ps4;                                                              // Create an instance within the PS4 Library class named ps4



int PowerM1;                                                          // Channel 1 Motor Power
int PowerM2;                                                          // Channel 2 Motor Power

const byte ServoSpeed = 75;

int Servo1 = 90;                                                      // variables for each servo channel set initially to 90
int Servo2 = 90;
int Servo3 = 90;

const byte Elev = 1;                             //Assigns Servos to variable stating its function
const byte Grip = 2;
const byte Supt = 3;

const byte ElevServoNeutralPos = 90;
const byte GripServoNeutralPos = 90;
const byte SuptServoNeutralPos = 90;

const byte ElevUpPos = 180;
const byte ElevDownPos = 0;

const byte GripOpenPos = 0;
const byte GripClosePos = 180;

const byte SuptUpPos = 180;
const byte SuptDownPos = 0;


int servoTemp = Environment.readTemperature();
int normalTemp = 20;

void setup() {
  initSerial();
  
  initOled();
  Serial.println("initOled() done");
  Oled.setCursor(0, 0);
  Oled.print("Test direct below initOled");
  Oled.display();
  
  Serial.println("Does OLED show Test direct below initOLED???");
  
  /*initps4();
  Serial.println("initps4() done");
  
  Oled.setCursor(0, 2);
  Oled.print("Test after initps4()");
  Oled.display():
  Serial.println("Does OLED show Test after initps4()???")
  */
  //initSensors();
  //initServos();
}
void loop() {
  Control();
  OledDiagnostics();
}

void Control() {
  ps4.getPS4(); //Get(read) PS4 connections status and all PS4 button and joystick data value this function-call must be done very often otherwise you can't control

  if (ps4.Connected) {                                                // If PS4 controller has been succesfully connected, control motors
    updateTemperatureLEDs();
    
    set_MotorPower();

    stopServos();

    manageElevatorPinion();

    manageGripper();

    manageSupportPinion();
  }

  else { // If PS4 is not connected, stop motors and servos
    prizm.setMotorPowers(0, 0);
    stopServos();

    Serial.println("ps4.Connected = false PS4 NOT connected");
    Serial.println("Motors and servos stopped");
    delay(2000);
  }
}

void OledDiagnostics() {
  Oled.setCursor(0, 0);
  Oled.print("Droid Name:");
  Oled.print("Gimli");
  Oled.setCursor(0, 2);
  Oled.print("Status: Primed");
  Oled.setCursor(0, 3);
  Oled.print("Voltage mV: ");
  Oled.print(prizm.readBatteryVoltage());
  Oled.setCursor(0, 4);
  Oled.print("Servo Temp = ");
  Oled.print(Environment.readTemperature()); //print temperature
  Oled.println(" C");
  Oled.display();
}

void SerialDiagnostics() {
  Serial.print("Motor 1 Current Draw:");
  Serial.print(prizm.readMotorCurrent(1));
  Serial.print("Motor 2 Current Draw:");
  Serial.print(prizm.readMotorCurrent(2));
}

void initOled() {
  Oled.begin();                                 //Begins OLED screen
  Oled.setFlipMode(true);                       //Flips orientation of OLED screen
  Oled.setFont(u8x8_font_chroma48medium8_r);    //Sets the font of the OLED
}

void initSensors() {
  Environment.begin();                          //Initializes the Grove sensor environment               
}

void initps4() {
  prizm.PrizmBegin();                           //Initializes Prizm microcontroller
  
  ps4.setDeadZone (LEFT, 10);                   //Sets the deadzones on the ps4 joysticks
  ps4.setDeadZone (RIGHT, 10);
  ps4.getPS4(); // Get (read) PS4 connections status and all PS4 button and joysticks
}

void initServos() {
  prizm.setServoSpeed(Elev, ServoSpeed);
  prizm.setServoSpeed(Grip, ServoSpeed);
  prizm.setServoSpeed(Supt, ServoSpeed);
}

void initSerial() {
  Serial.begin(115200);
  Serial.println("Setup-Start");
}

void updateTemperatureLEDs() {
  servoTemp = Environment.readTemperature();
  
  if (servoTemp <= normalTemp) {
    ps4.setLED(BLUE);
  }
  else if (servoTemp >= normalTemp + 2.5) {
    ps4.setLED(GREEN);
  }
  else if (servoTemp >= normalTemp + 5) {
    ps4.setLED(YELLOW);
  }
  else if (servoTemp >= normalTemp + 7.5) {
    ps4.setLED(RED);
  }
}

void set_MotorPower() {
  PowerM1 = ps4.Motor(LY);
  PowerM2 = ps4.Motor(RY);
  prizm.setMotorPowers(PowerM1, PowerM2);
}

void stopServos() {
  prizm.setServoPosition(Elev, ElevServoNeutralPos);
  prizm.setServoPosition(Grip, GripServoNeutralPos);
  prizm.setServoPosition(Supt, SuptServoNeutralPos);
}

void manageElevatorPinion() {
  if (ps4.Button(TRIANGLE)) {
    Servo1 = ps4.Servo(TRIANGLE);
    prizm.setServoPosition(Elev, ElevUpPos);
  }
  else if (ps4.Button(CROSS)) {
    Servo1 = ps4.Servo(CROSS);
    prizm.setServoPosition(Elev, ElevDownPos);
  }
  else {
    prizm.setServoPosition(Elev, ElevServoNeutralPos);
  }
}

void manageGripper() {
  if (ps4.Button(R1)) {
    Servo2 = ps4.Servo(R1);
    prizm.setServoPosition(Grip, GripOpenPos);
  }
  else if (ps4.Button(L1)) {
    Servo2 = ps4.Servo(L1);
    prizm.setServoPosition(Grip, GripClosePos);
  }
  else {
    prizm.setServoPosition(Grip, GripServoNeutralPos);
  }
}

void manageSupportPinion() {
  if (ps4.Button(DOWN)) {
    Servo3 = ps4.Servo(UP);
    prizm.setServoPosition(Supt, SuptUpPos);
  }
  else if (ps4.Button(UP)) {
    Servo3 = ps4.Servo(DOWN);
    prizm.setServoPosition(Supt, SuptDownPos);
  }
  else {
    prizm.setServoPosition(Supt, SuptServoNeutralPos);
  }
}

Results:
With initps4(); commented out, the display yields "Test direct below initOled" as it should, however once initps4(); is included the display does not yield any update and only shows the previous statement.

What does the serial monitor print?
You have to watch the serial monitor too.

One problem can be that the code is hanging completely and this becomes obvious if no more messages are seen in the serial monitor

The serial monitor shows what it is programmed to do:

"Does OLED show Test after initps4()???"

As I had said beforehand in an albeit less detailed way I believe any line of code with prizm. or ps4. is interfering with the OLED screen from executing. The organization and the functions, and the naming convention helped me in general but not with diagnosing the issue as I had already found that out. I need some way to counteract this interference while keeping my code intact.

the display and the ps4 are connected over I2C-Bus. there might be a adress-confligt between them

disconnect everything except the dipslay
load the I2C-Scanner-code and run the scanner-code write down the I2C-adress

disconnect the OLED and only connect the ps4
run the scanner-code again write down the I2C-adress

if they have the same adress one of them has to be adjusted to use a different adress

best regards Stefan

I am currently testing this without the ps4 or the teleop module(module used for bluetooth connection between prizm and controller, nevertheless the OLED display does not yield what comes after the lines of code containing ps4 and prizm.

Would it be wise to buy different components such as the SparkFun Micro OLED Breakout (Qwiic) - LCD-14532 - SparkFun Electronics and the SparkFun Micro Temperature Sensor - STTS22H (Qwiic) - SEN-21273 - SparkFun Electronics as replacements to their grove counterparts? If not these which components would work? the only GPIO pins on the microcontroller I'm using are Grove ports so keeping that in mind what would work?

No buying different components without knowing the reason why it is not working together is unwise. The wise thing is analysing step by step the situation.

Did you ever use the I2C-Scanner-code?

Have you ever read datasheets?

Do you know how to find datasheets online?

What do you know about the electrical limits of the I2C-bus?

The microcontroller-world is not superstandardised like USB-devices. You have to take care of more details than just "Does the plug fit into the socket?"

best regards Stefan

You are right, so how would I specify a different I2C address on the Grove OLED display?

You are too fast. You are wayyyy to much on assumptions

Find out the reality and the facts !
run the I2C-Scanner programm to see the real I2C-adress printed to the serial monitor

It is a suspect that it is an I2C-conflict. It might be as well something different.

This is the reason why it is so important to check the real I2C-adresses
I don't want to waste time on a guessed bug that turns out to be not the case.

Same thing with buying new components. How many hundreds of dollars to you want to spend by just guessing
"if I cobble together these components I think it will work"

If you are unable to learn and analyse in a more systemic way
how about changing to the hobby of abstract painting?

"Oh maybe if I put a little more pink into it let's see what is coming out"
"Oh maybe I just throw the brush onto my picture let's see what is coming out"

If you want to proceed in programming or any other scientific area you have to work with precision and systematic

Thanks I really needed that added to everything going on in my life right now, I chose programming not as a hobby but as a career, I was pushed in the educational system in a way that drained me in every other area leaving me burned out, the only things that give me purpose now is God and robotics, oh and abstract art? tried it, and failed, failure is kind of how I am defined...enough moping around about me lets get on with this...

PRIZM Guide:
1 I2C port (I2C):
100 Khz speed. This connection shares same I2C bus as
internal DC motor and servo motor control chips. I2C
addresses 0x01-0x06 reserved by the PRIZM Controller

Tele-op Guide:
I2C data port:
4-pin data port for connection to PULSE controller

Reasoning for buying a new module that is not grove:

The grove OLED is buggy, I in fact changed the I2C address and after running the I2C address nothing changed:

The default address on the display is 0x3c so it should not interfere with the PRIZM's I2C, however I have not been able to verify the controllers I2C address due to restrictions placed by the school (the modules are school property), I should be able to test said addresses tomorrow.
I truly appreciate your help and I am sorry for not being an adult yet(seems like the whole world wants me to grow up faster), I will try to be more precise and systematic, I understand your frustration, but I am not good with words, in reality I have spent sleepless nights going over my code, and the datasheets for these modules that I am using. Sorry for my inability to be more precise with my wordage but trust me I am trying, and as I have stated before I truly appreciate your help.