<jupyter_start><jupyter_text>Grove Relay module---  Aim* This notebook illustrates how to use available APIs for the Grove Relay module on PYNQ-Z2 PMOD and Arduino interfaces. References* [Grove Relay](https://www.seeedstudio.com/Grove-Relay.html)    * [PYNQ Grove Adapter](https://store.digilentinc.com/pynq-grove-system-add-on-board/)   * [Grove Base Shield V2.0](https://www.seeedstudio.com/Base-Shield-V2.html)    Last revised* 01 April 2021    + Initial version---  Load _base_ Overlay Note that we load the base bitstream only once to use Grove module with PYNQ Grove Adapter and SEEED Grove Base Shield V2.0Please make sure you run the following cell before running either of the interfaces<jupyter_code>from pynq.overlays.base import BaseOverlay
from pynq_peripherals import ArduinoSEEEDGroveAdapter, PmodGroveAdapter
base = BaseOverlay('base.bit')<jupyter_output><empty_output><jupyter_text>Using Grove Relay with Grove Base Shield V2.0 (Arduino)     Make Physical Connections     Insert the Grove Base Shield into the Arduino connector on the board. Connect the Grove Relay module to D6 connector of the Grove Base Shield.  Adapter configuration<jupyter_code>adapter = ArduinoSEEEDGroveAdapter(base.ARDUINO, D6='grove_relay')<jupyter_output><empty_output><jupyter_text>Define device object<jupyter_code>relay = adapter.D6<jupyter_output><empty_output><jupyter_text>Turn on the Grove Relay<jupyter_code>relay.on()<jupyter_output><empty_output><jupyter_text>Turn off the Grove Relay<jupyter_code>relay.off()<jupyter_output><empty_output><jupyter_text>--- Using Grove Relay with PYNQ Grove Adapter (PMOD)     Make Physical Connections     Connect the PYNQ Grove Adapter to PMODB connector.  Connect the Grove Relay module to the G1 connector of the Adapter.  Adapter configuration<jupyter_code>adapter = PmodGroveAdapter(base.PMODB, G1='grove_relay')<jupyter_output><empty_output><jupyter_text>Define device object<jupyter_code>relay = adapter.G1<jupyter_output><empty_output><jupyter_text>Turn on the Grove Relay<jupyter_code>relay.on()<jupyter_output><empty_output><jupyter_text>Turn off the Grove Relay<jupyter_code>relay.off()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.084910013844024, 'fraction_numerical': 0.009229349330872173, 'mean_word_length': 6.715302491103203, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '214065', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 777, 'n_tokens_neox': 719, 'n_words': 186, 'path': 'pynq_peripherals/modules/grove_relay/notebooks/grove_relay.ipynb', 'repo_name': 'npurusho/PYNQ_peripherals', 'size': '2167'}