WHAT IS ARDUINO An opensource electronics platform based


WHAT IS ARDUINO? An open-source electronics platform based on easy-to-use hardware and software. 官方网站:https: //www. arduino. cc/ 2

简单、便宜 本次实验所用的 Arduino uno 实物 图。可以看出做 相当精致,而 且布局整洁易用, 就像usb设备一样 方便。 Arduino UNO R 2 电路原理图 http: //phylab. fudan. edu. cn/lib/exe/fetch. php? media=yuandi: ardui no: arduino-uno-schematic. pdf 3






if(ps 2 x. Button(PSB_PAD_LEFT)){ value 1+=1; if(value 1>=180) { value 1=180; } myservo 1. write(value 1); Serial. print("LEFT held this hard: "); } 利用if语句、servo类实现按键控制舵机 转动的语句 9


void Left_Motor. Run() { digital. Write(IN 1, HIGH); digital. Write(IN 2, LOW); Serial. print("car Lrun!"); } 这段代码能让左边两个轮子向 前转动 11

if(ps 2 x. Analog(PSS_LY)>=0 && ps 2 x. Analog(PSS_LY)<100) { Left_Motor. Run(); Serial. print("car Lrun!"); } 向前摇动左摇杆会运行左 车轮前进的语句 12

手柄控制的实现 ß ß 1、PS 2库* 2、蓝牙信号接收器 *由开源社区贡献,社区相关帖子: http: //bbs. elecfans. com/forum. php? mod=viewthread&tid=455271&extra =page%3 D 1%26 filter%3 Dtypeid%26 typeid%3 D 903 13

Q&A & THANK YOU ! 14
- Slides: 14