Skip to content

Commit

Permalink
Updated README.md to use markdown
Browse files Browse the repository at this point in the history
Updated README.md to use proper code markdown around code snippets
instead of tick marks ( ' ).
  • Loading branch information
bradytheinventor committed Mar 13, 2017
1 parent 3a9d201 commit 4db8909
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ style. The code worked well, but was very messy and hard to understand. This
repository is an attempt to clear up the code and make it easier to understand.


The main file 'led_cube.py' imports core operations from 'core.py' and patterns
from the subdirectory '/patterns'. It can be run by 'cd'-ing into the project
directory, then executing 'sudo python led_cube.py'.
The main file `led_cube.py` imports core operations from `core.py` and patterns
from the subdirectory `/patterns`. It can be run by "cd-ing" into the project
directory, then executing `sudo python led_cube.py`.

'core.py' contains code to update the LED cube display. This code runs in a
separate thread at program start, in sort of a 'set-and-forget' manner.
`core.py` contains code to update the LED cube display. This code runs in a
separate thread at program start, in sort of a "set-and-forget" manner.

'/patterns/plot.py' contains the fundamental plotting functions, which act
`/patterns/plot.py` contains the fundamental plotting functions, which act
as the interface between the display updater and the patterns.

When making your own patterns, you can either put them inside one of the
existing module files (which group patterns according to what they do) or create
your own module file. If you add your own module file, you will have to import
it at the top of 'led_cube.py' by adding 'from patterns.<file> import *'.
it at the top of `led_cube.py` by adding `from patterns.<file> import *`.


The LED cube is choreographed by Sequence objects, which are built from patterns
defined in files in the '/patterns' subdirectory. Sequences require patterns to
accept three parameters: a "variation" string, the number of repetitions, and
the number of seconds to wait between 'frames' of the pattern. These three
parameters, along with the function name, are passed to the Sequence on creation
The LED cube is choreographed by `Sequence` objects, which are built from patterns
defined in files in the `/patterns` subdirectory. `Sequences` require patterns to
accept three parameters: a `"variation"` string, the number of repetitions, and
the number of seconds to wait between "frames" of the pattern. These three
parameters, along with the function name, are passed to the `Sequence` on creation
in a list.

The Sequence can be run with sequence.run(n, dt), where n is the number of
times the Sequence should run (and if n > 9999, the Sequence runs forever) and
dt is the time in seconds between frames. The Sequence class is somewhat
The `Sequence` can be run with `sequence.run(n, dt)`, where `n` is the number of
times the `Sequence` should run (and if n > 9999, the `Sequence` runs forever) and
`dt` is the time in seconds between frames. The `Sequence` class is somewhat
restrictive, so you don't have to use it if your patterns are more complicated.

At the bottom of 'led_cube.py' there is a marked section, put your patterns
At the bottom of `led_cube.py` there is a marked section, put your patterns
and sequence runs inside that section.

0 comments on commit 4db8909

Please sign in to comment.