Skip to content

Instantly share code, notes, and snippets.

@Bill-Park
Bill-Park / lidar_test.py
Last active October 23, 2021 15:34
ydlidar x4 테스트 코드입니다. 출처 : https://blog.naver.com/post_human/221988090871
import time
import serial
import math
from math import atan,pi,floor
import matplotlib.pyplot as plt
def plot_lidar(distdict):
x =[0 for i in range(360)]
y =[0 for i in range(360)]
for angle in range(0,360):
@Bill-Park
Bill-Park / kvim3_linux.dts
Created November 9, 2020 12:22
dts 파일, I2S disabled
/dts-v1/;
/ {
model = "Khadas VIM3";
amlogic-dt-id = "g12b_kvim3";
compatible = "amlogic, g12b";
interrupt-parent = <0x1>;
#address-cells = <0x2>;
#size-cells = <0x2>;
@Bill-Park
Bill-Park / rpstutorial.ipynb
Last active February 28, 2020 06:54
rpsTutorial.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO_DIR1 = 23
GPIO_PWM1 = 24
GPIO_DIR2 = 27
GPIO_PWM2 = 22
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
servoPin = 18
GPIO.setup(servoPin, GPIO.OUT)
p = GPIO.PWM(servoPin, 50) # set to 50Hz
import cv2
import numpy as np
import math
cap = cv2.VideoCapture(0)
size_x = 640
size_y = 480
cap.set(cv2.CAP_PROP_FRAME_WIDTH, size_x)
import os
import sys
import requests
import json
tts_text = "안녕하세요 네이버"
client_id = "id"
client_secret = "secret"
import pyaudio
import wave
import audioop
import math
import os
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
import requests
import json
api_key = "dd40631e0b2c53fdc84e1dffd1da95f6"
url = "http://api.openweathermap.org/data/2.5/weather?q=Seoul&appid={key}".format(key=api_key)
def main() :
res = requests.get(url)
res_json = json.loads(res.text)
temperature = round(res_json["main"]["temp"] - 273, 1)
humidity = round(res_json["main"]["humidity"])
@Bill-Park
Bill-Park / lambda_basic_template.py
Created January 3, 2019 16:03
alexa custom skill lambda basic template
"""
This is a Python template for Alexa to get you building skills (conversations) quickly.
"""
from __future__ import print_function
# --------------- Helpers that build all of the responses ----------------------
def build_speechlet_response(title, output, reprompt_text, should_end_session):