wokwi-features icon indicating copy to clipboard operation
wokwi-features copied to clipboard

wokwi-dip-switch-8 attributes for setting switches

Open drf5n opened this issue 2 years ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe. I'd like to be able to set a dip switch to a specific setting. In specific, I want to put a DIP switch in front of a logic analyzer to have optional signals show up in the files, but I also want a couple important signals to be on by default.

Describe the solution you'd like A clear and concise description of what you want to happen.

https://docs.wokwi.com/parts/wokwi-slide-switch uses attribute "value" in {"","1} to set the position of the switch https://docs.wokwi.com/parts/wokwi-slide-potentiometer and https://docs.wokwi.com/parts/wokwi-potentiometer use attribute "value" in ["0" ..."1023"] to set the position of the pot

The https://docs.wokwi.com/parts/wokwi-dip-switch-8 doesn't currently list any attributes.

I would like a set of attributes like the value attribute at https://docs.wokwi.com/parts/wokwi-slide-switch#attributes but individual for each pin.

For example:

{ "type": "wokwi-dip-switch-8", 
   "id": "sw1", 
   "top": 8.81, 
   "left": 181.2, 
    "attrs": {"value": "1,0,1,0,1,0,1,0"} 
},

// or

{ "type": "wokwi-dip-switch-8", 
   "id": "sw1", 
   "top": 8.81, 
   "left": 181.2, 
    "attrs": {
      "value1": "1",   ( with "" by default like slide-switch, or "0" as the opposite of "1")
      "value2": "" ,
      "value3": "1", 
      "value4": "", 
      "value5": "1", 
      "value6": "", 
      "value7": "1", 
      "value8": "" 
   }
}

drf5n avatar Mar 20 '23 03:03 drf5n