Hello everyone,
I am currently developing a programming code for the Ai-WB2-32S-Kit board, which is equipped with a BL602 microchip. I am interfacing the board with the Arduino IDE as a PINE64 PineCone. I am seeking to implement the ADC (analog-to-digital converter) function. However, when I compile the code, the Arduino IDE displays the following error: 'Compilation error: 'analogRead' was not declared in this scope' (I am attaching a screenshot).
The board has the ADC function on multiple pins. I am using pin 14, configured with ADC function on channel 2. (I will send an image of the board specifications).
The code I am implementing is:
#include "bl602_adc.h"
#include "bl602_gpio.h"
#include "bl602_hbn.h"
float val;
void setup() {
pinMode(14, INPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(12, OUTPUT);
Serial.begin(115200);
}
void loop() {
val=analogRead(14);
Serial.println(val);
delay(500);
if (val>=0,val<255) {
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(12, LOW);
}
if (val>=255,val<511) {
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(12, LOW);
}
if (val>=511,val<767) {
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(12, HIGH);
}
}
Could you please assist me and guide me on how to correct the error, or inform me of what I am doing wrong?
Thank you very much.
Stiven Cortazar C.

