Jump to content
Electronics-Lab.com Community

HarryA

Members
  • Posts

    451
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by HarryA

  1. I am not sure what you need but here is code that fades a LED up and down. It does not block your code by using Delay(), You can paste it into your Loop{} or call it as a function. You may wish to play with the int period value and the +/-5 value. Do note which i/o pins you can use with this PWM code.

    //use pins 3, 5, 6, 9, 10, and 11 on the UNO
    const int ledPin = 3; //whichevery pin you choose Do not forget the resistor!
    int period =   10; //how fast to fade the LED:100 = 1/10 sec. etc
    unsigned long time_now = 0; //have not read the time yet
    int brightness = 0;  //start with LED off
    boolean IncreaseBrightness = true; //start with increasing brightness
    
     void setup() 
     {
     
      pinMode(ledPin, OUTPUT);
      Serial.begin(9600); //you may have this; used here for testing
     }
    
    void loop()
     {
      // non-blocking delay 
      if(millis() > time_now + period)  //get current time and compare
      {
         time_now = millis(); //for next time
        //fade LED up or down
        if(IncreaseBrightness) 
        {
          analogWrite(ledPin, brightness +=5 );
          if(brightness >= 255) IncreaseBrightness = false; //max ouput to LED = 255
    	  }
        else   //must be decreasing brightness
        {
           analogWrite(ledPin, brightness -=5 );
    	     if(brightness <= 0 ) IncreaseBrightness = true; //min ouput to LED = 0
        }
       }
        //some code...testing displays values.....
        Serial.print("brightness "); Serial.println(brightness);
     }  

     

     

  2. What you need is a notch filter to remove only a narrow band of unwanted  frequencies . There are pedal notch filters on the market but they are pricey. Search on "guitar notch filter pedal".

    Also see::  https://lambdageeks.com/notch-filter/#:~:text=A notch filter%2C also known as a frequency,while allowing other frequencies to pass through unaffected.

    About half way down the page he covers guitar pedals.

    If you wish to make one perhaps I could help you with it.

     

  3. When a post is made the forum software often displays key technical words in the post description. This would suggest that one could use that software to detect post that are legitimate from others. Of course the the devil is in the details. Invision's Zendesk maybe open to support on something like this as it would also be to their benefit.  When I had a forum (Simple Machine's software) I spent a lot of time mutilating the software to get what I wanted.

  4. If it interest you, I could program the micro-controller for you.  That would give you an introduction to micro-controllers. The micro-controller is about 21$, a LCD  about 13$, You would need a 9 volt battery, a battery connector, a battery to micro_controller connector, and a switch also.

    An assortment of colored wire would be helpful. Plus a plastic or metal box to pack it all into.

    If you are checking your cables near a computer you could uses the computer as a simple display device instead of the LCD.

    LCD : https://www.amazon.com/SunFounder-Serial-Module-Arduino-Mega2560/dp/B01GPUMP9C/ref=sr_1_1_sspa?adgrpid=1335907194272933

    Micro-controller: https://www.amazon.com/ELEGOO-ATmega2560-ATMEGA16U2-Arduino-Compliant/dp/B01H4ZDYCE/ref=sr_1_2_sspa?crid=1L06F0IP302BX&keywords=Arduino+R3+Mega2560&qid=1684882151

    wire: https://www.amazon.com/TUOFENG-Hookup-Wires-6-Different-Colored/dp/B07TX6BX47/ref=sr_1_3?keywords=colored+wire+spool&link_code=qs&qid=1684885902&sourceid=Mozilla-search&sr=8-3

     

×
  • Create New...