File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 1
- import board
2
- import busio
3
1
import time
4
2
import random
3
+ import board
5
4
from digitalio import DigitalInOut , Direction
6
- from analogio import AnalogIn
7
5
import pulseio
8
6
from adafruit_esp32spi import adafruit_esp32spi
9
7
10
8
11
- """
12
- ESP32SPI Digital and Analog Pin Reads & Writes
9
+ # ESP32SPI Digital and Analog Pin Reads & Writes
13
10
14
- This example targets a Feather M4 or ItsyBitsy M4 as the CircuitPython processor,
15
- along with either an ESP32 Feather or ESP32 Breakout as Wi-Fi co-processor.
16
- You may need to choose different pins for other targets.
17
- """
11
+ # This example targets a Feather M4 or ItsyBitsy M4 as the CircuitPython processor,
12
+ # along with either an ESP32 Feather or ESP32 Breakout as Wi-Fi co-processor.
13
+ # You may need to choose different pins for other targets."""
18
14
19
15
20
16
def esp_reset_all ():
@@ -44,6 +40,7 @@ def esp_init_pin_modes(din, dout):
44
40
esp .set_pin_mode (dout , 0x1 ) # Red LED on ESP32 Feather and ESP32 Breakout
45
41
46
42
def esp_status_text (n ):
43
+ text = 'WL_UNDEFINED'
47
44
t = {0 : 'WL_IDLE_STATUS' ,
48
45
1 : 'WL_NO_SSID_AVAIL' ,
49
46
2 : 'WL_SCAN_COMPLETED' ,
@@ -54,11 +51,10 @@ def esp_status_text(n):
54
51
7 : 'WL_AP_LISTENING' ,
55
52
8 : 'WL_AP_CONNECTED' ,
56
53
9 : 'WL_AP_FAILED' ,
57
- 10 : 'WL_NO_SHIELD' , }
54
+ 10 : 'WL_NO_SHIELD' , }
58
55
if n in t :
59
- return t [n ]
60
- else :
61
- return 'WL_UNDEFINED'
56
+ text = t [n ]
57
+ return text
62
58
63
59
64
60
# M4 R/W Pin Assignments
You can’t perform that action at this time.
0 commit comments