我是靠谱客的博主 留胡子小蝴蝶,这篇文章主要介绍arduino 操纵杆_【树莓派+arduino实验记录11 】操纵杆传感器,现在分享给大家,希望可以做个参考。

Arduino

/*******************************************************

* name:Joystick PS2

* function:push the joystick and the coordinates of X and Y axes displayed on Serial Monitor will change accordingly;

* press down the joystick, and the coordingly of Z=0 will also be displayed.

* connection:

* Joystick PS2 Arduino Uno R3

* GND GND

* VCC 5V

* SW 7

* x A0

* Y A1

* ******************************************************/

const int xPin = A0; //X attach to A0

const int yPin = A1; //Y attach to A1

const int btPin = 7; //Bt attach to digital 7

void setup()

{

pinMode(btPin, INPUT);

digitalWrite(btPin, HIGH);

Serial.begin(9600);

}

void loop()

{

Serial.print("X: "

最后

以上就是留胡子小蝴蝶最近收集整理的关于arduino 操纵杆_【树莓派+arduino实验记录11 】操纵杆传感器的全部内容,更多相关arduino内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(110)

评论列表共有 0 条评论

立即
投稿
返回
顶部