Skip to content

Instantly share code, notes, and snippets.

View HavishNetla's full-sized avatar
💻
coding

Havish Netla HavishNetla

💻
coding
View GitHub Profile
package org.firstinspires.ftc.teamcode.Teleop;
import com.qualcomm.ftccommon.configuration.RobotConfigFile;
import com.qualcomm.hardware.adafruit.AdafruitBNO055IMU;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.robot.Robot;
import com.qualcomm.robotcore.util.ElapsedTime;
import com.qualcomm.robotcore.util.Range;
import React, { Component } from 'react'
import request from 'superagent'
import Grid from '@material-ui/core/Grid'
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import Typography from '@material-ui/core/Typography'
import Button from '@material-ui/core/Button'
import DeleteIcon from '@material-ui/icons/Delete'
import Layout from '../components/Layout'
import Delete from '../components/DeleteCard'
// BASE SETUP
// =============================================================================
// call the packages we need
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const morgan = require('morgan')
import React, { Component } from 'react'
import request from 'superagent'
import Grid from '@material-ui/core/Grid'
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import Typography from '@material-ui/core/Typography'
import Button from '@material-ui/core/Button'
import DeleteIcon from '@material-ui/icons/Delete'
import Layout from '../components/Layout'
/* eslint-disable class-methods-use-this */
/* eslint-disable no-return-assign */
import React, { Component } from 'react'
import request from 'superagent'
import Grid from '@material-ui/core/Grid'
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import Typography from '@material-ui/core/Typography'
import Button from '@material-ui/core/Button'
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 8221
MESSAGE = "Hello, World!"
print ("UDP target IP:" + "127.0.0.1")
print ("UDP target port:" + "8221")
print ("message:" + MESSAGE)
import socket
from contextlib import closing
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)
import socket
import time
from contextlib import closing
HOST = '192.168.1.171' # The server's hostname or IP address
PORT = 65432 # The port used by the server
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
print("conectiong")
print( s.connect_ex((HOST, PORT)))
#!/usr/bin/env python
import socket
import ast
from contextlib import closing
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server
#a = LargeMotor(OUTPUT_A)
import socket
from contextlib import closing
import time
import threading
import numpy
from inputs import get_gamepad
HOST = "192.168.1.184" # Standard loopback interface address (localhost)
PORT = 65432 # Port to listen on (non-privileged ports are > 1023)