wifinina: add information about Adafruit boards with ESP32 wifi coprocessors, and modify examples to remove code that was both not being used, and also prevented many Adafruit boards from being able to be targeted by the examples

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2021-05-11 20:53:41 +02:00
committed by Ron Evans
parent cbcb62af01
commit 351700e48d
7 changed files with 16 additions and 39 deletions
+2 -6
View File
@@ -35,10 +35,7 @@ const server = "tcp://test.mosquitto.org:1883"
var (
// these are the default pins for the Arduino Nano33 IoT.
uart = machine.UART2
tx = machine.NINA_TX
rx = machine.NINA_RX
spi = machine.NINA_SPI
spi = machine.NINA_SPI
// this is the ESP chip that has the WIFININA firmware flashed on it
adaptor *wifinina.Device
@@ -48,7 +45,6 @@ var (
func main() {
time.Sleep(3000 * time.Millisecond)
uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
rand.Seed(time.Now().UnixNano())
// Configure SPI for 8Mhz, Mode 0, MSB First
@@ -94,7 +90,7 @@ func main() {
println(err.Error())
}
}
time.Sleep(1 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
}
// Right now this code is never reached. Need a way to trigger it...
+1 -6
View File
@@ -32,12 +32,8 @@ const server = "tcp://test.mosquitto.org:1883"
// change these to connect to a different UART or pins for the ESP8266/ESP32
var (
// these are the default pins for the Arduino Nano33 IoT.
uart = machine.UART2
tx = machine.NINA_TX
rx = machine.NINA_RX
spi = machine.NINA_SPI
spi = machine.NINA_SPI
// this is the ESP chip that has the WIFININA firmware flashed on it
adaptor *wifinina.Device
@@ -55,7 +51,6 @@ func subHandler(client mqtt.Client, msg mqtt.Message) {
func main() {
time.Sleep(3000 * time.Millisecond)
uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
rand.Seed(time.Now().UnixNano())
// Configure SPI for 8Mhz, Mode 0, MSB First
+1 -6
View File
@@ -28,10 +28,7 @@ const NTP_PACKET_SIZE = 48
var (
// these are the default pins for the Arduino Nano33 IoT.
uart = machine.UART2
tx = machine.NINA_TX
rx = machine.NINA_RX
spi = machine.NINA_SPI
spi = machine.NINA_SPI
// this is the ESP chip that has the WIFININA firmware flashed on it
adaptor *wifinina.Device
@@ -39,8 +36,6 @@ var (
)
func setup() {
uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
// Configure SPI for 8Mhz, Mode 0, MSB First
spi.Configure(machine.SPIConfig{
Frequency: 8 * 1e6,
+1 -6
View File
@@ -29,10 +29,7 @@ const serverIP = ""
var (
// these are the default pins for the Arduino Nano33 IoT.
uart = machine.UART2
tx = machine.NINA_TX
rx = machine.NINA_RX
spi = machine.NINA_SPI
spi = machine.NINA_SPI
// this is the ESP chip that has the WIFININA firmware flashed on it
adaptor *wifinina.Device
@@ -42,8 +39,6 @@ var buf = &bytes.Buffer{}
func main() {
uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
// Configure SPI for 8Mhz, Mode 0, MSB First
spi.Configure(machine.SPIConfig{
Frequency: 8 * 1e6,
+1 -6
View File
@@ -30,10 +30,7 @@ const server = "tinygo.org"
var (
// these are the default pins for the Arduino Nano33 IoT.
uart = machine.UART2
tx = machine.NINA_TX
rx = machine.NINA_RX
spi = machine.NINA_SPI
spi = machine.NINA_SPI
// this is the ESP chip that has the WIFININA firmware flashed on it
adaptor *wifinina.Device
@@ -45,8 +42,6 @@ var lastRequestTime time.Time
var conn net.Conn
func setup() {
uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
// Configure SPI for 8Mhz, Mode 0, MSB First
spi.Configure(machine.SPIConfig{
Frequency: 8 * 1e6,
+1 -6
View File
@@ -27,10 +27,7 @@ const server = "tinygo.org"
var (
// these are the default pins for the Arduino Nano33 IoT.
uart = machine.UART2
tx = machine.NINA_TX
rx = machine.NINA_RX
spi = machine.NINA_SPI
spi = machine.NINA_SPI
// this is the ESP chip that has the WIFININA firmware flashed on it
adaptor *wifinina.Device
@@ -42,8 +39,6 @@ var lastRequestTime time.Time
var conn net.Conn
func setup() {
uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
// Configure SPI for 8Mhz, Mode 0, MSB First
spi.Configure(machine.SPIConfig{
Frequency: 8 * 1e6,