This file contains hidden or 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
| """ | |
| Authors: Dave Fisher and PUT_YOUR_NAME_HERE. | |
| """ | |
| # TODO: 1. Put your name in the above. | |
| import time | |
| import rosebot | |
| def main(): | |
| """ Test a robot's SERVOS. """ |
This file contains hidden or 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
| import mqtt_helper | |
| import time | |
| class TankReceiver: | |
| def __init__(self): | |
| self.mqtt_client = mqtt_helper.MqttClient() | |
| self.mqtt_client.callback = self.mqtt_callback | |
| self.mqtt_client.connect( | |
| mqtt_broker_ip_address="broker.hivemq.com", |
This file contains hidden or 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
| function jsonMQTTTest | |
| clc | |
| fprintf("Connecting...\n"); | |
| mqttClient = mqtt('tcp://broker.hivemq.com') | |
| subscribe(mqttClient,'fisherds',"Callback",@myCallback); | |
| for k = 60:20:100 | |
| currentMessage = sprintf('{"type": "motor/go", "payload": [%d, %d]}', k, k); | |
| publish(mqttClient, 'fisherds', currentMessage); | |
| pause(1); |
This file contains hidden or 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
| """ | |
| Library for making MQTT easier to use. | |
| """ | |
| import json | |
| import paho.mqtt | |
| import paho.mqtt.client as mqtt | |
| class MqttClient(object): | |
| """Helper class to make it easier to work with MQTT subscriptions and publications.""" |
This file contains hidden or 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
| const rosebot = require("./rosebot"); | |
| const prompt = require('prompt-sync')({sigint: true}); | |
| function main() { | |
| console.log('--------------------------------------------------') | |
| console.log('Testing the SERVO classes of a robot') | |
| console.log('--------------------------------------------------') | |
| robot = new rosebot.RoseBot(); | |
| // Allow the I2C module an opportunity to finish initialization. |
This file contains hidden or 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
| var i2cBus = require("i2c-bus"); | |
| var Pca9685Driver = require("pca9685").Pca9685Driver; | |
| const SERVO_PIN_CAMERA_TILT = 11; | |
| const SERVO_PIN_ARM_JOINT_1 = 12; | |
| const SERVO_PIN_ARM_JOINT_2 = 13; | |
| const SERVO_PIN_ARM_JOINT_3 = 14; | |
| const SERVO_PIN_GRIPPER = 15; | |
| function createPca9685Driver() { |
This file contains hidden or 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
| .page-container { | |
| margin-top: 75px; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| } | |
| #sliderContainer { | |
| margin: 10px; |
This file contains hidden or 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
| <div id="sliderContainer"> | |
| <input type="range" min="0" max="255" value="127" class="slider" id="baseSpeed"> | |
| </div> | |
| <div id="driveGrid"> | |
| <button type="button" data-left-multiplier="0.5" data-right-multiplier="1.0" class="driveButton btn btn-block btn-outline-primary"> | |
| <i class="material-icons">undo</i> | |
| </button> | |
| <button type="button" data-left-multiplier="1.0" data-right-multiplier="1.0" class="driveButton btn btn-block btn-outline-primary"> | |
| <i class="material-icons">arrow_upward</i> | |
| </button> |
This file contains hidden or 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
| const prompt = require('prompt-sync')({sigint: true}); | |
| // # ------------------------------------------------------------------------- | |
| // # TODO: import rosebot | |
| // const rosebot = require("./rosebot"); | |
| // # ------------------------------------------------------------------------- | |
| function msleep(n) { | |
| Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n); | |
| } | |
| function sleep(n) { |
This file contains hidden or 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
| var rhit = rhit || {}; | |
| rhit.WaterParkController = class { | |
| constructor() { | |
| const startingTicketsInput = document.querySelector("#startingTicketsInput"); | |
| const updateBtn = document.querySelector("#updateButton"); | |
| const btn1 = document.querySelector("#option1Button"); | |
| const btn2 = document.querySelector("#option2Button"); | |
| const btn3 = document.querySelector("#option3Button"); | |
| const btn4 = document.querySelector("#option4Button"); |