File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed 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
+ #define driverPin 3
6
+
7
+ void setup () {
8
+ while (!Serial);
9
+ delay (1000 );
10
+ Serial.begin (115200 );
11
+ Serial.println (" Basic MOSFET Driver Test" );
12
+ pinMode (driverPin, OUTPUT);
13
+ }
14
+
15
+ void loop () {
16
+
17
+ digitalWrite (driverPin, HIGH);
18
+ Serial.println (" The MOSFET driver is triggered." );
19
+ delay (1000 );
20
+ digitalWrite (driverPin, LOW);
21
+ Serial.println (" The MOSFET driver is not triggered." );
22
+ delay (1000 );
23
+ }
You can’t perform that action at this time.
0 commit comments