+++
title= "Raspberry:Wiringpi的安裝及使用"
description= "Wiringpi的安裝及使用"
date= 2022-05-04T14:01:09+08:00
author= "chao"
draft= false
image= ""
math= true
categories= [
"os"
]
tags= [
" raspberry"
]
+++
WiringPi
安裝
WiringPi
官網介紹擷取
-
WiringPi is a PIN based GPIO access library written in C for the BCM2835, BCM2836 and BCM2837 SoC devices used in all Raspberry Pi. versions. The source code is not publicly available but may be made available to those who wish commercial support.
-
It’s designed to be familiar to people who have used the Arduino “wiring” system1 and is intended for use by experienced C/C++ programmers. It is not a newbie learning tool.
-
WiringPi is developed directly on a Raspberry Pi running 32-bit Raspbian.I do not support any other platform, cross compiling or operating systems.
Raspberry Pi | Wiring | Download & Install | Wiring Pi
note:如果官網地址打不開,直接下載github中的下載包
install
wget https://github.com/WiringPi/WiringPi/archive/refs/tags/2.61-1.tar.gz
tar zxvf 2.61-1.tar.gz
cd WiringPi-2.61-1/
./build
OK
test
gpio -v
gpio readall
wiringpi API
參考部落格
樹莓派wiringPi庫詳解 - lulipro - 部落格園 (cnblogs.com)
樹莓派WiringPi常用函式中文手冊-Arduino中文社群 - Powered by Discuz!
樹莓派 wiringPi 庫_~莘莘的部落格-程式設計師寶寶_wiringpi - 程式設計師寶寶 (cxybb.com)
//Core wiringPi functions
extern struct wiringPiNodeStruct *wiringPiFindNode (int pin) ;
extern struct wiringPiNodeStruct *wiringPiNewNode (int pinBase, int numPins) ;
extern void wiringPiVersion (int *major, int *minor) ;
extern int wiringPiSetup (void) ;
extern int wiringPiSetupSys (void) ;
extern int wiringPiSetupGpio (void) ;
extern int wiringPiSetupPhys (void) ;
extern void pinModeAlt (int pin, int mode) ;
extern void pinMode (int pin, int mode) ;
extern void pullUpDnControl (int pin, int pud) ;
extern int digitalRead (int pin) ;
extern void digitalWrite (int pin, int value) ;
extern unsigned int digitalRead8 (int pin) ;
extern void digitalWrite8 (int pin, int value) ;
extern void pwmWrite (int pin, int value) ;
extern int analogRead (int pin) ;
extern void analogWrite (int pin, int value) ;