From ad8f1565a8e9275aaf1351b23c67960d9937f4d3 Mon Sep 17 00:00:00 2001 From: Gunstick Date: Sun, 12 Apr 2015 22:25:58 +0200 Subject: [PATCH] Some improvements in the readme --- displayclient/ardupixel/ardupixel.ino | 4 +- displayclient/ardupixel/feed_stream-25x20.sh | 52 ++++++++++++++ v2/readme.md | 75 +++++++++++++++++++- v2/requirements.txt | 1 + 4 files changed, 128 insertions(+), 4 deletions(-) create mode 100755 displayclient/ardupixel/feed_stream-25x20.sh diff --git a/displayclient/ardupixel/ardupixel.ino b/displayclient/ardupixel/ardupixel.ino index e3587f6..1ba92f7 100644 --- a/displayclient/ardupixel/ardupixel.ino +++ b/displayclient/ardupixel/ardupixel.ino @@ -15,8 +15,8 @@ // How many NeoPixels are attached to the Arduino? // at 800Mhz we can send 33333 color values / second // so to have 60hz refresh the max pixels is 555 so we set it to arbitryrily 512 -#define ROWS 5 -#define COLS 5 +#define ROWS 25 +#define COLS 20 #define NUMPIXELS ROWS*COLS diff --git a/displayclient/ardupixel/feed_stream-25x20.sh b/displayclient/ardupixel/feed_stream-25x20.sh new file mode 100755 index 0000000..1abad3c --- /dev/null +++ b/displayclient/ardupixel/feed_stream-25x20.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# test program +# modify below the ethernet adress +IP="$1" +# width and height are unfortunately hardcoded +a=-1 +while true +do +a=$((a+1)) +frame="$( + echo "s2l" + printf "DI000 " +# 55518 " + printf "1" + echo "" + #a=$(date +%S) + #a=$((0+a)) + j=0 + while [ $j -lt 20 ] + do + i=0 + while [ $i -lt 25 ] + do + n=$((i*5+j)) + if [ $n -eq $a ] + then + printf "xyz " + else + printf " " + fi + i=$((i+1)) + done + j=$((j+1)) + echo "" # next row + done + d=0 +# while [ $d -lt 12 ] +# do +# s=0 +# while [ $s -lt 8 ] +# do +# printf "1${s}1 " +# s=$((s+1)) +# done +# d=$((d+1)) +# echo "" # next display +# done +)" + echo "$frame" + echo "$frame" | nc -w 1 -u $IP 8888 +# sleep 1 +done diff --git a/v2/readme.md b/v2/readme.md index 967c319..c3195a6 100644 --- a/v2/readme.md +++ b/v2/readme.md @@ -6,16 +6,68 @@ Nb: The Processing Python code is Python2 This readme assumes you are in the 'v2' directory. +Flow diagram +============ + + +----------------+ + | | + | processing | + | jton(python2) | + | | + +--------+-------+ + | TCP + v + +--------+-------+ + | | + | reciever | + | python3 | + +--------+-------+ + | TCP + v 6379 + +--------+-------+ + | | + | regis | + | | + +--------+-------+ + | TCP + v o-o o o-o o o-o o + +--------+-------+ | | | | | | | | | + | | o o o o o o o o o + | forwarder | | | | | | | | | | + | python3 | o o o o o o o o o + | | | | | | | | | | | + +--------+-------+ o o o o o o o o o + | serial | | | | | | | | | + v o o-o o o-o o o-o + +--------+-------+ +--------+ --------+ | | + | |==| | --------------+ | + | teensy3.1 |==| OctoWS | --------------------+ + | |==| | + +----------------+ +--------+ + Installation ============ ``` + # This is for install on a linux64 bit. Your milage may vary + # download the processinag archive here https://processing.org/download/ + tar xvzf processing-*-linux64.tgz + cd processing-* + alias processing=$PWD/processing + echo "alias processing=$PWD/processing" >> .profile + # install python modules + sudo apt-get install python3-pip redis-server python-virtualenv + virtualenv -p /usr/bin/python3 virtenv + . virtenv/bin/activate pip install -r requirements.txt + processing + # Java->Add mode... [Python] -> Install... ``` Base Setup ========== + Make sure redis-server is running. If it is you should be able to connect to port 6379 ``` @@ -90,7 +142,7 @@ In the mode manager select Python and install Next step will be to open the following file in processing: ``` - backend/processing/PixelControl_TCP/PixelControl_TCP.pyde + processing backend/processing/PixelControl_TCP/PixelControl_TCP.pyde ``` Configure the height and width of your Pixel Setup @@ -100,8 +152,27 @@ For test purposes the brightness has been set to low The current demo is a green dot that will chase around the LED-strip. Setting long_line to True or False will change the wrapping mode - +long_line=False + o-+ o-+ o-+ o-+ o + | | | | | | | | | + o | o | o | o | o + | | | | | | | | | + o | o | o | o | o + | | | | | | | | | + o | o | o | o | o + | | | | | | | | | + o +-o +-o +-o +-o +long_line=True + o---o o---o o + | | | | | + o o o o o + | | | | | + o o o o o + | | | | | + o o o o o + | | | | | | + o o---o o---o Sending images to the grid ========================== diff --git a/v2/requirements.txt b/v2/requirements.txt index 5182e58..31a0077 100644 --- a/v2/requirements.txt +++ b/v2/requirements.txt @@ -1,2 +1,3 @@ redis pillow +pyserial