In this case, each of the eight bits in a byte of data sent to the printer corresponds to one pin on the printhead. A bit’s value can be either 1 or 0. When the printer receives the data, it interprets a bit with a value of 1 as a command to fire the corresponding pin. Bits that are set to 0 don’t cause pins to fire.
Each block code will end up with its own “byte ID” so it can be visualized and identified on paper in the graphics line. But before getting there, a few tests have been done to try different bit combos and select the generators the most aesthetically pleasing for us :)
Below, one of the small quick and dirty shell scripts used to quickly test different patterns:
#!/bin/sh
# OKI 320 ML tests
# this test is to generate (crap) random 8 pin mode patterns
#PRNG
function rand {
echo "obase=8;`expr $RANDOM % 256`" | bc
}
function randpat {
n=1
while [ $n -le 256 ]; do
RND=`rand`
echo -ne '\'$RND
n=$((n+1))
done
}
PATTERN=`randpat`
# noise
# PATTERN2=`head /dev/urandom -c 1024`
echo -e '^[@^[5^[9^[*1\4'$PATTERN'^[@' | lp -o raw
Not to mention the impossibility to store the calibration settings on the firmware (only windows apparently…) so everything needs to be stored directly in the xorg.conf file. The free xorg input driver works I think, as it read from /dev/ttyS0 and translate the data in X11 events, but not the right events unfortunately. Because we could not find any documentation on the calibration settings, it is also virtually impossible to manually configure the driver.
Fortunately, tom came up with a cool hack, so now we read directly from /dev/ttyS0 by calling a pseudo driver that just filter out the unwanted hexadecimal crap and translate it correctly. The calibration is simply done within PF. In the end this solution is even more elegant than using the xorg driver and reading the X11 events from PF.
And yes it feels nice to play with the little thingies on the screen.
]]>
While working on “go forth & *” it became obvious to avoid as much as possible buillt-in components and prefer generic libraries that can live outside of the project itself for later use and better code structure.
At the moment miniphy is the first of those metabiosis Forth libs to have made its way out of the main project and will be kept synced with it for later fixes and improvements. Future version will in priority implement double space geometry for 2D vectors and later 3D vectors (higher dimensions are also considered but will be probably live next to the n-dimension multigrid tool instead).
Miniphy comes with simple examples that show how to use it for autonomous agents.
You can grab miniphy here: http://devel.goto10.org/
The code (together with all Go Forth! PF workshop material) can be found here: http://devel.goto10.org
]]>The code can be found on: http://devel.goto10.org
]]>