<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Thu May 23, 2013 7:55 pm by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Thu May 23, 2013 7:55 pm</pubDate>
  <lastBuildDate>Thu May 23, 2013 7:55 pm</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: I would like some help please...</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=98031#98031</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=58561'&gt;Bazza&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Mar 27, 2011 10:19 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi bobthebob1234...&lt;br /&gt;
&lt;br /&gt;
Thanks for that...&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;at a glance&amp;quot; analogue colour display can be much more useful&lt;br /&gt;
than trying to read and focus on numbers.&lt;br /&gt;
&lt;br /&gt;
You might like Python - why not give it a try?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=98031#98031</comments>
                                        <author>Bazza</author>
                                        <pubDate>Sun Mar 27, 2011 10:19 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=98031#98031</guid>
                                      </item>
                                      <item>
                                        <title>Re: I would like some help please...</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=98026#98026</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=23984'&gt;bobthebob1234&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Mar 27, 2011 5:24 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Well I didn't know what version I had (didn't even know I had python installed, can't remember ever using it!) so I tried it anyway then found my version&lt;br /&gt;
&lt;br /&gt;
I did try the 2.6 version on activestate and that worked and looked quite nice.&lt;br /&gt;
&lt;br /&gt;
Might have to start learning some python. To the subs area! &lt;img src=&quot;images/smiles/icon_biggrin.gif&quot; alt=&quot;Very Happy&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=98026#98026</comments>
                                        <author>bobthebob1234</author>
                                        <pubDate>Sun Mar 27, 2011 5:24 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=98026#98026</guid>
                                      </item>
                                      <item>
                                        <title>Re: I would like some help please...</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=98024#98024</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=58561'&gt;Bazza&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Mar 27, 2011 12:56 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi bobthebob1234...&lt;br /&gt;
&lt;br /&gt;
Thanks but......&lt;br /&gt;
&lt;br /&gt;
The code is specific about needing 3.x.x as it does much stuff totally&lt;br /&gt;
differently to the 2.x.x series...&lt;br /&gt;
&lt;br /&gt;
If you want to try it out on Python 2.6.x go to the pointer in my previous&lt;br /&gt;
upload, you never know, YOU might find it useful or even develop a&lt;br /&gt;
multiple colour bargraph generator module... Yes it is easily possible&lt;br /&gt;
to make an import(able) module that can be called on the fly!&lt;br /&gt;
(My version is a stand alone program - not a module!)&lt;br /&gt;
&lt;br /&gt;
(A standard Linux terminal, (80 x 24/25 text mode only), white on back,&lt;br /&gt;
will only support 4 of these at the same time in one window.)&lt;br /&gt;
&lt;br /&gt;
There is/are lots of notes inside the code so be aware of these items...</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=98024#98024</comments>
                                        <author>Bazza</author>
                                        <pubDate>Sun Mar 27, 2011 12:56 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=98024#98024</guid>
                                      </item>
                                      <item>
                                        <title>Re: I would like some help please...</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=98014#98014</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=23984'&gt;bobthebob1234&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Mar 26, 2011 8:55 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I copy and pasted it, but cos I only have 2.6 python installed and it bombed out quite spectacularly so I didn't bother replying  &lt;img src=&quot;images/smiles/icon_sad.gif&quot; alt=&quot;Sad&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=98014#98014</comments>
                                        <author>bobthebob1234</author>
                                        <pubDate>Sat Mar 26, 2011 8:55 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=98014#98014</guid>
                                      </item>
                                      <item>
                                        <title>Re: I would like some help please...</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=98010#98010</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Mar 26, 2011 11:52 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Bazza wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;That went down like a lead balloon...&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Probably because you posted the code in tags, but no link to the script. Cutting and pasting while dealing with wrapping and indentation issues is just too much effort for some people.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=98010#98010</comments>
                                        <author>nelz</author>
                                        <pubDate>Sat Mar 26, 2011 11:52 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=98010#98010</guid>
                                      </item>
                                      <item>
                                        <title>Re: I would like some help please...</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=98005#98005</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=58561'&gt;Bazza&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Mar 26, 2011 9:36 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Oh well...&lt;br /&gt;
&lt;br /&gt;
That went down like a lead balloon...&lt;br /&gt;
&lt;br /&gt;
However the Python 2.6+ version has reached 2nd position with an&lt;br /&gt;
up-vote to 3 and I only uploaded it 7 days ago...&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://code.activestate.com/recipes/langs/python/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://code.activestate.com/recipes/langs/python/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So some people are interested...&lt;br /&gt;
&lt;br /&gt;
This site is cool for &amp;quot;giving&amp;quot; away your code snippets and defaults&lt;br /&gt;
to the MIT licen(c)(s)e, unless otherwise stated. Mine are nearly always&lt;br /&gt;
Public Domain...</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=98005#98005</comments>
                                        <author>Bazza</author>
                                        <pubDate>Sat Mar 26, 2011 9:36 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=98005#98005</guid>
                                      </item>
                                      <item>
                                        <title>I would like some help please...</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=97798#97798</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=58561'&gt;Bazza&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Mar 17, 2011 6:17 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi all...&lt;br /&gt;
&lt;br /&gt;
Can those of you who have Python 3.x installed do me a favour...&lt;br /&gt;
&lt;br /&gt;
The code below generates an analogue display in STANDARD&lt;br /&gt;
Python for Linux, in glorious technicolour.&lt;br /&gt;
&lt;br /&gt;
I will be using four of them simultaneously for a project I am doing...&lt;br /&gt;
&lt;br /&gt;
I would like any errors you get please, if any occur, and, your&lt;br /&gt;
opinions are also welcome, good or bad... &lt;img src=&quot;images/smiles/icon_smile.gif&quot; alt=&quot;Smile&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
It is for Linux, (*nix?). only and two commands must be available for&lt;br /&gt;
it to work, &amp;quot;clear&amp;quot; and &amp;quot;setterm&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
Read the code for more info...&lt;br /&gt;
&lt;br /&gt;
Watch for any wordwrapping etc...&lt;br /&gt;
&lt;br /&gt;
Thanks, to all who help, in advance...&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
# SevenBitBargraph3x.py&lt;br /&gt;
#&lt;br /&gt;
# A DEMO 7 bit analogue bargraph generator in colour for STANDARD Python 3.x and Linux...&lt;br /&gt;
#&lt;br /&gt;
# &amp;#40;Original copyright, &amp;#40;C&amp;#41;2010, B.Walker, G0LCU.&amp;#41;&lt;br /&gt;
# Issued initially to LXF as Public Domain, and to other sites later.&lt;br /&gt;
#&lt;br /&gt;
# Saved as SevenBitBargraph3x.py wherever you like.&lt;br /&gt;
#&lt;br /&gt;
# This DEMO goes from safe green, to warning amber, to danger red, with a crirical&lt;br /&gt;
# error beep above 120 on the horizontal scale...&lt;br /&gt;
#&lt;br /&gt;
# Two system commands are required, &amp;quot;clear&amp;quot; and &amp;quot;setterm&amp;quot;, for this to work.&lt;br /&gt;
# I assume that these are available on all recent and current Linux distros.&lt;br /&gt;
# The device /dev/audio is used so this must be free also. &lt;br /&gt;
#&lt;br /&gt;
# It is useful for quick glance readings from say an 8 bit ADC used as a simple&lt;br /&gt;
# voltmeter. Getting a digital readout is SO simple I left it out this time...&lt;br /&gt;
#&lt;br /&gt;
# To run use the following from inside a Python prompt...&lt;br /&gt;
# exec&amp;#40;open&amp;#40;&amp;quot;/full/path/to/code/SevenBitBargraph3x.py&amp;quot;&amp;#41;.read&amp;#40;&amp;#41;&amp;#41;&lt;br /&gt;
&lt;br /&gt;
# Add the required imports for this DEMO.&lt;br /&gt;
import os&lt;br /&gt;
import random&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def main&amp;#40;&amp;#41;&amp;#58;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;# For this DEMO set up variables as global...&lt;br /&gt;
&amp;nbsp; &amp;nbsp;global column&lt;br /&gt;
&amp;nbsp; &amp;nbsp;global count&lt;br /&gt;
&amp;nbsp; &amp;nbsp;global bargraph&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;column=0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;count=2&lt;br /&gt;
&amp;nbsp; &amp;nbsp;bargraph=&amp;quot;&amp;#40;C&amp;#41;2010, B.Walker, G0CLU.&amp;quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;# Disable the cursor as it looks much nicer... ;o&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;os.system&amp;#40;&amp;quot;setterm -cursor off&amp;quot;&amp;#41;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;while 1&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Do a full, clean, clear screen and start looping.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;os.system&amp;#40;&amp;quot;clear&amp;quot;&amp;#41;,chr&amp;#40;13&amp;#41;,&amp;quot;&amp;nbsp; &amp;quot;,chr&amp;#40;13&amp;#41;,&amp;#41;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Set to terminal default colour&amp;#40;s&amp;#41;.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;\033&amp;#91;0mSeven Bit Level Horizontal Analogue Bar Graph Display...&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;Original copyright, &amp;#40;C&amp;#41;2010, B.Walker, G0LCU.&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;Issued to LXF on 17-03-2011 as Public Domain.&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Set the bargraph to light green for this DEMO.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# This is equivalent to 0 for the column value.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;bargraph=&amp;quot;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; \033&amp;#91;1;32m|&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Generate a byte value as though grabbed from a serial, parallel or USB port.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;column=int&amp;#40;random.random&amp;#40;&amp;#41;*256&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Now divide by 2 to simulate a 7 bit value.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;column=int&amp;#40;column/2&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Although this should never occur, don't allow any error.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if column&amp;gt;=127&amp;#58; column=127&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if column&amp;lt;=0&amp;#58; column=0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Now to generate the bargraph...&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;count=0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;while count&amp;lt;=column&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# It is equivalent to BIOS character 222 for column value of 1 ONLY.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if count==1&amp;#58; bargraph=&amp;quot;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; \033&amp;#91;1;32m&amp;quot;+chr&amp;#40;0x2590&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;count=count+1&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if count&amp;gt;=2&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;while count&amp;lt;=column&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Change bargraph colour on the fly when entering the YELLOW zone... &amp;#58;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if count&amp;gt;=90&amp;#58; bargraph=bargraph+&amp;quot;\033&amp;#91;1;33m&amp;quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Change bargraph colour on the fly when entering the RED zone... &amp;#58;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if count&amp;gt;=100&amp;#58; bargraph=bargraph+&amp;quot;\033&amp;#91;1;31m&amp;quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if count%2==0&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# For every odd column value print this BIOS character 221.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;bargraph=bargraph+chr&amp;#40;0x258c&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if count%2==1&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# For every even column value OVERWRITE the above with BIOS character 219.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;bargraph=bargraph+&amp;quot;\b&amp;quot;+chr&amp;#40;0x2588&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;count=count+1&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Print the &amp;quot;scale&amp;quot; in the default colour&amp;#40;s&amp;#41;...&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;\033&amp;#91;0m&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp;20&amp;nbsp; &amp;nbsp;30&amp;nbsp; &amp;nbsp;40&amp;nbsp; &amp;nbsp;50&amp;nbsp; &amp;nbsp;60&amp;nbsp; &amp;nbsp;70&amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp;90&amp;nbsp; &amp;nbsp;100&amp;nbsp; 110&amp;nbsp; 120&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Now print the meter and bargraph in colours of your choice... &amp;#58;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;\033&amp;#91;1;32m&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; \033&amp;#91;1;33m|&amp;nbsp; &amp;nbsp; \033&amp;#91;1;31m|&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; |&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;\033&amp;#91;1;32m&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; +++++++++++++++++++++++++++++++++++++++++++++\033&amp;#91;1;33m+++++\033&amp;#91;1;31m+++++++++++++++&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;bargraph&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;\033&amp;#91;1;32m&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; +++++++++++++++++++++++++++++++++++++++++++++\033&amp;#91;1;33m+++++\033&amp;#91;1;31m+++++++++++++++&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;\033&amp;#91;1;34m&amp;nbsp; Analogue resolution is half of one division, that is 1.&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Return back to the default colours and for this DEMO the column value...&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;\033&amp;#91;0mColumn number&amp;quot;,column,&amp;quot;\b...&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;print&amp;#40;&amp;quot;Press Ctrl-C to stop...&amp;quot;&amp;#41;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Do a critical error beep, &amp;#91;sine wave&amp;#40;ish&amp;#41;&amp;#93; for about 1second.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if column&amp;gt;=120&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Set up the binary code as a crude sinewave.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;waveform=b&amp;quot;\x0f\x2d\x3f\x2d\x0f\x03\x00\x03&amp;quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Set audio timing to zero, &amp;quot;0&amp;quot;.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;count=0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Open up the audio device to write to.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# This could be /dev/dsp also...&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;audio=open&amp;#40;&amp;quot;/dev/audio&amp;quot;, &amp;quot;wb&amp;quot;&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# A &amp;quot;count&amp;quot; value of 1 = 1mS, so 1000 = 1S.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;while count&amp;lt;=1000&amp;#58;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Send 8 bytes of data to the audio device 1000 times.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# This is VERY close to 1KHz and almost sinewave.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;audio.write&amp;#40;waveform&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;count=count+1&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Close the audio device access.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;audio.close&amp;#40;&amp;#41;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;# Add a DEMO delay to simulate a simple digital voltmeter speed...&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if column&amp;lt;=119&amp;#58; time.sleep&amp;#40;1&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;# Enable the cursor again if it ever gets here... ;oO&lt;br /&gt;
&amp;nbsp; &amp;nbsp;os.system&amp;#40;&amp;quot;setterm -cursor on&amp;quot;&amp;#41;&lt;br /&gt;
main&amp;#40;&amp;#41;&lt;br /&gt;
&lt;br /&gt;
# DEMO end.&lt;br /&gt;
# Enjoy finding simple solutions to often very difficult problems...&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=97798#97798</comments>
                                        <author>Bazza</author>
                                        <pubDate>Thu Mar 17, 2011 6:17 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=97798#97798</guid>
                                      </item></channel></rss>