<commit_before># neopixel-simulator
Simulates a neopixel strip in javascript for quick prototyping.

## Installation
1. Clone repository
2. `npm install`
3. `npm start`
4. Visit `http://localhost:8080` to view the test pattern

## Write your own patterns!
Modify the code in `index.js` to quickly prototype your Neopixel patterns
without compiling and uploading to an Arduino board. It's pretty close to
real Arduino C syntax, so it's easily portable to the real hardware.

## Arduino runtime simulator
The Arduino constructor takes two functions: `begin` and `loop`. 
`begin` is called once when the Arduino runtimes starts. `loop` is called
continuously. Unlike javascript, Arduino is synchronous and you call `delay`
to sleep between loop executions. In javascript, you need to use the `await` keyword
and the `delay` function on the Arduino runtime object.

<commit_msg>Updated README to explain custom pixel layouts.<commit_after># neopixel-simulator
Simulates a neopixel strip in javascript for quick prototyping.

## Installation
1. Clone repository
2. `npm install`
3. `npm start`
4. Visit `http://localhost:8080` to view the test pattern

## Write your own patterns!
Modify the code in `index.js` to quickly prototype your Neopixel patterns
without compiling and uploading to an Arduino board. It's pretty close to
real Arduino C syntax, so it's easily portable to the real hardware.

## Custom pixel layout
By default, the Neopixel simulator will generate a straight strip of pixels.
If you want to simulate a more complex layout, you can create the elements yourself
in `src/index.html`. The only requirement is that each pixel have the `pixel` class, and
a `p-0` class (where 0 is the index of the pixel, incrementing).

Instead of `new Neopixel(NUM_PIXELS)` instantiate your strip with `Neopixel.fromElement(STRIP_ELEMENT)`.

## Arduino runtime simulator
The Arduino constructor takes two functions: `begin` and `loop`. 
`begin` is called once when the Arduino runtimes starts. `loop` is called
continuously. Unlike javascript, Arduino is synchronous and you call `delay`
to sleep between loop executions. In javascript, you need to use the `await` keyword
and the `delay` function on the Arduino runtime object.


{'fraction_non_alphanumeric': 0.06511001347103727, 'fraction_numerical': 0.008082622361921869, 'mean_word_length': 4.832460732984293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3414144', 'n_tokens_mistral': 647, 'n_tokens_neox': 587, 'n_words': 321}