projectlim 2024. 10. 18. 10:48
728x90
반응형
SMALL

AGV핀맵 찾기

https://docs.elephantrobotics.com/docs/myagv_pi23_en/2-ProductFeature/2.4-ElectricalCharacteristicParameter.html

 

2.4 Electrical Characteristic Parameter · GitBook

No results matching ""

docs.elephantrobotics.com

핀맵은

import serial

# ttyS0에 연결
ser = serial.Serial('/dev/ttyS0', baudrate=9600, timeout=1)

# 데이터 전송
ser.write(b'Hello from Raspberry Pi!\\n')

# 데이터 수신
while True:
    if ser.in_waiting > 0:
        data = ser.readline()
        print(f"Received: {data.decode('utf-8').strip()}")

ser.close()
import serial
import time
import RPi.GPIO as GPIO

# GPIO 핀 번호 설정
TX = 17
RX = 27

# 시리얼 포트 설정
ser = serial.Serial('/dev/ttyS0', 9600)

time.sleep(2)  # 아두이노 초기화 시간 대기

try:
    while True:
        user_input = input("Enter a message to send to Arduino: ")
        ser.write((user_input + '\\n').encode('utf-8'))  # 아두이노로 데이터 전송
        print(f"Data sent: {user_input}")
        time.sleep(1)  # 1초 대기

        if ser.in_waiting > 0:
            data = ser.readline().decode('utf-8').strip()  # 아두이노로부터 데이터 읽기
            print(f"Received from Arduino: {data}")
        else:
            print("No data received from Arduino")
except KeyboardInterrupt:
    ser.close()

이렇게 했는데 이게 안됐음!!

S0 일때

 

 

아두이노 7,8

https://medialink.tistory.com/157

 

라즈베리파이에서 UART 사용

UART 사용하기 UART 방식의 통신이 여전히 임베디드에서 사용되고 있습니다. 참으로 오래된 통신 방식이고 단점도 있지만 매우 간단하고 편리하면서 값싸게 구현이 가능하게 때문이겠죠. 물론 관

medialink.tistory.com

 

여기 테스트 해보기

https://armyost.tistory.com/350

 

라즈베리파이-시리얼통신 오픈하기

※ 해당 포스트를 작성하는데 있어 아래 링크를 많이 참고하였습니다. https://blog.naver.com/PostView.nhn?blogId=emperonics&logNo=222039301356 라즈베리파이 시리얼 통신(RaspberryPi Uart Communication) 라즈베리파이

armyost.tistory.com

 

여기도

https://velog.io/@kanggihoo/Raspberry-Pi-통신

 

[Raspberry Pi] 통신

라즈베리파이 UART 통신 관련 이론

velog.io

 

uart를 맞추기

1순위로 이거 먼저 해보기!!!

=⇒ 그 예전에 했던 코드 중에 되는거 찾아서 바로 해보자…

https://jackpang.tistory.com/21

 

라즈베리파이 3B+ 4B 아두이노 시리얼통신 (UART - Tx, Rx 핀 사용)

++ 아두이노 코드와 파이코드 시험 끝나면 추가하겠슴당 이 글은 http://leaqua.mulple.com/?p=607 아두이노와 라즈베리 파이의 UART(serial) 통신 라즈베리파이와 아두이노 사이의 통신에는 SPI, I2C , UART 등

jackpang.tistory.com

 

이거 확인!!!

아두이노 시리얼 통신이 이미 노트북으로 연결했기때문에

softwareSerial로 rxtx를 다시 설정해줘야함.

2,3으로 바꾼다음에 해보면 그때 data 연결됐던 코드가 아마 될거임.

PLC 232 rxtx통신

https://fortex66.tistory.com/2

 

PLC - Python 시리얼 통신 1

PC에서 파이썬으로 PLC를 제어하여 하드웨어 기계제어를 하고 PLC로부터 데이터를 가져오고 보내는 프로그램을 만들어 보겠습니다. 우선 PLC와 시리얼 통신이 무엇인지 간단히 알아보겠습니다. (

fortex66.tistory.com


git으로 관리 했으면 좋았겠지만~~ 하루종일 했던걸


블로그에 담아 봤습니다~

728x90
반응형
LIST