概述
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 操纵杆_【树莓派+arduino实验记录11 】操纵杆传感器所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复