How to have multiple digital outputs for the same pin on Arduino Uno and Simulink? I'm trying to develop a PID controller with Simulink as shown in the image PID. I'm using a PID controller to control a motor via an Arduino Uno and motor driver.

I have the PID output connected to an if statement. 


If u1 is larger than 0 then output 1 for digital output pin 2 and output 0 for digital output pin 4. 
If u1 is smaller than 0 then output 0 for digital output pin 2 and output 1 for digital output pin 4. 


This changes the direction of the motor so that if the PID overshoots it will change direction. And so on for u1 is smaller than 0.

I also have the PWM signal for the speed of the actuator from 0 being the slowest and 255 as the fastest[]. I forgot to fix the label for it.

I keep getting an error when I try to run it. The error says that I can't run it because of having multiple digital output blocks with the same pin as shown in this image Error in Simulink. 

Is there a solution for this?
You cannot try and have two things controlling one output in two different ways. It just makes no sense.  Like trying to have two people steer a car and have one go left and the other right.

I don't quite know what you're trying to do, but under normal usage using a motor driver requires 3 pins (for example the common L239D). Two define the direction and a third (the EN pin on the L239D) controls the speed with PWM.