Error: invalid use of void expression

The problem here is you need to pass the function name, not a value (that is, the function name IS the value required here).

Instead of this

MsTimer2::set(5000, blinks(20,50));

Do this

MsTimer2::set(5000, blinks);

And it should compile