Exemplo n.º 1
0
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program.  If not, see <http://www.gnu.org/licenses/>.


from fnordlib import FnordBus
from time import sleep


PORT = "/dev/ttyUSB0"


# public static void main ;-)

bus = FnordBus(PORT)

bus.sync()
bus.stop()

#bus.fade_rgb2(255, 255, 255, 255)

print("Program running...")

try:
    for x in range(1000):
        
        value = (x * 20) % 256
        bus.fade_rgb(255, value, value, value)
        
        sleep(1)
Exemplo n.º 2
0
        body += ""
        body += ""
        
        body += "</BODY></HTML>"
            
        return body

# public static void main ;-)    

if len(sys.argv) < 2:
    print("Usage: %s <server>" % sys.argv[0])
    sys.exit(-1)
    
server_type = sys.argv[1]

bus = FnordBus(BUS_PORT, False)
helper = FnordHelper()

fader = []

fire_fader = FnordFader()
fire_fader.addColor( (0, 0, 80) )
fire_fader.addColor( (255, 80, 0) )
fire_fader.setDelay(0)
fire_fader.setStep(10)

cool_fader = FnordFader()
cool_fader.addColor( (0, 255, 160) )
cool_fader.addColor( (0, 135, 0) )
cool_fader.setDelay(1)
cool_fader.setStep(1)