Project doesn't do what it supposed to

Hi,
I’m working on a project which needs to do this:
When I push a pushbutton, the servomotor turns 180 degrees. There’s a temperature sensor, if this sensor gets 2 degrees hotter, it makes the servomotor turn back 180 degrees to it’s zero position.

If I want to read the voltage it only says it begin state, it doesn’t change if i warm it up.

I hope you guys know if i made a mistake in my arduino script

Coffee_Machine.ino (1.02 KB)

JeroenZwier:
which needs to do this:

What does it actually do?

If I want to read the voltage it only says it begin state, it doesn’t change if i warm it up.

I don’t understand.

Please post your short program so we don’t have to download it. Use the code button </> so it looks like this

…R

Sounds like your temperature sensor is wired incorrectly.

Years ago, back in the days of the Z-80 when we were programming everything in assembly language, we developed a new instruction (although we could never get the manufacturer to implement it for us). It was the DWIM instruction (Do What I Mean). We also came up with another useful one too - HCF (Halt and Catch Fire). For some reason they would not implement that one either :confused:

:art:

@gpsmikey: Back in the 80's when PC's were still a little unusual, I had a guy call me because he heard I did contract programming. He told me that he had a project and was willing to pay $50/hr (huge back then) to write the program. He said: "I want you to write a program that picks those stocks that will go up in value by no less than 20% in the next quarter." I said: "Sound great! Send me the algorithm and I'll get right on it." His response: "No, that's your job." I tried to point out that, if I had that algorithm, I probably wouldn't need to mess around writing programs for $50/hr.

He still didn't get it.

gpsmikey: We also came up with another useful one too - HCF (Halt and Catch Fire). For some reason they would not implement that one either :confused:

I heard that it was implemented on certain boards, which would indeed overheat if you ran the wrong set of instructions.

econjack: @gpsmikey: Back in the 80's when PC's were still a little unusual, I had a guy call me because he heard I did contract programming. He told me that he had a project and was willing to pay $50/hr (huge back then) to write the program. He said: "I want you to write a program that picks those stocks that will go up in value by no less than 20% in the next quarter." I said: "Sound great! Send me the algorithm and I'll get right on it." His response: "No, that's your job." I tried to point out that, if I had that algorithm, I probably wouldn't need to mess around writing programs for $50/hr.

He still didn't get it.

Reminds me of the hardware gate design we wanted - we called it an "anticipatory gate" and it had a negative propagation delay so we could get the timing right (another of those things they didn't cover in school - real logic has delays in it and if you don't allow for that, strange things happen (especially with things like ripple counters))

gpsmikey:
we called it an “anticipatory gate” and it had a negative propagation delay

The below does compile…

void setup() {
  delay(-1000);
}

void loop() {
 }

gpsmikey: We also came up with another useful one too - HCF (Halt and Catch Fire).

Those were certainly the days!

Thankfully it was definitely implemented: https://en.wikipedia.org/wiki/Halt_and_Catch_Fire

Hey Nick - that was a cool link! Never seen that before (on the 8080 and Z-80, the HALT instruction was MOV M,M (move memory to memory). It was listed as HALT, but if you broke the octal instruction down it was mov m,m). Definitely going to have to file your link away - right up there with the AFDB