-
Notifications
You must be signed in to change notification settings - Fork 1k
STM32L(RAK811 chip) RAK811 Wis DUO #1395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @bioshock2k |
Yes i can. 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 mapping
const lmic_pinmap lmic_pins = {
.nss = 26,
.rxtx = 32,
.rst = 21,
.dio = {27, 28, 29},
};
void setup() {
// 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();
}
void loop() {
// 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);
} |
Thanks
Only those ones have been defined: 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. |
Thank you very much! |
Of course. Any contributions are welcome. |
Hi @bioshock2k |
The list of available ADC pins on the RAK811? |
yes 😉 The one which should be exposed. |
Pin Number | Name | Type | Description Here it goes |
OK, I guess this is the one defined here and so you used the RAK811 Wis DUO 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. |
Added to the [New Variant] request list #722 |
Hi,
I´ve been trying to use the RAK 811 chip ADC that runs a STM32L. When using the Arduino IDE using analogRead() i get a value of 0 in the read.
AM i missing something?
The text was updated successfully, but these errors were encountered: