Very Simple Stopwatch

From GMod Wiki

Jump to: navigation, search

Contents

Description

This is an easy, fast, and accurate stopwatch. You can time anything with it at just a touch of a button.

Instructions

1. Spawn a flat prop. The PHX 1x2 is ideal for this, but a door could work.

2. Create a wired screen on one of the two squares. It should use only one value, large font, have the name be Stopwatch or Timer, and give it the Large Wire Screen model.

3. Spawn a wired Timer Gate under Gate - Time.

4. Spawn two wire buttons; one should be red and one should be green.

5. Time to wire! Wire the Timer's Start to the green button; then wire the Timer's Clear to the red one.

6. Wire the screen to the timer. 7. Start the timer and you should see that the screen displays time to a thousandth of a second. Let's fix that...

8. Spawn a wire Rounder.

9. Wire the Rounder to the Timer.

10. Re-wire the Screen to the Rounder.

11. Now test. The screen should display the time (in intergers). The green button should start/pause the stopwatch, and the red button should clear the value.


Additions

Alarm Clock

Adding an alarm when the stopwatch hits a certian value is easy.

1. Create an Equal Gate under Gates - Comparison

2. Create a Sound Emitter set to any alarm sound.

3. Create an Or Gate under Gates - Logic (I think)

4. Create a Constant Value with 6 values. I'll tell you what they should be later on.

5. Wire all 6 values to one of the Or chip's many inputs.

6. Wire the Equal to the Rounder, and then to the Or.

7. Finally, wire the Sound Emitter to the Equal.


To set the CV, find a time in seconds (60 seconds = 1 min; 1440 seconds = 1 hour) and make that the first value. The other five should be a second later than the first one. For example, if I wanted the alarm to go off at thirty seconds, I'd make the CV say: 30 31 32 33 34 35. The alarm will shut itself off after 5-6 seconds.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox