Hello,
i have this board:
Do i need always an arduino, because all examples are called with names from arduino. How can i read A1 (PB1) D8 W306?
analogRead(A1); ?
analogRead(D8); ?
Hello,
i have this board:
Do i need always an arduino, because all examples are called with names from arduino. How can i read A1 (PB1) D8 W306?
analogRead(A1); ?
analogRead(D8); ?
You don’t have to use an arduino environment, but the examples that sparkfun provides generally are made for arduino IDE
Yep! Both of the methods you mentioned would work; you can read analog values from digital pins if that pin has an ADC (simply substitute the alternate pin # as you have)
If you want to pass a value to be printed on the serial monitor, you’ll need to assign a variable to the value(s)…here’s a short example using D7 and A1 (I swapped to D7 bc A1 and D8 are the same pin!)
Serial.begin(115200);
// Set D7 as output if you want to use it as a digital pin
pinMode(D7, OUTPUT);
// Read from A1 (PB1)
int sensorValue = analogRead(A1);
Serial.print("Sensor value on A1: ");
Serial.println(sensorValue);
}
void loop() {
// You can add code here to use D7 or A1 as needed
digitalWrite(D7, HIGH); // Turn D7 ON
delay(1000);
digitalWrite(D7, LOW); // Turn D7 OFF
delay(1000);
}
I will say that PB1 is pin 9, though!
Our guide has more info Example 1 - Blink - SparkFun Thing Plus NORA-W306 Hookup Guide
@TS-Russell
Thank you for your help. It works
Do you know how i change the ip-adress for an access point?
I want to change the adress 192.168.1.1 to another.
status = WiFi.apbegin(ssid, pass, channel, ssid_status);
WiFi.config(IPAddress(192, 168, 4, 1), INADDR_NONE, INADDR_NONE);
isn’t working
For changing the IP address of an access point on the ESP32, you need to use the WiFi.softAPConfig() method before starting the access point. Here’s the correct approach:
Try something like this:
IPAddress local_IP(192, 168, 4, 1); // Your desired IP address
IPAddress gateway(192, 168, 4, 1); // Usually same as local IP for soft AP
IPAddress subnet(255, 255, 255, 0); // Standard subnet mask
// Configure the soft AP IP address BEFORE calling WiFi.softAP()
if (!WiFi.softAPConfig(local_IP, gateway, subnet)) {
Serial.println("AP Config Failed");
}
// Now you can start the Access Point
status = WiFi.softAP(ssid, pass, channel, ssid_hidden);
Notes:
The error is:
‘class WiFiClass’ has no member named ‘softAPConfig’
because this board has the u Blox W306 and not the ESP32
i found examples and so on, but not the decripton for the wifi api from the W306.
Do you know where it is?
I have connected 3.3V to A0. There is no voltage divider on the board. I therefore expected 4096, as this is a 12-bit converter according to the data sheet. Unfortunately, I see something in the direction of 1024, as if it were a 10-bit converter. How can I adjust this?
D’oh! I’ve gotten products swapped in my head around a few times lately! At least I have some upcoming days off soon…heh
I found this, linked from our resources section in the guide for that board
This looks like the main build files ameba-arduino-d/Arduino_package/hardware/cores/ambd/IPAddress.h at b808619d07c384f69db853499087ea77b7480a3e · Ameba-AIoT/ameba-arduino-d · GitHub
…and then there’s a whole web of other src files in there
You can also probably have it hop on your network, then use the MAC address you see pop up on your router’s settings page (it’s also printed on the module but it’s tiny…the wifi AP also is a 2nd MAC, if I’m interpreting those docs correctly…anyhow, after knowing which MAC to use you can probably set a static IP for that MAC alone if you want? (in router’s settings). I have a cheapy one and it lets me do all kinds of stuff
As for adjusting the the ADC bits, you’re probably gonna have to rummage through that github until you find the one you’re after to try changing the bits (I have seen cases where this was done as an intentional design decision for memory/throughput reasons…not sure if that’s the case here)
Thank you for your help. The thread can then be closed.