Gcode for printer light fadeing



  • Hello everyone!
    I'm in love with rrf(duet) customization possibility.
    I would like make some macros to pulse or fade in-out led light of my printer .
    In my opinion it is good aesthetic status highlighter in case end of printing ,pause ..etc
    But I don't have enough skill in gcode to realize it by myself .
    I would be grateful for any help or information on the topic!



  • Now my gcode is :;Light fadeing.g
    M42 P4 S0.1
    G4 P200
    M42 P4 S0.2
    G4 P200
    M42 P4 S0.3
    G4 P200
    M42 P4 S0.4
    G4 P200
    M42 P4 S0.5
    G4 P200
    M42 P4 S0.6
    G4 P200
    M42 P4 S0.7
    G4 P200
    M42 P4 S0.8
    G4 P200
    M42 P4 S0.9
    G4 P200
    M42 P4 S1.0
    G4 P200
    M42 P4 S0.9
    G4 P200
    M42 P4 S0.8
    G4 P200
    M42 P4 S0.7
    G4 P200
    M42 P4 S0.6
    G4 P200
    M42 P4 S0.5
    G4 P200
    M42 P4 S0.4
    G4 P200
    M42 P4 S0.3
    G4 P200
    M42 P4 S0.2
    G4 P200
    M42 P4 S0.1
    G4 P200
    But light change is stepping end gcode looks ugly)


  • administrators

    if you are running RRF3, have you considered using a while-loop? Something like this (untested):

    while iterations <= 50
      M42 P4 S{0.02 * iterations}
      G4 P40
    


  • @dc42 said in Gcode for printer light fadeing:

    while iterations <= 50 M42 P4 S{0.02 * iterations} G4 P40

    Thanx a lot @dc42
    It is work!
    Thank you again for your job!



  • @dc42
    I tried to make an opposite action but without success
    examle:
    M42 P4 S{1.0 / iterations}
    G4 P40

    I would like to make it loop.
    I checked the gcode metadata commands ,but there is information for more advanced users than me.


  • administrators

    Try {1-0.02*iterations}


Log in to reply