Editing
Five Minutes of Fame
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= CODE = <pre> /* _ _ _____ __ __ ____ ______ _| || |_| ____| \/ |/ __ \| ____| Noisebridge 8PM third Thursdays |_ __ _| |__ | \ / | | | | |__ Years & years of Childlike Wonder & _| || |_|___ \| |\/| | | | | __| Adult Technological Themes in |_ __ _|___) | | | | |__| | | San Francisco's XXXth Finest |_||_| |____/|_| |_|\____/|_| Hacker Show and Tell. _ _ _ _ _ _____ _ _ _ | | | | | | | | | | | __ \| | | | | | | |__| | __ _ ___| | __ | |_| |__ ___ | |__) | | __ _ _ __ ___| |_| | | __ |/ _` |/ __| |/ / | __| '_ \ / _ \ | ___/| |/ _` | '_ \ / _ \ __| | | | | | (_| | (__| < | |_| | | | __/ | | | | (_| | | | | __/ |_|_| |_| |_|\__,_|\___|_|\_\ \__|_| |_|\___| |_| |_|\__,_|_| |_|\___|\__(_) Third Thurs, 8PM, Noisebridge, 2169 Mission St, SF, CA, Earth Prime More info: https://noisebridge.net/wiki/5mof Get here: https://noisebridge.net/wiki/gethere Submit your talk now! http://5mof.net/signup/ 1/13/14 -thex #fort Hardware h4x0r extradonaire, the hilaire. Send b33r or b!tcoin to noisebridge, c/o #fort */ // Number of segments (Shift Register * 8) #define numOfRegisterPins 24 int SER_Pin = 8; //pin 14 on the 75HC595 int RCLK_Pin = 9; //pin 12 on the 75HC595 int SRCLK_Pin = 10; //pin 11 on the 75HC595 // Number of seconds to count from (5 minutes) int counter = 301; boolean registers[numOfRegisterPins]; // Time has expired, count up boolean timeUp = false; int segments[] = {1, 2, 4, 5, 6, 7, 0, // 0 2, 4, 0, 0, 0, 0 ,0, // 1 1, 2, 3, 6, 7, 0, 0, // 2 1, 2, 3, 4 ,7, 0, 0, // 3 2, 3, 4, 5, 0, 0, 0, // 4 1, 3, 4, 5, 7, 0, 0, // 5 3, 4, 5, 6, 7, 0, 0, // 6 1, 2, 4, 0, 0, 0, 0, // 7 1, 2, 3, 4, 5, 6, 7, // 8 1, 2, 3, 4, 5, 7, 0 // 9 // A // B // C // D // E };// F void setup() { pinMode(SER_Pin, OUTPUT); pinMode(RCLK_Pin, OUTPUT); pinMode(SRCLK_Pin, OUTPUT); } void loop() { int minutes, seconds; if (!timeUp) { if(--counter < 0) { counter = 1; timeUp = true; } } else { if (++counter > 599) { n0153(); } } minutes = floor(counter / 60); seconds = counter - (minutes * 60); setDigits(minutes * 100 + seconds); delay(1000); } void setDigits(int num) { int digit0, digit1, digit2; clearRegisters(); writeRegisters(); digit0 = num; while(digit0 >= 10) digit0 -= 10; digit1 = (num - digit0) / 10; while(digit1 >= 10) digit1 -= 10; digit2 = (num - digit0 - digit1 * 10) / 100; setDigit(0, digit0); setDigit(1, digit1); setDigit(2, digit2); writeRegisters(); } // Update individual digit with number void setDigit(int digit, int num) { // Determine register offset int offset = digit * 8; // Determine num offset int numOff = num * 7; // Set on segments HIGH for (int i = 0; i < 7; i++) { if (segments[i + numOff] > 0) registers[segments[i + numOff] + offset] = HIGH; } } //set all register pins to LOW void clearRegisters() { for(int i = 0; i < numOfRegisterPins; i++) registers[i] = LOW; } //Set and display registers //Only call AFTER all values are set how you would like (slow otherwise) void writeRegisters() { digitalWrite(RCLK_Pin, LOW); for(int i = 0; i < numOfRegisterPins; i++) { digitalWrite(SRCLK_Pin, LOW); digitalWrite(SER_Pin, registers[i]); digitalWrite(SRCLK_Pin, HIGH); } digitalWrite(RCLK_Pin, HIGH); } void n0153() { while(true) { for (int i = 0; i < numOfRegisterPins; i++) registers[i] = random(2) > 0.5 ? HIGH : LOW; writeRegisters(); delay(round(random(314))); } } </pre>
Summary:
Please note that all contributions to Noisebridge are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Noisebridge:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Request account
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Dig in!
Noisebridge
- Status: MOVED
- Donate
- ABOUT
- Accessibility
- Vision
- Blog
Manual
MANUAL
Visitors
Participation
Community Standards
Channels
Operations
Events
EVENTS
Guilds
GUILDS
- Meta
- Electronics
- Fabrication
- Games
- Music
- Library
- Neuro
- Philosophy
- Funding
- Art
- Crypto
- Documentation/Wiki
Wiki
Recent Changes
Random Page
Help
Categories
(Edit)
Tools
What links here
Related changes
Special pages
Page information