raspberrypi 4

라즈베리파이 5에 mqtt를 컴파일 할 때 추가하기

저번에 mqtt를 다운로드 했었는데(https://termuni.tistory.com/56)이걸 gcc로 컴파일 할 때 포함 되어있을 까? 라는 생각에 확인을 해보았다.pkg-config --modversion mosquitto 결과는..?Package mosquitto was not found in the pkg-config search path.ㅜㅜㅠㅠㅠㅠ 없다고 나온다... 그래서, 이걸 해결하는 겸 다음과 같은 문제들도 해결하려고 한다.VSCode로 코드 작성 시 mosquitto가 없다고 나오는 문제 해결gcc로 컴파일 시 자동으로 mosquitto를 포함하는 컴파일 명령 제작 (nano make를 통해 make 명령어를 만들 예정)1. VSCode로 코드 작성 시 mosquitto가 없다고 나..

Wiring Pi - PWM.c 분석

#include #include #include #include int main (void){ int bright ; printf ("Raspberry Pi wiringPi PWM test program\n") ; if (wiringPiSetup () == -1) exit (1) ; pinMode (1, PWM_OUTPUT) ; for (;;) { for (bright = 0 ; bright = 0 ; --bright) { pwmWrite (1, bright) ; delay (1) ; } } return 0 ;}해당 코드가 pwm의 예제 코드이며, 이 코드에서 다시 pinMode부터 분석해보려고 한다.주요 분석 코드로 pinMode, pwmWrite ..

Wiring Pi - ISR.c (인터럽트 서비스 루틴) 분석

이번에는 인터럽트 서비스 루틴에 대해서 분석해볼 예정이다. 뭐,,, 인터럽트에 대한 내용은 따로 CS 지식 정리 할 때 정리하겠다.  애초에, 인터럽트는 너무 흔한 개념이기도 하고 기본적으로 이게 궁금해서 온 사람은 모를리 없다는 것을 전제로 하여 진행할 것이기 때문!isr.c#include #include #include #include #include // globalCounter:// Global variable to count interrupts// Should be declared volatile to make sure the compiler doesn't cache it.static volatile int globalCounter [8] ;/* * myInterrupt: ************..

라즈베리파이를 C언어로 컨트롤하자 - 레지스터 직접 접근 방법 이해

https://elinux.org/RPi_GPIO_Code_Samples#Direct_register_access RPi GPIO Code Samples - eLinux.orgThe Raspberry Pi GPIOs can be controlled using many programming languages. C Examples in different C-Languages. Direct register access Gert van Loo & Dom, have provided some tested code which accesses the GPIO pins through direct GPIO register manipulationelinux.org이 페이지에서 참고하여 Direct Access를 하는 법을 ..