Dice thrower. d100,d20,d12&d6. Results Red=Tens, Blue=Ones, Green=Both
The Circuit Playground Dice Bag - CC Attribution-ShareAlike 4.0 International Tom Higgins & Sons
TO select the type of die you would like to throw
First put the Select Switch in the proper position
Then press the proper Button
Select Switch Left Button Right Button
----------------+------------+-------------+
+ | d100 (0-99)| d20 (1-20) |
----------------|------------|-------------|
- | d12 (1-12)| d06 (1-6) |
--------------------------------------------
You can hold down the Button and it will flash through many tosses.
Release the Button and your results will show on the Circuit Playground as
two (or one) lit NeoPixel
Red=Tens Place (0-9)
Blue=Ones Place (0-9)
Green=Tens and Ones are the same (00,11,22,33,44,55,66,77,88,99)
The NeoPixels are arranged from 0 - 9 . If you are holding your Circuit Playground with the USB port facing Up
0 is the top left NeoPixel closest to the USB port
1 is to the left of that
..
4 is the bottom let NeoPixel closest to the Battery Jack
5 is the bottom right NeoPixel closest to the Battery Jack
..
9 is the top tight NeoPixel closest to the USB port
Embed This Sketch
Use the following HTML code to embed the sketch code above in your blog or website.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:361255" frameborder="0"></iframe>
Embed The Serial Monitor
You can also embed the Serial Monitor section! Just use this HTML code.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>