Dual boot firmware

Hi, I'm building a dual mode machine, 3d Printer and pick and place machine. I'm writing my own firmware for pick and place, so I added the files in the repetier firmware folder, and added a conditional at the very begin of the program:
void setup()
  pinMode(machineStartPin,INPUT);
  machineMode = analogRead(machineStartPin);//this call mess up future adc readings...
 
  if(machineMode == 0){
    Printer::setup();}
    else{
    PickAndPlace::setup();}
}

as you can see in the comment, that call to analogRead will mess up the readings in printer mode, resulting in thermistors not connected for the heated bed and extruder.
If I remove that line, the printer works fine.
Any ideas?

Comments

  • Why do you use analog at all? I assume it is a switch, so digitalRead is all you need.
  • You are right, I wanted to use existing headers on the Radds board without adding pullup resistors, I will try to use digital pin and see what happens
    Thanks!
Sign In or Register to comment.