author

PeterH293

Inbox View Profile
8Comments

Tell us about yourself!

  • The Different Useless Machine

    Thank you. I agree it's a matter of style. My approach is to use local variables rather than global, wherever possible, but you have certainly simplified the loop.

    View Instructable »
  • The Different Useless Machine

    No, you are quite right. It was myself that was missing something (sorry, but bear in mind that I'm not in the position of having built the machine). It occurred to me in bed last night what was going to go wrong. Here is the amended code;void loop(){buttonAstatus = digitalRead(buttonApin);if (buttonAstatus != previous) // switch has changed{delay(1100);int whichWay = STEPS;if (previous == HIGH) whichWay = -whichWay;myStepper.step(whichWay);previous = buttonAstatus; // reset statusdigitalWrite(8, LOW); //for less power consumptiondigitalWrite(9, LOW);digitalWrite(10, LOW);digitalWrite(11, LOW);}}

    View Instructable »
  • The Different Useless Machine

    You have used a two-way switch where a simple on-off switch would do. In your sketch forget about buttonBpin: either the switch is at position A and that input pin is LOW or the switch is the other way and the input is HIGH. #include <Stepper.h>#define STEPS 2000Stepper myStepper(STEPS, 8, 9, 10, 11);int buttonApin = 4;bool buttonAstatus = LOW; // good programming practicebool previous = LOW; // to initialise variables on declarationvoid setup(){ myStepper.setSpeed(500); pinMode(buttonApin, INPUT_PULLUP);buttonAstatus = previous = digitalRead(buttonApin); }void loop(){ buttonAstatus = digitalRead(buttonApin);if (buttonAstatus != previous) // switch has changed { delay(1100); myStepper.step(STEPS);previous = buttonAstatus; // reset status digitalWrite(8, LOW)…

    see more »

    You have used a two-way switch where a simple on-off switch would do. In your sketch forget about buttonBpin: either the switch is at position A and that input pin is LOW or the switch is the other way and the input is HIGH. #include <Stepper.h>#define STEPS 2000Stepper myStepper(STEPS, 8, 9, 10, 11);int buttonApin = 4;bool buttonAstatus = LOW; // good programming practicebool previous = LOW; // to initialise variables on declarationvoid setup(){ myStepper.setSpeed(500); pinMode(buttonApin, INPUT_PULLUP);buttonAstatus = previous = digitalRead(buttonApin); }void loop(){ buttonAstatus = digitalRead(buttonApin);if (buttonAstatus != previous) // switch has changed { delay(1100); myStepper.step(STEPS);previous = buttonAstatus; // reset status digitalWrite(8, LOW); //for less power consumption digitalWrite(9, LOW); digitalWrite(10, LOW); digitalWrite(11, LOW); }}

    View Instructable »
  • Well done! But I don't know how you managed to find such large objective lenses.

    View Instructable »
  • It's good, but if the connector has a sheath then Step 1a is to slide the sheath onto the cable before embarking on Step 2

    View Instructable »
  • PeterH293 commented on tdonoclift's instructable Tiny Oak Ring Lamp

    The design is very pretty. If I were making it up from scratch, though, I would start with a 40mm chunk, say a cross-section of a branch. The boring of the hole for the lamp mount from underneath would be the first stage, followed by cutting out the space for the wiring connectors. That access space could later be closed off by a small plate which would be invisible when the lamp is stood on the table. The wires would still come out through a hole drilled in the back. The final stage of construction would be cutting the large hole around the bulb. The main virtue of this scheme is that everything remains accessible and repairable.

    View Instructable »
  • There's another important use for aspirin - as a contraceptive. Just tell the girl to hold the aspirin pill between her knees.

    View Instructable »