Skip to content

tailyn/board-lib-rdf022

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API of Board RDF022

Usage

Download this repository and put rdf022.py along with your_prog.py, just like sample.py.

LCM

To show messages on the LCM, simply assign them to lcm.messages before lcm.refresh().

import rdf022


msgs = ('Hello', 'World')

lcm = rdf022.get_lcm()
lcm.messages = msgs
lcm.refresh()

Output:

Hello
World

N.B.

  • get_lcm().messages should be an iterable object and contains only 2 items.

  • get_lcm() returns an instance of Singleton, so lcm_1 and lcm_2 in the following block are the same:

lcm_1 = rdf022.get_lcm()
lcm_2 = rdf022.get_lcm()
  • The library is multiple-access safed, in case you have a multithreaded process.

Brightness control

To show messages on the LCM, simply assign them to lcm.messages before lcm.refresh().

import rdf022
import time

lcm = rdf022.get_lcm()

def sparkle():
    while True:
        for i in range(lcm.brightness_depth):
            lcm.decrease_brightness()
            time.sleep(0.1)
        for i in range(lcm.brightness_depth):
            lcm.increase_brightness()
            time.sleep(0.1)

import threading
threading.Thread(target=sparkle).start()

N.B.

  • decrease_brightness() should be decrease brightness slowly.

  • increase_brightness should be increase brightness slowly.

  • The library is multiple-access safed, in case you have a multithreaded process.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages