-
Couldn't load subscription status.
- Fork 791
Fruit_Jam_Logic_Gates: wire update and new connectors #3147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
While working on the pylint errors, I noticed that the save/load wasn't quite working for connectors and I had to update the json data. The following is an updated logic_gates_8.json file: {"entities": [{"location": [6, 7], "connector_number": 1, "class": "ConnectorOut"}, {"location": [10, 4], "inputs_left": false, "class": "NeoPixelOutput"}, {"location": [9, 5], "connector_number": 0, "class": "ConnectorIn"}, {"location": [4, 6], "inputs_left": true, "class": "NandGate"}, {"location": [3, 6], "connector_number": 0, "class": "ConnectorIn"}, {"location": [3, 8], "class": "NotGate"}, {"location": [2, 8], "index": 1, "class": "PhysicalButton"}, {"location": [4, 3], "inputs_left": true, "class": "NandGate"}, {"location": [6, 4], "connector_number": 0, "class": "ConnectorOut"}, {"location": [3, 5], "connector_number": 1, "class": "ConnectorIn"}, {"location": [3, 3], "class": "NotGate"}, {"location": [2, 3], "index": 0, "class": "PhysicalButton"}]} |
|
Here's another fun Flip Flop, it's a D type so the LED is controlled by button 1, but only changes when button 3 is held down. Another way to describe the function is that the value of button 1 is "toggled" onto the LED when button 3 is pressed. {"entities": [{"location": [3, 2], "class": "NotGate"}, {"location": [2, 2], "state": 5, "class": "Wire"}, {"location": [2, 3], "state": 4, "class": "Wire"}, {"location": [4, 2], "inputs_left": true, "class": "AndGate"}, {"location": [6, 3], "inputs_left": true, "class": "NorGate"}, {"location": [6, 6], "inputs_left": true, "class": "NorGate"}, {"location": [4, 7], "inputs_left": true, "class": "AndGate"}, {"location": [8, 4], "connector_number": 0, "class": "ConnectorOut"}, {"location": [8, 7], "connector_number": 1, "class": "ConnectorOut"}, {"location": [5, 5], "connector_number": 1, "class": "ConnectorIn"}, {"location": [5, 6], "connector_number": 0, "class": "ConnectorIn"}, {"location": [3, 3], "connector_number": 2, "class": "ConnectorOut"}, {"location": [3, 9], "connector_number": 2, "class": "ConnectorIn"}, {"location": [3, 5], "connector_number": 3, "class": "ConnectorOut"}, {"location": [3, 4], "connector_number": 3, "class": "ConnectorIn"}, {"location": [3, 7], "connector_number": 3, "class": "ConnectorIn"}, {"location": [11, 2], "inputs_left": false, "class": "NeoPixelOutput"}, {"location": [10, 3], "connector_number": 0, "class": "ConnectorIn"}, {"location": [1, 3], "index": 0, "class": "PhysicalButton"}, {"location": [2, 5], "index": 2, "class": "PhysicalButton"}]} |
|
I've been having lots of fun working on this and assuming you like the direction I've been going and this PR gets merged, I thought the next thing I'd like to do is extend the wire tap (place a ConnectorOut near a vertical line and it creates a graphical connection to the wire) to other devices that can get input from a nearby wire like output panels, neopixels and gates (I'm not sure about vertical taps though, maybe 2 input gates and neopixels will only infer signals from wires to the left and require an actual wire connection from the vertical directions). I also thought it could be fun to add a square wave source so you could blink the neopixel. I'm not sure the performance of the simulator is sufficient but a clock signal is useful in a lot of digital circuits as well. Edit: I was also thinking a workspace zoom (zoom out really) would be nice as well 😁 |
|
Here's a 10 input {"entities": [{"location": [2, 0], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 1], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 2], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 3], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 4], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 5], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 6], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 7], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 8], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [2, 9], "pressed_state": false, "class": "VirtualPushButton"}, {"location": [3, 0], "state": 0, "class": "Wire"}, {"location": [3, 1], "connector_number": 0, "class": "ConnectorOut"}, {"location": [3, 2], "state": 0, "class": "Wire"}, {"location": [3, 3], "state": 0, "class": "Wire"}, {"location": [3, 4], "connector_number": 1, "class": "ConnectorOut"}, {"location": [3, 5], "state": 0, "class": "Wire"}, {"location": [3, 6], "state": 0, "class": "Wire"}, {"location": [3, 7], "connector_number": 2, "class": "ConnectorOut"}, {"location": [3, 8], "state": 0, "class": "Wire"}, {"location": [3, 9], "state": 0, "class": "Wire"}, {"location": [4, 0], "inputs_left": true, "class": "OrGate"}, {"location": [4, 3], "inputs_left": true, "class": "OrGate"}, {"location": [4, 6], "inputs_left": true, "class": "OrGate"}, {"location": [4, 9], "state": 0, "class": "Wire"}, {"location": [5, 9], "state": 0, "class": "Wire"}, {"location": [6, 7], "inputs_left": true, "class": "OrGate"}, {"location": [6, 1], "state": 4, "class": "Wire"}, {"location": [5, 2], "connector_number": 0, "class": "ConnectorIn"}, {"location": [6, 0], "state": 5, "class": "Wire"}, {"location": [7, 0], "state": 0, "class": "Wire"}, {"location": [6, 2], "inputs_left": true, "class": "OrGate"}, {"location": [7, 2], "connector_number": 2, "class": "ConnectorIn"}, {"location": [8, 0], "inputs_left": true, "class": "OrGate"}, {"location": [8, 3], "state": 3, "class": "Wire"}, {"location": [8, 8], "state": 4, "class": "Wire"}, {"location": [8, 7], "state": 1, "class": "Wire"}, {"location": [9, 7], "connector_number": 1, "class": "ConnectorIn"}, {"location": [10, 5], "inputs_left": true, "class": "OrGate"}, {"location": [9, 3], "connector_number": 3, "class": "ConnectorIn"}, {"location": [10, 1], "inputs_left": true, "class": "OrGate"}, {"location": [12, 6], "connector_number": 3, "class": "ConnectorOut"}, {"location": [12, 2], "class": "OutputPanel"}, {"location": [8, 4], "inputs_left": false, "class": "OrGate"}]}While I was first playing around with this circuit I noticed an issue with the or gate in the center. There's one or gate that uses the |
|
@RetiredWizard This sounds awesome, I'm stoked that you're enjoying working on it, and appreciate the improvements. I'll test them out this week but it may be later on in the week after I get a bigger chunk of my current project completed. |
This update to the Logic_Gates project does several things:
The json below is a saved S/R flip flop that uses Connectors, physical buttons and the Neopixel. Pressing button 1 will turn on the neopixel which will remain lit after the button is released, until button 2 is pressed which then turns the neopixel off.
logic_gates_8.json
{"entities": [{"location": [3, 2], "inputs_left": true, "class": "NandGate"}, {"location": [3, 5], "inputs_left": true, "class": "NandGate"}, {"location": [2, 4], "class": "ConnectorIn"}, {"location": [2, 5], "class": "ConnectorIn"}, {"location": [5, 3], "class": "ConnectorOut"}, {"location": [5, 6], "class": "ConnectorOut"}, {"location": [1, 2], "index": 0, "class": "PhysicalButton"}, {"location": [2, 2], "class": "NotGate"}, {"location": [2, 7], "class": "NotGate"}, {"location": [1, 7], "index": 1, "class": "PhysicalButton"}, {"location": [9, 3], "inputs_left": false, "class": "NeoPixelOutput"}, {"location": [8, 3], "class": "ConnectorIn"}]}Edit: By the way, I found the easiest way to get the json files to the CPSAVES drive is to just copy them to CIRCUITPY and then use PyDOS to
copy /logic_gates_8.json /saves(PyDOS has write access to CPSAVES even if it's running without write access to CIRCUITPY).