Your problem is with expression
$$A(1-\tfrac{u}{2t})$$
Indeed, placing $t$ in the denominator gives you a piece of hyperbola instead of a straight line...
Edit 1: Here is a Matlab program based on a completely different point of view, with convolution:
clear all;close all;hold on;
axis([0,1500,-250,250]);
rec=@(t,u)(heaviside(u/2-t).*heaviside(u/2+t));% rect function
t=-pi/2:0.01:pi/2;
f=conv(rec(t,0.1),rec(t,1),'same');% conv. of two rect = trapezoid
Z=zeros(1,100);
np=10;%number of periods
g=repmat([1,Z,-1,Z],[1,np]);% Dirac comb with alternate peaks giving the periodization:
h=conv(g,f,'same');plot(h,'r');
Edit 2: A very astute compact way to obtain a periodic trapezoidal wave on this site:
a = 10 % Amplitude
m = 5 % Time Period
l = 5 % Horizontal Spread
c = 2 % Vertical Spread
x = 0:.1:50 %Sample Points
TW = (a/pi)*(asin(sin((pi/m)*x+l))+acos(cos((pi/m)*x+l)))-a/2+c;
plot(x,TW)
Edit 3:
The Fourier series of this odd function has only $b_n$ coefficients:
$$f(t)=\frac{8A}{\pi u}\sum_{n=1}^{\infty}{\sin ( { (2n-1) u/2 }) \over (2n-1)^2} \cdot \sin((2n-1) t)$$
A reference for this