author
10Comments

Tell us about yourself!

Complete Your Profile
  • Raspberry Pi: Wall Mounted Calendar and Notification Center

    Sure, so here's what I have for my clock from PC_Payn3. I have other things inside the <script type="text/javascript"> </script> tags, and I'm still playing with the fonts and sizes, but this is what I have inside those tags for the clock:<script type="text/javascript">setInterval(function() {var currentTime = new Date ( );var currentHours = currentTime.getHours ( );var current12Hours = currentHours > 12 ? currentHours - 12 : currentHours;var currentMinutes = currentTime.getMinutes ( );var currentMinutesleadingzero = currentMinutes > 9 ? currentMinutes : '0' + currentMinutes; // If the number is 9 or below we add a 0 before the number.var currentMinutesampm = currentHours < 12 ? currentMinutesleadingzero + ' am' : currentMinutesleadingzero...

    see more »

    Sure, so here's what I have for my clock from PC_Payn3. I have other things inside the <script type="text/javascript"> </script> tags, and I'm still playing with the fonts and sizes, but this is what I have inside those tags for the clock:<script type="text/javascript">setInterval(function() {var currentTime = new Date ( );var currentHours = currentTime.getHours ( );var current12Hours = currentHours > 12 ? currentHours - 12 : currentHours;var currentMinutes = currentTime.getMinutes ( );var currentMinutesleadingzero = currentMinutes > 9 ? currentMinutes : '0' + currentMinutes; // If the number is 9 or below we add a 0 before the number.var currentMinutesampm = currentHours < 12 ? currentMinutesleadingzero + ' am' : currentMinutesleadingzero + ' pm';var currentDate = currentTime.getDate ( );var currentYear = currentTime.getFullYear ( );var weekday = new Array(7);weekday[0] = "Sunday";weekday[1] = "Monday";weekday[2] = "Tuesday";weekday[3] = "Wednesday";weekday[4] = "Thursday";weekday[5] = "Friday";weekday[6] = "Saturday";var currentDay = weekday[currentTime.getDay()];var actualmonth = new Array(12);actualmonth[0] = "January";actualmonth[1] = "February";actualmonth[2] = "March";actualmonth[3] = "April";actualmonth[4] = "May";actualmonth[5] = "June";actualmonth[6] = "July";actualmonth[7] = "August";actualmonth[8] = "September";actualmonth[9] = "October";actualmonth[10] = "November";actualmonth[11] = "December";var currentMonth = actualmonth[currentTime.getMonth ()];var currentTimeString = "<h1>" + current12Hours + ":" + currentMinutesampm + "</h3><h3>" + currentDay + " " + currentMonth + " " + currentDate + ", " + currentYear + "</h3>";document.getElementById("clock").innerHTML = currentTimeString;}, 1000);</script><center><span id="clock"></span></center>

    Sorry, I don't know how to edit comments. I had a mistake in my code. The way I'm doing it, checking if it is less than 12 would only work if I am checking if it is less than 13. If I did it the otherway, it would work, checking to see if it is greater than 12. Hope that makes sense. Also I was able to add the am/pm, but manipulating the currentMinutesleadingzero variable. I created a new variable called currentMinutesampm, and it looks like this:var currentMinutesampm = currentHours < 12 ? currentMinutesleadingzero + ' am' : currentMinutesleadingzero + ' pm';Then I output it using currentMinutesampm instead of currentMinutesleadingzero

    I've got your clock up and running in mine, but what font are you using? And are you implementing it in your javascript code, or using css or something?

    I did this by adding adding some math to the currentHours variable. Basically it checks to see if currentHours is less than 12. If it is, it just leaves it alone. If it is more than 12, then it takes the currentHours, and subtracts 12 from it. Then at the bottom where it outputs the different variables I used my current12Hours instead of the currentHours. Only thing I haven't quite worked out yet is how to output the am or pm yet. Here's my code:setInterval(function() { var currentTime = new Date ( );var currentHours = currentTime.getHours ( ); // If time is greater than 13 hours, subtract 12 to make it 12 hour formatvar current12Hours = currentHours < 12 ? currentHours : currentHours - 12;var currentMinutes = currentTime.getMinutes ( );var currentMinutesleadingzero = currentMi...

    see more »

    I did this by adding adding some math to the currentHours variable. Basically it checks to see if currentHours is less than 12. If it is, it just leaves it alone. If it is more than 12, then it takes the currentHours, and subtracts 12 from it. Then at the bottom where it outputs the different variables I used my current12Hours instead of the currentHours. Only thing I haven't quite worked out yet is how to output the am or pm yet. Here's my code:setInterval(function() { var currentTime = new Date ( );var currentHours = currentTime.getHours ( ); // If time is greater than 13 hours, subtract 12 to make it 12 hour formatvar current12Hours = currentHours < 12 ? currentHours : currentHours - 12;var currentMinutes = currentTime.getMinutes ( );var currentMinutesleadingzero = currentMinutes > 9 ? currentMinutes : '0' + currentMinutes; // If the number is 9 or below we add a 0 before the number.var currentDate = currentTime.getDate ( );var weekday = new Array(7);weekday[0] = "Sunday";weekday[1] = "Monday";weekday[2] = "Tuesday";weekday[3] = "Wednesday";weekday[4] = "Thursday";weekday[5] = "Friday";weekday[6] = "Saturday";var currentDay = weekday[currentTime.getDay()];var actualmonth = new Array(12);actualmonth[0] = "January";actualmonth[1] = "February";actualmonth[2] = "March";actualmonth[3] = "April";actualmonth[4] = "May";actualmonth[5] = "June";actualmonth[6] = "July";actualmonth[7] = "August";actualmonth[8] = "September";actualmonth[9] = "October";actualmonth[10] = "November";actualmonth[11] = "December";var currentMonth = actualmonth[currentTime.getMonth ()];var currentTimeString = "<h2>" + current12Hours + ":" + currentMinutesleadingzero + "</h2><h2>" + currentDay + " " + currentDate + " " + currentMonth + "</h2>";document.getElementById("clock").innerHTML = currentTimeString;}, 1000);

    View Instructable »
  • Raspberry Pi: Wall Mounted Calendar and Notification Center

    Ha bad assumption.

    Thanks!

    I'm taking a wild stab here, but I'm going to assume that you're the Adam of Forecast Embeds?

    View Instructable »
  • Raspberry Pi: Wall Mounted Calendar and Notification Center

    Sorry, this is an old thread, but I was just wondering where you got the code for your weather widget. The only decent one I can find is from AccuWeather, which looks nice, but I like the simplicity of yours. (and I've noticed a few others here using it as well). Also, does it automatically refresh, or have you written in some code to refresh it? (The weather widget)

    I'm working on mine and trying to power it using a similar method. I found a spot that provides 5 VDC all the time whether the monitor is powered on or not, so I could easily solder a power cord to that, I'm just if it will provide enough amps for the Pi3. I read somewhere that the Pi3 really only peaks out at about 800ma, but I'm not sure how much this circuit is built to handle. It's basically the power connector from the main board of the monitor (that powers the led's) to the video controller board. Anyway, I suppose I could just try it, and I'm sure it will work, just not sure if the Pi3 is going to draw too many amps at any given time. It really won't ever have anything plugged into the USB ports, but I think I want to put ports on the side in case I ever need to connect a key...

    see more »

    I'm working on mine and trying to power it using a similar method. I found a spot that provides 5 VDC all the time whether the monitor is powered on or not, so I could easily solder a power cord to that, I'm just if it will provide enough amps for the Pi3. I read somewhere that the Pi3 really only peaks out at about 800ma, but I'm not sure how much this circuit is built to handle. It's basically the power connector from the main board of the monitor (that powers the led's) to the video controller board. Anyway, I suppose I could just try it, and I'm sure it will work, just not sure if the Pi3 is going to draw too many amps at any given time. It really won't ever have anything plugged into the USB ports, but I think I want to put ports on the side in case I ever need to connect a keyboard and mouse to it. Otherwise, that would be all it would power.Oh and this is from an LCD monitor, not a laptop monitor.

    View Instructable »