embeded/rpi pico2025. 10. 4. 18:23

아두이노에 라즈베리 파이 피코용 보드 확장 설치하는법 까먹어서 다시 검색.. 크흡

[링크 : https://blog.naver.com/cimygy/222559519256]

 

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

[링크 : https://github.com/earlephilhower/arduino-pico]

Posted by 구차니

아래 소스를 참고하고

[링크  : https://github.com/geeooff/forza-data-web/blob/main/Console/ForzaDataConsole.cs]

 

원본 포맷도 참고해서

[링크 : https://support.forzamotorsport.net/hc/en-us/articles/21742934024211-Forza-Motorsport-Data-Out-Documentation]

 

몇가지 단위 수정함

영국놈들(!) 이라서 출력이 watt가 아니라 hp(horse power)로 되어있고

속도고 mph를 기본으로 던져주고

온도고 섭씨가 아니라 화씨.. 어우

[링크 : https://github.com/minimonk82/forza_horizon_4_telemetry]

 

아무튼.. 서보를 이용해서 서스펜션 길이를 가지고 장난질 치면 조금 수월하게 작업할수 있으려나?

라즈베리 파이 pico로 시리얼로 서스펜션 길이만 전송하고

pwm 4개 채널로 서보 제어해서 적당하게 맞춰봐야겠다.

Posted by 구차니
카테고리 없음2025. 10. 2. 15:39

중앙의 뚜껑있는 놈이 stm32L 과 sx1276 통합 모듈, 왼쪽은 stlink 인듯.

 

The B-L072Z-LRWAN1 LoRa®/Sigfox™ Discovery kit is a development tool to learn and develop solutions based on LoRa®, Sigfox™, and FSK/OOK technologies. This Discovery kit features the all-in-one CMWX1ZZABZ-091 open module by Murata. The module is powered by an STM32L072CZ microcontroller and SX1276 transceiver. The transceiver features the LoRa® long-range modem, providing ultra-long-range spread-spectrum communication and high interference immunity, minimizing current consumption. Since CMWX1ZZABZ-091 is an open module, the user has access to all STM32L072CZ peripherals such as ADC, 16-bit timer, LP-UART, I2C, SPI, and USB 2.0 FS (supporting BCD and LPM).

[링크 : https://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html]

 

 

[링크 : https://www.murata.com/en-global/products/connectivitymodule/lpwa/overview/lineup/type-abz-091]

 

FSK (Frequency Shift Keying)
OOK (On-Off Keying)

[링크 : https://blog.naver.com/bruno_annie/220777474513]

 

 

 

 

 

[258199.737417] usb 1-2: new full-speed USB device number 31 using xhci_hcd
[258199.866439] usb 1-2: New USB device found, idVendor=0483, idProduct=374b, bcdDevice= 1.00
[258199.866457] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[258199.866464] usb 1-2: Product: STM32 STLink
[258199.866470] usb 1-2: Manufacturer: STMicroelectronics
[258199.866475] usb 1-2: SerialNumber: 066BFF363637503457160939
[258199.927997] usb-storage 1-2:1.1: USB Mass Storage device detected
[258199.928972] scsi host0: usb-storage 1-2:1.1
[258199.930589] cdc_acm 1-2:1.2: ttyACM0: USB ACM device
[258200.938237] scsi 0:0:0:0: Direct-Access     MBED     microcontroller  1.0  PQ: 0 ANSI: 2
[258200.939003] sd 0:0:0:0: Attached scsi generic sg0 type 0
[258200.940836] sd 0:0:0:0: [sda] 456 512-byte logical blocks: (233 kB/228 KiB)
[258200.941073] sd 0:0:0:0: [sda] Write Protect is off
[258200.941080] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[258200.941299] sd 0:0:0:0: [sda] No Caching mode page found
[258200.941312] sd 0:0:0:0: [sda] Assuming drive cache: write through
[258200.963802] sd 0:0:0:0: [sda] Attached SCSI removable disk

 

[링크 : https://os.mbed.com/platforms/ST-Discovery-LRWAN1/]

[링크 : https://os.mbed.com/teams/ST/code/DISCO-L072CZ-LRWAN1_LoRa_PingPong/]

Posted by 구차니
Programming/golang2025. 10. 2. 10:54

'Programming > golang' 카테고리의 다른 글

golang git commit hash  (0) 2025.11.24
golang 정적웹 파일 포함하기  (0) 2025.11.24
golang 윈도우 서비스 프로그램 작성하기  (0) 2025.02.18
golang tcp socket timeout 주기(listen, read)  (0) 2024.04.08
golang reflect  (0) 2024.02.20
Posted by 구차니

내부 ui에서 출력되는 것과 비교중

tirewear 등은 안 맞는것 같고

suspension도 딱 맞지 않는 느낌.

 

아래는 그냥 nc로 엔터쳐서 아무값도 안가 오류난 건데 아무튼..

타이어/서스펜션은 앞-좌/우 , 뒤-좌/우 라서 두 줄에 우겨넣어 출력함

 

[링크 : https://github.com/minimonk82/forza_horizon_4_telemetry]

Posted by 구차니

부터 묘하게 긁히는 일들이 발생하네

후...

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

비 그리고 차  (0) 2025.10.13
내일은 월요일  (0) 2025.10.12
멘탈 크래시 크래시  (0) 2025.09.18
복리 / 단리  (0) 2025.09.17
외근  (0) 2025.09.09
Posted by 구차니
프로그램 사용/ncurses2025. 9. 30. 20:18

nc나 make menuconfig 처럼 실행시 혹은 동적으로 창 크기나 비율을 어떻게 조절하나 궁금해짐

 

Name
getyx, getparyx, getbegyx, getmaxyx - get curses cursor and window coordinates

Synopsis
#include <curses.h>

void getyx(WINDOW *win, int y, int x);
void getparyx(WINDOW *win, int y, int x);
void getbegyx(WINDOW *win, int y, int x);
void getmaxyx(WINDOW *win, int y, int x);

[링크 : https://linux.die.net/man/3/getmaxyx]

[링크 : https://stackoverflow.com/questions/1811955/ncurses-terminal-size]

'프로그램 사용 > ncurses' 카테고리의 다른 글

ncurses 상자 및 색상 적용하기  (0) 2024.12.02
ncurses 예제  (0) 2024.11.30
ncurse example  (0) 2022.05.17
ncurse  (0) 2015.04.27
Posted by 구차니
하드웨어/Display 장비2025. 9. 29. 22:52

상태 안 좋은거 무료로 나눔 받았는데 작동 자체는 문제가 없는 것 같다.

그런데 HDMI로 소리가 안되나? 장치 자체에는 분명 스피커가 있는데 왜 안되는걸까..

[링크 : https://dlpworld.jpg3.kr/pjmania/catalogue/sk_smartbeam_manual.pdf]

[링크 : https://prod.danawa.com/info/?pcode=1924494]

 

cu 편의점택배 선불로 보내주셨다.

 

상태가 좋진 않은데 보내주실때 안켜지는것 같다고 해서 일단 분해하고 땜질해보려고 시도!

 

뒷면도 원래는 스피커 고정하는 먼가가 있어야 하는데 사라졌다.

 

그 와중에 스피커 끊어먹고 땜질 -_ㅠ

 

micro HDMI에 micro USB.

전원 버튼도 사라져서 손톱으로 눌리지 않는다.

 

인증번호로 찾은 모델명 IC200T

요즘은 보기 힘든어진 MHL

 

켜면 로고 이후에 깔끔한 디자인의 연결 아이콘이 뜬다.

 

대충 60cm 거리에 15인치 급?

해상도는 640x480으로 뜨는데 HDMI 사운드로 잡히지 않는다. 머가 문제지?

 

대충 1미터에 32인치 급?

 

전원을 누르면 깔끔한 아이콘과 함께 good bye~

'하드웨어 > Display 장비' 카테고리의 다른 글

lg pw700 지름 + 3d  (4) 2025.10.26
benq mp780st 마운트  (0) 2025.10.19
3d dlp 120Hz가 왜 망했냐면..  (0) 2023.08.27
benq part 3.. HDMI 720p120  (0) 2023.08.21
3d 영상을 리눅스에서 재생하기  (0) 2023.08.20
Posted by 구차니

def main() 이 없으니까

독립적으로 실행중인지, import 되어 다른데서 실행을 하는건지 알 필요가 있을때

아래의 문구를 통해서 실행하거나 라이브러리로 작동시키거나 할 수 있다.

if __name__ == "__main__":
    print("run!")

 

[링크 : https://dev-jy.tistory.com/14]

Posted by 구차니

gpt와 검색을 버무려서~

 

pip로 대~~~충 flask 설치하고

Flask 에 static_url_path와 static_folder 를 설정해서 정적으로 서빙할 경로를 지정한다.

template_folder는 template engine를 위한 경로 같긴한데, 지금은 그걸 하려는게 아니니 패스~ 하고

 

/ 로 요청이 들어오면 index.html을 던지도록 라우터 하나 설정하고

나머지는 자동으로 static 경로 하위에서 제공

그리고 /api 쪽은 별도로 라우터 지정해서 2개의 api를 생성해준다.

 

/app.py

from flask import Flask, jsonify, render_template

app = Flask(__name__,
            static_url_path='', 
            static_folder='static',
            template_folder='templates')

@app.route('/')
def serve_index():
    return app.send_static_file('index.html')

# REST API 라우트
@app.route('/api/hello')
def api_hello():
    return jsonify({"message": "Hello, this is a REST API response!"})

# 또 다른 REST API
@app.route('/api/sum/<int:a>/<int:b>')
def api_sum(a, b):
    return jsonify({"a": a, "b": b, "sum": a + b})


if __name__ == "__main__":
    # 디버그 모드 실행
    app.run(debug=True)

 

/static/index.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Flask Static + REST API</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
    <h1>Hello Flask</h1>
    <p>이 페이지는 Flask가 제공하는 정적 웹입니다.</p>

    <button onclick="callApi()">API 호출</button>
    <p id="result"></p>

    <script>
        async function callApi() {
            const res = await fetch("/api/hello");
            const data = await res.json();
            document.getElementById("result").innerText = data.message;
        }
    </script>
</body>
</html>

 

/static/test.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Flask Static + REST API</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
    <h1>this is test</h1>
</body>
</html>

 

/static/style.css

body {
    font-family: sans-serif;
    background: #f0f0f0;
    padding: 20px;
}
h1 {
    color: darkblue;
}

 

[링크 : https://stackoverflow.com/questions/20646822/how-to-serve-static-files-in-flask]

 

 

$ python3 app.py
 * Serving Flask app 'app'
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 997-788-229

 

웹에서 접속하면 아래처럼 뜨는데

보니 template 엔진을 이용해서 치환하도록 해놨어서 css가 안 읽혔군

127.0.0.1 - - [29/Sep/2025 10:48:26] "GET / HTTP/1.1" 304 -
127.0.0.1 - - [29/Sep/2025 10:48:26] "GET /{{%20url_for('static',%20filename='style.css')%20}} HTTP/1.1" 404 -

 

그럼 template 안쓸꺼니 수정해보자

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Flask Static + REST API</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1>Hello Flask</h1>
    <p>이 페이지는 Flask가 제공하는 정적 웹입니다.</p>

    <button onclick="callApi()">API 호출</button>
    <p id="result"></p>

    <script>
        async function callApi() {
            const res = await fetch("/api/hello");
            const data = await res.json();
            document.getElementById("result").innerText = data.message;
        }
    </script>
</body>
</html>

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Flask Static + REST API</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1>this is test</h1>
</body>
</html>

 

이쁘게 잘나온다. 그런데 처음 접속하면 static web이라도 제법 느린데 캐싱이 안되나?

 

localhost:5000/

localhost:5000/index.html

localhost:5000/test.html

localhost:5000/api/hello

localhost:5000/api/sum/2/3

'Programming > python(파이썬)' 카테고리의 다른 글

python switch-case -> match-case  (0) 2025.10.11
python __name__  (0) 2025.09.29
python simsimd  (0) 2025.08.28
python 원하는 버전 설치 및 연결하기  (0) 2025.08.26
pip 패키지 완전 삭제하기  (0) 2025.08.13
Posted by 구차니