Exemple #1
0
from roco.api.component import Component
from roco.library import *

if __name__ == "__main__":
    c = Component(name="comp")
    c.add_subcomponent("sort", "sort_string")
    c.add_subcomponent("str", "string_source")
    c.add_connection(("str", "outStr"), ("sort", "inStr"))
    c.inherit_interface("out", ("sort", "outStr"))
    c.make_output()
Exemple #2
0
from roco.api.component import Component
from roco.library import *

if __name__ == "__main__":
    c = Component(name="comp")
    c.add_subcomponent("str", "string_source")
    c.add_subcomponent("rev", "reverse_string")
    c.add_connection(("str", "outStr"), ("rev", "inStr"))
    c.inherit_interface("out", ("rev", "outStr"))
    c.make_output()
Exemple #3
0
from roco.api.component import Component
from roco.library import *
from roco.library import get_component

if __name__ == "__main__":
    c = Component(name='DrivenServo')
    c.add_subcomponent('servo0', 'servo')
    c.add_subcomponent('servo_driver0', 'servo_driver')
    c.add_connection(('servo_driver0', 'eOut'), ('servo0', 'eIn'))
    c.inherit_interface('PWMin', ('servo_driver0', 'PWMin'))
    c.inherit_interface('inInt', ('servo_driver0', 'inInt'))
    c.to_yaml("library/DrivenServo.yaml")
Exemple #4
0
from roco.api.component import Component
from roco.library import *
from roco.library import get_component

if __name__ == "__main__":
    c = Component(name='GetSerialString')
    c.add_subcomponent('sIn', 'serial_in')
    c.add_subcomponent('s2s', 'serial_to_string')
    c.add_connection(('sIn', 'received'), ('s2s', 'received'))
    c.add_connection(('sIn', 'came'), ('s2s', 'came'))
    c.inherit_interface('out1', ('s2s', 'cameOut'))
    c.inherit_interface('out2', ('s2s', 'receivedString'))
    c.to_yaml("library/getSerialString.yaml")
Exemple #5
0
from roco.library.pot import Pot
from roco.api.component import Component
from roco.library.pot_driver import PotDriver

if __name__ == "__main__":
    c = Component(name = "DrivenPot")
    c.add_subcomponent("pot", "pot")
    c.add_subcomponent("dPot", "pot_driver")
    c.add_connection(("pot", "vOut"), ("dPot", "vIn"))
    c.inherit_interface("aOut", ("dPot", "aOut"))
    c.inherit_interface("outInt", ("dPot", "outInt"))
    c.make_output()