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
{% extends 'base.html' %} | |
{% block title %}Setting{% endblock %} | |
{% block head %} | |
{{ super() }} | |
<!--<style type="text/css"> | |
.important { color: #336699; } | |
</style> | |
--> | |
{% endblock %} |
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 socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(("WIFI ADDRESS", 5101)) | |
while(True): | |
# 접속할 서버의 ip주소와 포트번호를 입력. sock.send('Hello'.encode()) | |
inputdata=input() | |
sock.send(inputdata.encode()) # 내가 전송할 데이터를 보냄. | |
data=sock.recv(1024) | |
print(data.decode('utf-8')) |
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
#include <stm32f4xx.h> | |
//ALL the variables have been defined here | |
static int i = 0;int bit =0;int speed =0;int res =0; | |
// refernce and pid related constants | |
int ref_speed = 120;float duty =0;int iteration_time =0; | |
//errors variables |
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
#include <stdio.h> | |
#include <time.h> | |
#include <sys/time.h> | |
#include <unistd.h> | |
int main() { | |
struct timeval tv; | |
double begin, end; | |
// 시작하는 시간 받아오기 | |
gettimeofday(&tv, NULL); |
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
from flask import Flask, render_template_string | |
import time | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template_string('''<p>This is the current value: <span id="latest_value"></span></p> | |
<script> |
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 serial | |
from time import sleep | |
ser = serial.Serial ("/dev/ttyACM0", 9600) #Open port with baud rate | |
while True: | |
received_data = ser.read() #read serial port | |
sleep(0.03) | |
data_left = ser.inWaiting() #check for remaining byte | |
received_data += ser.read(data_left) |
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
#include <stdio.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
int system(const char *cmd){ | |
pid_t pid; | |
int status; | |
if((pid=fork())<0){ |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/wait.h> //waitpid() 함수를 위해 사용 | |
int main(int argc, char **argv){ | |
pid_t pid; | |
int pfd[2]; | |
char line[BUFSIZ]; // <stdio.h> 파일에 정의된 버퍼 크기로 결정 | |
int status; |
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
#include<stdio.h> | |
#include<wiringPi.h> | |
#define TRIG 21 // trig GPIO 5 | |
#define ECHO 22 // echo GPIO 6 | |
int main(void){ | |
long startTime; | |
long travelTime; | |
int distance=0; |