Making servos react automatically at high temperatures

Hi all,

I’m making an Arduino-controlled robotic arm (not the industrial kind, but a human-like one) for a project. It’s going to have 6 degrees of freedom. The idea is that I’ll eventually be able to control the arm by using two five-position switches to move the servos involved. I have the code I need to control the six servos I’m going to use. On top of that, I want to program the arm so that it pulls back automatically when the hand touches something hot. To get it to do that, I need to write a bit of code to make the shoulder servo move when a temperature sensor on the hand measures a temperature above a certain value. The part I don’t know how to do is make one part of the code (the automatic ‘pull back’ reaction when the temperature is too high) override another part of the code (the part that makes the servos move according to what I’m doing to the five-position switches).

Any ideas?

Somewhere in your code, you probably have a continuous loop that reads the switches, decides what to do about them, and performs the requested action.

One possible place for the “over temperature” conditional check is just prior to the switch reading operation. Before you read the switches, read the temperature. If the temperature is too high, execute pull-back and wait until the temperature drops to below the setpoint before resuming normal operation.

Thanks a lot! I’ll try that.