Menu

#define

Help
2020-05-27
2020-05-28
  • stan cartwright

    stan cartwright - 2020-05-27
     

    Last edit: stan cartwright 2020-05-27
  • Chris Roper

    Chris Roper - 2020-05-28

    For situations like that you need a macro

    Macro lmotfwd
    portc.0 = on
    portc.1 = off
    End Macro

     
  • stan cartwright

    stan cartwright - 2020-05-28

    I just forgot to use set. I ereased the post asap when I realised.
    What is the difference to a macro ie prog mem ?

    #define lmotfwd set portc.0 off : set portc.1 on
    #define lmotrev set portc.0 on : set portc.1 off
    #define lmotstop set portc.0 off : set portc.1 off
    #define rmotfwd set portc.2 off : set portc.3 on
    #define rmotrev set portc.2 on : set portc.3 off
    #define rmotstop set portc.2 off : set portc.3 off
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.