ok im using 2.0 code and i wan to know what do i have to change in the code and what to change it to if im using input 4 instead of input 2? Im doing this because some solder filled a hole in input 2 and now i cant get the solder out so instead im using input 4. If anyone can help that would be great. Thank you for dealing with my questions.is this allpinMode(13,OUTPUT);//LED pinpinMode(6,OUTPUT); //Remove Before Fly grounddigitalWrite(6,LOW);pinMode(2,INPUT);//Servo input -----------------------------------------------herepinMode(3,INPUT);//Servo Input -----------------------------------------------------------or herepinMode(4,INPUT); //MUX pinpinMode(5,INPUT); //Mode pindigitalWrite(7, HIGH); //Remove Before Fly Pull Up resistorpinMode(7,INPUT); //Remove Before Fly input pinInit_servos();pulse_servos(0,0);i think here to right?byte Tx_Switch_Status(void) //Returns zero when we are in manual mode, returns 2 when autopilot mode 0, returns 3 when autopilot mode 1...{if(digitalRead(4)==HIGH){if(digitalRead(5)==HIGH)return 0x02; // WP modeelsereturn 0x03; // RTL mode}elsereturn 0x00;}

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    Hello,

    You need to make a soldering jumper from the atmega signal pin to channel mux4 pin. Many people already made this. Look the schematics.
  • 3D Robotics
    Two words: solder braid
  • Actually there would bee a lot more to it Input 4 doesn't go to the 328 just the MUX.
    It would be a lot easier to just fix you solder mishap. Just heat up the solder in the hole and push the pins thru.
    Careful you don't burn your fingers.
  • No your not even close. You are looking at the init_ardupilot function.That only runs once after a reset to set up inputs a,outputs ect. DO NOT mess with it at all. You could fry the board if you don't really know what you are doing (cousing two outputs to be connected). The part you want is at the end of the SERVO tab.

    int temp;
    static int ch;
    temp=pulseIn(2,HIGH, 2000);
    ch= (temp!=0) ? temp : ch;
    return (ch-rx_Ch[0]);

    You would change the 2 to a 4 in the third line.

    The proper thing to do would be to go to Radio Wack and buy a solder sucker. They are cheap and necessary for this kind of work. Don't mess with the code unless you really know what you are doing. I've been studying it for 3 months.
    I didn't know C when I began, but i do now.
This reply was deleted.

Activity

Joseph Udofia liked Joseph Udofia's profile
Wednesday
DIY Robocars via Twitter
Jan 28
DIY Robocars via Twitter
RT @Heavy02011: ⁦@diyrobocars⁩ : A Home-brew computer club* for Connected Autonomous Driving. talk at #piandmore ⁦@PiAndMore⁩ on Jan 23rd h…
Jan 23
DIY Robocars via Twitter
RT @a1k0n: New blog post! Deep dive into my ceiling light based localization algorithm which runs in 1ms on a Raspberry Pi 3: https://t.co/…
Jan 23
DIY Robocars via Twitter
Great new guide to using @donkey_car https://custom-build-robots.com/donkey-car-e-book-en
Jan 23
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars virtual AI race is tomorrow morn at 9:00am PT. You can watch live on Twitch https://www.meetup.com/DIYRobocars/events/275268196/
Jan 22
DIY Robocars via Twitter
New version of Intel OpenBot! This resolves many of the issues with the first version, including a much smoother tr… https://twitter.com/i/web/status/1352395636369313798
Jan 21
DIY Drones via Twitter
Using ArduRover with an RTK GPS https://ift.tt/2N9I3RO
Jan 18
DIY Drones via Twitter
Jan 18
DIY Robocars via Twitter
Jan 18
DIY Robocars via Twitter
Jan 15
DIY Robocars via Twitter
Jan 15
DIY Drones via Twitter
Jan 14
DIY Robocars via Twitter
RT @Heavy02011: @diyrobocars : A Home-brew computer club* for Connected Autonomous Driving on Jan 23rd, 2021 https://www.meetup.com/Connected-Autonomous-Driving/events/275728684/ #Meetu…
Jan 14
DIY Robocars via Twitter
Jan 14
DIY Robocars via Twitter
RT @Heavy02011: ⁦@diyrobocars⁩ Autonomous Driving Assembly at #rC3. join us at https://rc3.world/rc3/assembly/diyrobocars-f1tenth/ ⁦@f1tenth⁩ ⁦@DAVGtech⁩ ⁦@DWalmroth⁩…
Jan 11
More…