FlipDot-Simulator

See the simulator in action in the following videos.

_images/simulator_video_thumbnail.png _images/clock_video_thumbnail.png

Installation

The simulator relies on the pygame framework. Therefore this has to be installed before - pip can be used for this.:

$ pip install pygame

More information about this process is available on the pygame-website.

Next the source code must be downloaded from the project page at github. The archive must be extracted into an empty directory. Create a file flipdotsim_example.py with the content listed in the example section below and run it with python flipdotsim_example.py.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import flipdotsim
import time

# Create a Simulator with the given dimension
display = flipdotsim.FlipDotSim(width=16, height=8)

# turn some pixels on in the top left corner
display.px(0, 0, True)
display.px(1, 0, True)
display.px(0, 1, True)
# The display will not change until the show method is invoked
display.show()
time.sleep(2)

# Lets run one dot from top left to bottom right
for y in range(display.height):
   for x in range(display.width):
       display.px(x, y, True)
       display.show()
       time.sleep(0.1)
       display.px(x, y, False)

Module Description

A package that allows for simulating the display without the need of a physical display. It relies on the pygame-package.

The simulator can be used in the following way. Creating a display with specific dimensions.

>>> import flipdotsim
>>> fds = flipdotsim.FlipDotSim(width=28, height=13)

Set two pixels at the top left to be turned on.

>>> fds.px(0,0, True)
>>> fds.px(0,1, True)

Actually turn on or off all pixels.

>>> fds.show()
class flipdotsim.FlipDotSim(width=28, height=13, fps=30)[source]

Simulator class that shows the display in a pygame GUI.

clear(invert=False)[source]

Set all pixels to false.

px(x, y, val)[source]

Set a pixel to on or off at (X|Y). The dot will not be displayed immediately.

reset(x, y)[source]
set(x, y)[source]
show()[source]

Show the current state of all pixels on the display.

Simulator (godot version)

There is another simulator that relies on the godot game engine. A standalone version for Windows and Linux is available from the projects releases page.

After startup the simulator can be controlled by cursor keys (moving the display) and page up/down for scaling the map.

The simulator conforms to the protocol described in the Net module: send a sequence of 1s and 0s (in ASCII) to port 10101 of the server.