To check if its the electronics, just do:
[phasor~ 1]
|||
[dac~ 11 12 13 ]
(besides the initialization, that is).
If the LEDs don't turn on/off every 500ms, then your electronics has issues.
Your attempt at PWM there doesn't seem particularly good. Your carrier frequency (50Hz) seems too slow: you would perceive flickering. Also, careful when using sin * sin, as the resulting frequency is going to be twice as high as the one you write in.
I have made this "virtual analog" patch so you can visualize the relevant signals in Pd (and in the Bela scope):

Source:
#N canvas 1 23 1280 684 10;
#X obj 108 341 tabwrite~ ar;
#N canvas 0 22 450 278 (subpatch) 0;
#X array ar 44100 float 2;
#X coords 0 1 44100 -1 1000 140 1 0 0;
#X restore 512 137 graph;
#X obj 182 261 +~;
#X obj 341 121 osc~ 1;
#X obj 265 64 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#N canvas 0 22 450 278 (subpatch) 0;
#X array digital-out 44100 float 2;
#X coords 0 1 44100 -1 1000 140 1 0 0;
#X restore 517 306 graph;
#X obj 269 346 expr~ $v1 > 0.5;
#N canvas 0 23 450 278 (subpatch) 0;
#X array brightness 44100 float 2;
#X coords 0 1 44100 -1 1000 140 1 0 0;
#X restore 516 466 graph;
#X obj 348 420 lop~ 100;
#X obj 352 530 tabwrite~ brightness;
#X obj 348 450 lop~ 100;
#X obj 348 480 lop~ 100;
#X text 398 399 low-pass filter;
#X text 398 409 corresponding;
#X text 398 419 to limited refresh;
#X text 398 429 rate of human;
#X text 398 439 vision;
#X obj 178 390 tabwrite~ digital-out;
#X obj 251 101 metro 1001;
#X obj 324 198 -~ 0.5;
#X obj 328 160 *~;
#X obj 59 161 phasor~ 300;
#X obj 77 500 dac~ 27 28 29;
#X text 256 303 The signal that is actually sent;
#X text 256 313 to the digital out is thresholded;
#X text 256 323 in the backend.;
#X obj 13 340 dac~ 11 12 13;
#X obj 252 30 loadbang;
#X text 98 461 Bela scope;
#X obj 405 42 s bela_setDigital @hv_param;
#X msg 406 18 out 11 ~ \, out 12 ~ \, out 13 ~;
#X connect 2 0 0 0;
#X connect 2 0 6 0;
#X connect 2 0 22 0;
#X connect 2 0 26 0;
#X connect 2 0 26 1;
#X connect 2 0 26 2;
#X connect 3 0 20 0;
#X connect 3 0 20 1;
#X connect 4 0 18 0;
#X connect 6 0 8 0;
#X connect 6 0 17 0;
#X connect 6 0 22 1;
#X connect 8 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 9 0;
#X connect 11 0 22 2;
#X connect 18 0 0 0;
#X connect 18 0 9 0;
#X connect 18 0 17 0;
#X connect 19 0 2 1;
#X connect 20 0 19 0;
#X connect 21 0 2 0;
#X connect 27 0 4 0;
#X connect 27 0 30 0;
#X connect 30 0 29 0;