4D systems sketch

Hello community!

I have encountered a problem that 2 hours of googling and trawling hasn’t solved. If I am somehow blind please post a link below.

Here is my predicament. I have bought myself a 4D systems uLCD-43PT with the arduino shield, arduino UNO and I made a circuit that will take in audio and output an analog signal.

Here’s my code for the sketch,

#include <genieArduino.h>

int led = 13;
int threshold = 2; //This wil eventually be user input
double lastValue;
int value;
double currentValue;

Genie genie;
#define RESTLINE 4  // Change this if you are not using an Arduino Adaptor Shield Version 2 (see code below)
void setup() {
  Serial.begin(9600);
  genie.Begin(Serial);

  //genie.AttachEventHandler(myGenieEventHandler);
  
  pinMode(RESTLINE, OUTPUT);
  digitalWrite(RESTLINE, 1);
  delay(100);
  digitalWrite(RESTLINE, 0);

  delay(3500);

  //Turn the Display on (Contrast) - (Not needed but illustrates how)
  genie.WriteContrast(1); // 1 = Display ON, 0 = Display OFF.

  //Write a string to the Display to show the version of the library used
  genie.WriteStr(0, GENIE_VERSION);
  
  lastValue = analogRead(A0); //This is the yellow wire.
}

void loop() {

  genie.WriteObject (GENIE_OBJ_FORM, 0, 0);

  while(1){
  value = analogRead(A0);
  currentValue = value * (5.0 / 1023.0);

  genie.WriteObject (GENIE_OBJ_SCOPE, 0, currentValue);

  delay(10);
  }
 
}

When I upload this program I have the shield plugged in, the analog signal cable plugged into A0 on the UNO but I don’t have the 4D screen plugged in.

The code uploads successfully and I can see the TX LED flashing every 10ms which is great. I press the manual reset (either on the UNO or the shield) and the code will do it’s setup and then flash the TX LED as I expect.

My problem is that when I unplug the USB from the UNO board and plug it back in the L light comes on, on the UNO but the code doesn’t seem to run.

My attempt to troubleshoot this bought me to find that it may be the bootloader but unless I’m mistaken it doesn’t match my problem since the manual reset works the way it should.

I also uploaded the basic sketch example of the blinking LED and unplugged the UNO and plugged it back in and it worked fine multiple times that I did that.

Any ideas?