so close…
client Height/Width is the screen, but the body has height/width reduced by margins…
how can I get the size of the margin in javascript to do the corrections programatically?
so close…
client Height/Width is the screen, but the body has height/width reduced by margins…
how can I get the size of the margin in javascript to do the corrections programatically?
@cyrus1337 the specs do not say how the yellow wire is used to control the fan.
@peter so, you made a transistor based relay… cool…
but that doesn’t help his speed control question…
I am trying to fix MMM-ImagePhotos and MMM-Slideshow to not truncate portrait images or zoom in some landscape images…
i have them almost completely fixed, except a small section of the screen at the bottom starting in the middle of the rss feed output and below…
https://www.dropbox.com/s/jnudtn8wpef4ba5/IMG_20180925_125325.jpg?dl=0
https://www.dropbox.com/s/gt1nxxwxkymgyic/IMG_20180925_125340.jpg?dl=0
the updated code does
// create the div for this module
var wrapper = document.createElement("div");
// set its size to the full display area
wrapper.style.width = document.body.clientWidth;
wrapper.style.height = document.body.clientHeight;
// set the div position
wrapper.style.left = 0;
wrapper.style.top = document.body.clientHeight;
// make position relative
wrapper.style.position = "relative";
// set a background color to improve the looks
wrapper.style.backgroundColor = self.config.backgroundColor;
// turn off any border
wrapper.style.border = "none";
// use users opacity setting
wrapper.style.opacity = self.config.opacity;
if I use position=“absolute” for the div it looks like this
https://www.dropbox.com/s/k0i4hror1rx9tp5/IMG_20180925_125427.jpg?dl=0
how can I get rid of the bottom bar?
it looks worse on a different tv (both devices are TVs, not monitors)
https://www.dropbox.com/s/shly9zuo8hhb3bn/IMG_20180925_125243.jpg?dl=0
why don’t my pics show when I use the Picture info wrapper?
the raspberry pi does not provide +12v on any pin… only +5 or +3.3v
see https://www.raspberrypi.org/documentation/usage/gpio/
so you will need another power source that you can turn on/off programatically… or have to install a relay you can control via gpio pins… see google search results for ‘raspberry pi relay control’
now… what signal is required on the speed wire?
typically a gpio pin is either on, or off, or transitioning between one and the other.
so, you would need some other hardware to control the levels of this input to the fan
see google search results for ‘programmable potentiometer raspberry pi’
once u can control it manually, you can write code to do the same…
@steff92 if u have a keyboard press ctrl-shift-i ( letter i) to open debug console.
Or start mirror in Dev mode, not full screen
npm start Dev
Alt-tab will also walk u between the available windows
@justjim1220 the second. Don’t depend on users to do multiple entries
@justjim1220 that error looks like from the constructed url failing
@justjim1220 make sure to add an entry to the lifeFormArray that matches the string you define for ‘none’ (no user entry supplied)
ok, your source ‘lifeFormArray’ is a hash… good for looking up randomly
now to get the user specified list into something usable, split is the way as already posted
// if user specified something
if(this.config.lifeForms.length >0 )
{
// split will return an array with only one entry if no comma found
this.config.user_keys=this.config.lifeForms.split(',');
}
else
// add an entry to a special lifeFormArray entry for missing config info
this.config.user_keys.push("none");
now, you want random, or walk the array of user_keys?
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
// get one of the user specified data keys, using random
var key=this.config.user_keys[this.getRandomInt(this.config.user_keys.length)];
// append that id value to the url.
this.url = "http://eol.org/api/pages/1.0.json?batch=false&id=" +this.lifeFormArray.key;
its unclear if u wanted all or just one…