-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ellery Newcomer
committed
Apr 25, 2018
1 parent
5d8edaa
commit 19247db
Showing
4 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from robotpy_installer.installer import SshController | ||
|
||
ssh = SshController('10.32.23.6', 'pi', 'raspberry', allow_mitm=True) | ||
ssh = SshController('10.32.23.6', 'pi', 'pypi', allow_mitm=True) | ||
ssh.ssh("mkdir -p /home/pi/squiggly") | ||
ssh.ssh("rm -rf /home/pi/squiggly/*") | ||
ssh.sftp('./src', '/home/pi/squiggly') | ||
ssh.sftp('./src', '/home/pi/squiggly') | ||
ssh.ssh("sudo /etc/init.d/lightshow restart") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from threading import Thread | ||
|
||
from commands.example import BlinkyCommand, OtherBlinkyCommand | ||
from controller import Controller | ||
from subsystems import LEDSubsystem | ||
from networktables import NetworkTables | ||
|
||
|
||
import logging | ||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
class MyController(Controller): | ||
def __init__(self): | ||
super().__init__() | ||
NetworkTables.initialize("10.32.23.10") | ||
self.table = NetworkTables.getTable("LEDS") | ||
self.table.addEntryListener(self.valueChanged) | ||
self.leds = LEDSubsystem() | ||
|
||
self.leds.setDefaultCommand(BlinkyCommand()) | ||
|
||
def shutdown(self): | ||
self.leds.clearStrip() | ||
|
||
|
||
def valueChanged(self, table, key, value, isNew): | ||
if key == 'nacho': | ||
OtherBlinkyCommand().start() | ||
|
||
|
||
|
||
controller = MyController() | ||
controller.start() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
from networktables import NetworkTables | ||
import time | ||
|
||
import logging | ||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
NetworkTables.initialize() | ||
|
||
|
||
while True: | ||
time.sleep(1) | ||
time.sleep(1) |