You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @bioshock2k
could you be more precise?
Arduino IDE version? Core version?
Board selected? (there are 2 RAK 811)? Menu options?
Which pin you used with analogRead()?
...
All relevant information else we could not help.
Yes i can.
Arduino IDE 1.8.49
Board selected: LoRa boards
Board Part Number: RAK811 Lora tracker(16kb RAM)
All these settings i had sucess programming and messing with the RAK811, but never with the adc.
This is the code i am using to test the ADC:
#include<arduino_lmic.h>
#include<arduino_lmic_hal_boards.h>
#include<arduino_lmic_hal_configuration.h>
#include<arduino_lmic_lorawan_compliance.h>
#include<arduino_lmic_user_configuration.h>
#include<lmic.h>
#include"STM32LowPower.h"
#include<lmic.h>
#include<hal/hal.h>
#include<SPI.h>
#include<Arduino.h>
#include<NewPing.h>
#include<MedianFilter.h>
#include<Wire.h>int ADC_pin=PA3;
int ADC_pin2=PB14;
// Pin mappingconst lmic_pinmap lmic_pins = {
.nss = 26,
.rxtx = 32,
.rst = 21,
.dio = {27, 28, 29},
};
voidsetup() {
// put your setup code here, to run once:
Serial.begin(115200);
while ( !Serial ) delay(10);
Serial.println("\r\n*******************************");
Serial.println("System Starting...");
Serial.println("");
pinMode(ADC_pin, INPUT);
pinMode(ADC_pin2,OUTPUT);
//os_init();
}
voidloop() {
// put your main code here, to run repeatedly:float battery=analogRead(ADC_pin);
// int battery2=digitalWrite(ADC_pin2,HIGH);
Serial.print("Batery: ");
Serial.println(battery);
//Serial.println(battery2);delay(500);
}
Do not ask me why. This is a contribution and I never had this board. 😉 So I don't know why contributor does not defined them. Anyway that's why you get always 0 as it is not considered as a valid analog pin.
changed the title [-]STM32L(RAK811 chip) Extend analog pins[/-][+]STM32L(RAK811 chip) [RAK811 Wis DUO](https://store.rakwireless.com/products/rak811-lpwan-module)[/+]on May 25, 2021
changed the title [-]STM32L(RAK811 chip) [RAK811 Wis DUO](https://store.rakwireless.com/products/rak811-lpwan-module)[/-][+]STM32L(RAK811 chip) RAK811 Wis DUO[/+]on May 25, 2021
Activity
fpistm commentedon May 17, 2021
Hi @bioshock2k
could you be more precise?
Arduino IDE version? Core version?
Board selected? (there are 2 RAK 811)? Menu options?
Which pin you used with
analogRead()?...
All relevant information else we could not help.
bioshock2k commentedon May 17, 2021
Yes i can.
Arduino IDE 1.8.49
Board selected: LoRa boards
Board Part Number: RAK811 Lora tracker(16kb RAM)
All these settings i had sucess programming and messing with the RAK811, but never with the adc.
This is the code i am using to test the ADC:
fpistm commentedon May 17, 2021
Thanks
Pins used are not defined by the variant as ADC pins:
Only those ones have been defined:
Arduino_Core_STM32/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/variant_RAK811_TRACKER.h
Lines 34 to 36 in 6555870
Do not ask me why. This is a contribution and I never had this board. 😉 So I don't know why contributor does not defined them. Anyway that's why you get always 0 as it is not considered as a valid analog pin.
bioshock2k commentedon May 17, 2021
Thank you very much!
That will do perfectly.
Could i add those ADC pins as a contributor?
fpistm commentedon May 17, 2021
Of course. Any contributions are welcome.
[-]STM32L(RAK811 chip) ADC value=0 in arduino IDE[/-][+]STM32L(RAK811 chip) Extend analog pins[/+]fpistm commentedon May 24, 2021
Hi @bioshock2k
Please, have you the list of ADC pin to add ?
bioshock2k commentedon May 24, 2021
The list of available ADC pins on the RAK811?
fpistm commentedon May 24, 2021
yes 😉 The one which should be exposed.
bioshock2k commentedon May 24, 2021
Pin Number | Name | Type | Description
2 | PB12/ADC | I/O | GPIO and ADC
3 | PB14/ADC | I/O | GPIO and ADC
4 | PB15/ADC | I/O | GPIO and ADC
20 | PA2/ADC | I/O | GPIO and ADC
22 | PA1/ADC | I/O | GPIO and ADC
23 | PA0/ADC | I/O | GPIO and ADC
Here it goes
fpistm commentedon May 24, 2021
OK, I guess this is the one defined here and so you used the RAK811 Wis DUO
https://docs.rakwireless.com/Product-Categories/WisDuo/RAK811-Module/Datasheet/#low-rf-version-pin-definition
but in the core this is the RAK811 LoRa Tracker (which seems no more sold)

So there is no issue in the variant. The RAK811 LoRa Tracker has only 3 pins available for ADC (PA0 is connected to measure VBAT)
as the pin mapping is not the same a new variant should be created.
[-]STM32L(RAK811 chip) Extend analog pins[/-][+]STM32L(RAK811 chip) [RAK811 Wis DUO](https://store.rakwireless.com/products/rak811-lpwan-module)[/+][-]STM32L(RAK811 chip) [RAK811 Wis DUO](https://store.rakwireless.com/products/rak811-lpwan-module)[/-][+]STM32L(RAK811 chip) RAK811 Wis DUO[/+]fpistm commentedon May 25, 2021
Added to the [New Variant] request list #722