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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons"> | |
<link rel="stylesheet" href="styles/bootstrap-material-design.min.css"> | |
<link rel="stylesheet" href="styles/main.css"> | |
<title>Pi Simulator</title> |
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
rhit.CantStopGame = class { | |
static NUM_DICE = 3; // Hardcoded but easy to change if making a different game. | |
static MAX_FIRST_ROLL_VALUE = 3; // Hardcoded but easy to change | |
static RoundState = { | |
PLAYER_1_ACTIVE: "Player 1's Turn", | |
PLAYER_1_BUST: "Player 1 Bust!", | |
PLAYER_2_ACTIVE: "Player 2's Turn", | |
PLAYER_2_BUST: "Player 2 Bust!", | |
} |
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
var express = require("express"); | |
var app = express(); | |
app.use('/', express.static("public")); | |
app.use('/api/', express.json()); | |
let data = {}; | |
// let data = []; // or an empty array depending on the instructions for your specific exam | |
const fs = require("fs"); | |
const serverSideStorage = "../data/db.json"; |
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
""" | |
Authors: Dave Fisher and PUT_YOUR_NAME_HERE. | |
""" | |
# TODO: 1. Put your name in the above. | |
import time | |
import rosebot | |
def main(): |
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
""" | |
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 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 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 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.client as mqtt | |
class MqttClient(object): | |
"""Helper class to make it easier to work with MQTT subscriptions and publications.""" |
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
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 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() { |