Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ATX2.h> // ATX2 Board
- int ch1,ch2,ch3,ch4;
- int x,y,z,a,b;
- void setup() {
- XIO(); // ATX2 initialize
- setTextSize(2);
- pinMode(31, INPUT);
- pinMode(30, INPUT);
- pinMode(29, INPUT);
- pinMode(28, INPUT);
- }
- void loop() {
- ch1=pulseIn(31,HIGH,25000);
- ch2=pulseIn(30,HIGH,25000);
- ch3=pulseIn(29,HIGH,25000);
- ch4=pulseIn(28,HIGH,25000);
- /* glcd(0,0,"%d ",ch1);
- glcd(1,0,"%d ",ch2);
- glcd(2,0,"%d ",ch3);
- glcd(3,0,"%d ",ch4);*/
- x=map(ch1,1000,2000,-100,100);
- y=map(ch2,1000,2000,-50,50);
- FD2(x+y,x-y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement