File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
2+ #
3+ # SPDX-License-Identifier: MIT
4+
5+ import time
6+ import board
7+ from digitalio import DigitalInOut , Direction
8+
9+ # motor output
10+ solenoid = DigitalInOut (board .D5 )
11+ solenoid .direction = Direction .OUTPUT
12+
13+ while True :
14+ solenoid .value = False
15+ print ("The motor is not triggered." )
16+ time .sleep (1 )
17+ solenoid .value = True
18+ print ("The motor is triggered." )
19+ time .sleep (1 )
Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
2+ //
3+ // SPDX-License-Identifier: MIT
4+
5+ const int driverPin = 3 ;
6+
7+ void setup () {
8+ Serial.begin (115200 );
9+ Serial.println (" Basic MOSFET Driver Test" );
10+ pinMode (driverPin, OUTPUT);
11+ }
12+
13+ void loop () {
14+ digitalWrite (driverPin, HIGH);
15+ Serial.println (" The MOSFET driver is triggered." );
16+ delay (1000 );
17+ digitalWrite (driverPin, LOW);
18+ Serial.println (" The MOSFET driver is not triggered." );
19+ delay (1000 );
20+ }
You can’t perform that action at this time.
0 commit comments