Monthly Archives: July 2017

1080p HDTV as second monitor display blinks on and off while watching video

I have a second monitor which is a Philips 1080p 40 inch TV (that I switch the HDMI inputs to alternate between cable and a second monitor).

When I play streaming video from YouTube on the monitor, the display blinks on and off continuously.  This does NOT happen when using the Philips for TEXT displays (outlook, explorer, etc.)

The fix is easy.

First, make sure your second monitor (HDTV) is in “PC” mode. (This is not the fix in itself).

Secondly, I have the most current NVIDIA drivers installed.

Go to NVIDIA CONTROL PANEL (right click on an empty desktop)

Click ADJUST DESKTOP COLOR SETTINGS

click on your secondary monitor name (in my case, PHILIPS)

You will see a dropdown box appear.

Set “content reported to the desktop” to “Desktop Programs”.

 

That’s it.

Your secondary monitor should now be rock stable while watching videos.

 

let me know if this helped you!

sprintf or printf do not output float variables correctly

Have you run into situation under the MPLAB IDE where you are trying to output variables, but even though you have the format correct, a float variable outputs with a .0 value?

Example

(from somewhere else in code)
AIRTEMP=751
====
float adjustedtemp= 0.0;
adjustedtemp= (AIRTEMP + 5)/10;
printf("Air Temp: %5.2f \r\n", adjustedtemp);

the result looks like this

Air Temp: 75.00

when it SHOULD look like this

Air Temp: 75.60

this is due to a bug in the way MPLAB handles floats.

Two easy ways to fix it:

#1:

adjustedtemp= (AIRTEMP + 5.0)/10.0;

or,

#2

adjustedtemp= ((float)AIRTEMP + 5)/10;

Either of these methods will result in the correct value being displayed during your sprintf() or printf() command.