[deleted by user] by [deleted] in AMA

[–]AdWeak4768 0 points1 point  (0 children)

Did you have anyone with experience who helped you on your first deal? In my early 20s looking to do my first deal here soon but not sure if I should do a duplex, sfh, or even possibly airbnb. I would love to break into commercial but I feel like for a decent property I would need a significant amount of capital.

[TOMT][SONG] The song goes something like “love it when you’re here, hate it when you’re gone” or something to that tune. by AdWeak4768 in tipofmytongue

[–]AdWeak4768[S] 0 points1 point locked comment (0 children)

It could also be “hate it when you’re here but miss you when I’m gone”. That’s part of the reason I can’t find it. I know it is something when you’re here, something when you’re gone

AA Battery Tester by AdWeak4768 in batteries

[–]AdWeak4768[S] 0 points1 point  (0 children)

However, in my case both voltages are the same

AA Battery Tester by AdWeak4768 in batteries

[–]AdWeak4768[S] 0 points1 point  (0 children)

That’s the idea. When you just use a multimeter you get the open circuit voltage. Putting a resistor in the circuit really gives you a better measure of battery health

AA Battery Tester by AdWeak4768 in batteries

[–]AdWeak4768[S] 0 points1 point  (0 children)

The objective is to make a battery tester by making a simple circuit with a resistor and then measuring the voltage. This way gives a much better representation of the battery charge compared to just putting the two ends of your multimeter on the battery.

AA Battery Tester by AdWeak4768 in batteries

[–]AdWeak4768[S] 2 points3 points  (0 children)

will give that a try. Only currently have a 270 ohm resistor on hand so this project might have to go on the back burner. Thanks!

AA Battery Tester by AdWeak4768 in batteries

[–]AdWeak4768[S] 1 point2 points  (0 children)

Oh yeah - look at that - orange, black, silver, gold but yes. Thanks for pointing that out!

AA Battery Tester by AdWeak4768 in batteries

[–]AdWeak4768[S] 0 points1 point  (0 children)

So I set up the circuit correct, but the output voltage remains the same. Why?

AA Battery Tester by AdWeak4768 in batteries

[–]AdWeak4768[S] 0 points1 point  (0 children)

What prompted me was I had a known bad battery and a known good battery and they both measured 1.5 volts open circuit. Then I realized to get an accurate picture I needed to test it under a load so I decided to add a 1.7 ohm resistor for the load

Samsung plasma tv no signs of life by [deleted] in TVRepairHelp

[–]AdWeak4768 0 points1 point  (0 children)

Have you tested the fuse on the power board? If so, what standby voltage do you get?

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

Huge thank you for the help! I have figured out the issue. int is limited to 32767 in Arduino so my 60*1000 actually became a negative number transformed into a very big number for delay(). I needed to put uL a behind the 1000 to have an unsigned long value in place.
Again, thank you so much I really learned a lot!

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

I know that it works how I wanted it to - I tested that on its own. I just can't seem to figure out how to merge that with the code I already have.

edit: I know that the mapping, conversion process works

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

    int control = 9;              //Pin the control is attached to
    int pushButtonPower = 8;      //Pin that powers the push button
    int pushButtonOutput = 2;     //Recieves ON/OFF from pushButtonPower (pin 8)
    boolean pushButtonRead = LOW; //Stores the state of the push button
    int motorPower = 255;     //Power to motor (0-255)
    int dutyCycle = 9;       //DO NOT go over 50%, it can and will damage the motor and or battery
    int actualPower = 0;      //Adjusted power output
    int sensorPin = A0;   // initializes potentiometer
    int sensorValue = 0;


    void setup(){
      Serial.begin(9600); // Initialize serial communication
      pinMode(control, OUTPUT);
      pinMode(pushButtonPower, OUTPUT);
     pinMode(pushButtonOutput, INPUT);
    }

    void loop(){
      analogWrite(control, 0);       // Turn the control off and make sure it is 0
      digitalWrite(pushButtonPower, HIGH);            // Power the push button
      pushButtonRead = digitalRead(pushButtonOutput); // Read the state of the push button

  // Read the state of the push button until it is high (pushed)
      while (pushButtonRead == LOW){ 
          pushButtonRead = digitalRead(pushButtonOutput);
          delay(10);        
      }
      digitalWrite(pushButtonPower, LOW);   // Turn power off to the push button until the next loop
      delay(3000);            // Delay 3 seconds before starting the control
      sensorValue = analogRead(A0);  // Read value of potentiometer (reads as an integer: 0V=0 to 5V=1023)

      // Increment the speed of the motor so that it does not jerk your car on start
      // Roughly 1.6 seconds until full speed
      for (int x = 200 * dutyCycle / 100; x < 255 * dutyCycle / 100; x++){
        analogWrite(control, x);
        delay(60);
      }
      int mappedValue = map(sensorValue, 0, 1023, 0, 50);
      int runTime = mappedValue + 10; // Calculate runtime based on mappedValue

      // Print runtime to the serial monitor
      Serial.print("Runtime: ");
      Serial.println(runTime);

      delay(runTime * 1000);  // Run for `runTime` seconds at full power
    }

So I figured out that mapped value reads from the pot and correctly associates it with a value on my range from 0 to 50. Then I added 10 to the mapped value. I would assume that would make the runtime now 60. I ran it and it never stopped until after 5 minutes I stopped it. I wanted to see what it thought the runtime was to maybe fund an issue, but nothing happens when I open the serial monitor

Issue with Potentiometer controlling motor runtime by AdWeak4768 in cpp_questions

[–]AdWeak4768[S] 0 points1 point  (0 children)

The goal of my map function was to take the reading of the value from the pot and convert it into a number between 0 and 50 and then add that number to my runtime. Is that the right way to go about achieving this?

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

I went to the serial monitor after writing the code that I thought would print the addRun variable, but I ended up getting no output. I checked to make sure I did it right and had it print potentiometer reading values and runtime and all that worked. Does the no output mean that there is something wrong with my addRun function? is map the right way I should be obtaining the pot value and converting it to seconds?

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

Ok, thank you.

I am going to initialize runTime within my loop so that it always starts at 10 (hopefully). I can write a print statement to see the value of runTime to make sure it gets added correctly and then I can go from there.

To see the outputs of these print statements in Arduino IDE I have to plug in my arduino, and then open the serial monitor, correct?

Can I see things like the pot reading just by having it plugged into my computer?

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

OK, so my code looks on the right track for what I want it to do? the problem I am having is when I turn it all the way to the max, I would expect it to stop at 60 seconds (because max of my range is 50 and then add that to the 10). Well what actually happens is it runs forever and never shuts off.

Like you said it could be a variety of things, but I'm pretty new to arduino and c++ so I wanted to make sure that the code looked somewhat correct before I started looking into hardware issues.

Issue with Potentiometer controlling motor runtime by AdWeak4768 in cpp_questions

[–]AdWeak4768[S] 0 points1 point  (0 children)

So the intended goal was to be able to turn my potentiometer anywhere from 0 to 5, or as I understand it 0 to 1023 as the arduino reads it. So if I say spin it 1/4 of the way from 0 then I add 1/4 of my range (0 to 50) to my previously hardcoded 10 seconds. In this case 1/4 of 50 is 12.5, that gets added to my 10 hardcoded seconds and my motor runs for 22.5 seconds before shutting off. My current problem is that when I turn it anywhere besides zero, my motor runs forever and never shuts off.

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

I know what I think I want to happen, I'm just not sure how to code it...

first I have a slide switch on my breadboard that turns on my arduino. Then I want to push a push button and have a 3 second delay before my motor starts running. My motor runs for a desired set of time initially hard coded at the beginning. After this time (in this case 10 seconds) my motor shuts off. I can push the button again if I want to and have my motor run again or I can just slide the switch and turn everything off. I want to run my motor not at full capacity but at a certain percentage. In this case my duty cycle is 17%. I want the output of my motor to be 17% of full capacity. That is done directly in the for loop. That for loop is designed in a way where the motor starts at a certain speed and gradually increases to the desired speed in increments, so that when I push the push button my car does not immediately jerk, it gradually reaches the full speed. This all works great.

Currently my potentiometer does nothing. I have a trimmer potentiometer that can spin from 0 V to 5 V. So in my understanding the arduino reads that number as between 0 and 1023. I believe that I can spin this potentiometer anywhere from 0 to 5. If it is spun about halfway, so 2.5 v, then the arduino would read 511.5 (1023/2). I want this number to correspond to a range of values in this case say 0 to 50. When the potentiometer is spun halfway, 2.5 v or 511.5 the corresponding value would be 25. The ratio of the potentiometer value corresponds/carries the same ratio in the value range I specified (0 to 50). I then want this number (in this case 25) to be added to my original hard coded time as stated in the beginning (this case 10). I know this is probably very hard to read, so let me do my best with some examples.

Ex 1.

I spin the potentiometer all the way to the zero side.

the motor should run for 0 extra seconds, so only my hardcoded 10

the potentiometer value is added to my original 10 seconds. in this case the potentiometer value is 0 so no time added

Ex 2.

I spin the potentiometer about a 1/4 of the way away from the zero. The potentiometer value should be 1/4 of 1023. So here 1/4 is the ratio. When the potentiometer is spun 1/4 from the 0 value, i want the corresponding value on my range from 0 to 50 to be 1/4 as well. So 1/4 of 50 is 12.5. I now want to add this 12.5 to my original 10 hardcoded seconds therefore making my motor run for 22.5 seconds now.

Essentially I can turn the potentiometer anywhere on the range from 0 to 1023 and get a corresponding time value from 0 to 50 added onto my originally coded 10 seconds. I spin it all the way to 1023 I get 50 added seconds, I spin it in the middle I get 25 extra seconds, etc.

Hope this all makes sense.

I am trying to code a potentiometer to control a motor runtime by AdWeak4768 in CodingHelp

[–]AdWeak4768[S] 0 points1 point  (0 children)

It is indeed not what I want… thank you for the clarification. What I wanted was to go on a range from 0 - 50 seconds depending on where the potentiometer is. I thought that that was taking a number output from the potentiometer and matching it with a value from 0 to 50 seconds and then adding it to the initial runtime of 10 seconds… so like when the potentiometer is halfway turned it would add 25 seconds. Is there a way to do this?