Home › Forums › WAY Off-Topic Distortion › Guess the year this website was made (199?)
- This topic has 12 replies, 5 voices, and was last updated 6 years, 8 months ago by
linuxgnuru.
-
AuthorPosts
-
January 18, 2017 at 7:26 am #67970
linuxgnuru
ParticipantQuote:This site is best viewed on a PC or MAC with a screen resolution of at least 1366×768.January 18, 2017 at 8:26 am #77240Orn
Participantlinuxgnuru wrote:Quote:This site is best viewed on a PC or MAC with a screen resolution of at least 1366×768.Fuck yeah!
January 18, 2017 at 12:27 pm #77241__eMpTy__
Participantlinuxgnuru wrote:Quote:This site is best viewed on a PC or MAC with a screen resolution of at least 1366×768.2014?
https://web.archive.org/web/*/http://555-timer-circuits.uk/January 18, 2017 at 12:29 pm #77242linuxgnuru
Participantodd; it just screamed “i just learned how to use CGI”.
good times
January 18, 2017 at 12:38 pm #77243strider
Participantlinuxgnuru wrote:Of all the weird things Venn comes up with for LGC, B-Reel is the only one I never understood. Is it a reference to Cypress Hill?
January 20, 2017 at 4:52 am #77248mfoxdogg
ParticipantThen again, who dosn’t know how to use a 555 timer by now?
January 20, 2017 at 11:24 am #77249strider
ParticipantExactly. Now if you need a ne555 you just use a raspberry pi
January 20, 2017 at 12:18 pm #77250linuxgnuru
Participantin fact; I made this 6 sided die rolling gadget using this schematic
January 20, 2017 at 12:38 pm #77251linuxgnuru
Participantand here’s the end result:
http://i.imgur.com/gkRsFes.jpg
and a short video:
https://www.youtube.com/watch?v=E6Vw3L_T7BsI used the schematic from http://555-timer-circuits.uk/projects/dice.html
January 20, 2017 at 9:55 pm #77252Orn
Participantlinuxgnuru wrote:and here’s the end result:http://i.imgur.com/gkRsFes.jpg
and a short video:
https://www.youtube.com/watch?v=E6Vw3L_T7BsI used the schematic from http://555-timer-circuits.uk/projects/dice.html
Looks like something that will definitely get me arrested
January 21, 2017 at 12:49 am #77253strider
ParticipantHow did you manage to do this without a RaspberryPi? Are you a wizard?
January 21, 2017 at 10:05 am #77254Orn
Participantstrider wrote:How did you manage to do this without a RaspberryPi? Are you a wizard?You have to remember, he was doing RaspberryPi’s from scratch before there was even a RaspberryPi, also he’s one of them old people
January 22, 2017 at 12:56 am #77256linuxgnuru
Participantdamn you guys; I went ahead and wrote this quick C program that turns a raspberry pi into a 6 sided die…
Code:#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>#include <time.h> // for srand
#include <wiringPi.h>
#define MAX_NUM 7
#define MAX_DIG 6/*
0 4
1 3 5
2 6
*/
const int pins[7] = { 0, 1, 2, 3, 4, 5, 6 };const int pips[6][7] = {
{ 0, 0, 0, 1, 0, 0, 0 }, // 1
{ 1, 0, 0, 0, 0, 0, 1 }, // 2
{ 1, 0, 0, 1, 0, 0, 1 }, // 3
{ 1, 0, 1, 0, 1, 0, 1 }, // 4
{ 1, 0, 1, 1, 1, 0, 1 }, // 5
{ 1, 1, 1, 0, 1, 1, 1 } // 6
};const int inputPin = 7;
const int haltPin = 29;static void die(int sig);
void roll_die();int main(int argc, char **argv)
{
int i;
int dl = 0;srand((unsigned)time(NULL));
// note: we’re assuming BSD-style reliable signals here
(void)signal(SIGINT, die);
(void)signal(SIGHUP, die);
if (wiringPiSetup () == -1)
{
(void)fprintf(stderr, “oops %dn”, errno);
return 1;
}
for (i = 0; i < MAX_NUM; i++)
{
pinMode(pins[i], OUTPUT);
digitalWrite(pins[i], LOW);
}
pinMode(inputPin, INPUT);
pullUpDnControl(inputPin, PUD_UP);
pinMode(haltPin, INPUT);
pullUpDnControl(haltPin, PUD_UP);
/*
for (i = 0; i < 6; i++)
{
printDie(i);
delay(500);
}
*/
while (1)
{
if (digitalRead(haltPin) == LOW)
{
system(“shutdown -h now”);
}
if (digitalRead(inputPin) == LOW)
{
dl = 1;
for (i = 0; i < 30; i++)
{
roll_die();
delay(dl);
dl += 5;
}
}
}
return 0;
}static void die(int sig)
{
int i;
for (i = 0; i < MAX_NUM; i++)
digitalWrite(pins[i], LOW);
if (sig != 0 && sig != 2)
(void)fprintf(stderr, “caught signal %dn”, sig);
if (sig == 2)
(void)fprintf(stderr, “Exiting due to Ctrl + Cn”);
exit(0);
}void roll_die()
{
int i, r;r = rand() % MAX_DIG;
for (i = 0; i < 7; i++)
digitalWrite(pins[i], pips[r][i]);
} -
AuthorPosts
- You must be logged in to reply to this topic.