// This Arduino code was automatically generated by Aixt Project
// https://github.com/fermarsan/aixt
// Device = Raspberry-Pi-Pico
// Board = Raspberry Pi Pico
// Backend = arduino
#include <stdio.h>
typedef int8_t i8;
typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
typedef int32_t isize;
typedef int32_t int_literal;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef uint32_t usize;
typedef float f32;
typedef double f64;
typedef double float_literal;
#define _const_main__cpu_freq_mhz _const_main__cpu_freq/1000000
#define _const_main__cpu_freq 125000000
void time__sleep(i32 ts);
void time__sleep_ms(i32 tms);
void time__sleep_us(i32 tus);
#define SERIAL1_BEGIN(BAUD_RATE) Serial1.begin(BAUD_RATE)
#define SERIAL1_WRITE(CHARACTER) Serial1.write(CHARACTER)
#define SERIAL1_READ() Serial1.read()
#define SERIAL1_PRINT(MESSAGE) Serial1.print(MESSAGE)
#define SERIAL1_PRINTLN(MESSAGE) Serial1.println(MESSAGE)
#define SERIAL1_AVAILABLE() Serial1.available()
#define SERIAL1_PINS(tx, rx) UART Serial1(tx, rx, 0, 0)
u8 uart__read();
i32 uart__any();
void uart__println(char message[]);
void uart__write(u8 character);
void uart__print(char message[]);
void uart__setup(i32 baud_rate);
void uart__pins(i32 tx_pin, i32 rx_pin);
void adc__setup(u8 res);
u16 adc__read(u8 name);
char __temp_str[50];
const i32 _const_main__led0 = (i32)(25);
inline void time__sleep(i32 ts) {
delay(ts * 1000);
}
inline void time__sleep_ms(i32 tms) {
delay(tms);
}
inline void time__sleep_us(i32 tus) {
delayMicroseconds(tus);
}
inline u8 uart__read() {
return SERIAL1_READ();
}
inline i32 uart__any() {
return SERIAL1_AVAILABLE();
}
inline void uart__println(char message[]) {
SERIAL1_PRINTLN(message);
}
inline void uart__write(u8 character) {
SERIAL1_WRITE(character);
}
inline void uart__print(char message[]) {
SERIAL1_PRINT(message);
}
inline void uart__setup(i32 baud_rate) {
SERIAL1_BEGIN(baud_rate);
}
inline void uart__pins(i32 tx_pin, i32 rx_pin) {
SERIAL1_PINS(tx_pin, rx_pin);
}
const i32 _const_adc__ch0 = (i32)(26);
const i32 _const_adc__ch1 = (i32)(27);
const i32 _const_adc__ch2 = (i32)(28);
inline void adc__setup(u8 res) {
analogReadResolution(res);
}
inline u16 adc__read(u8 name) {
return analogRead(name);
}
void setup() {
uart__setup(115200);
adc__setup(12);
while( true ) {
u16 analog = (u16)(adc__read(_const_adc__ch0));
sprintf(__temp_str, "ADC channel 0: %u", (unsigned int)analog);
uart__println(__temp_str);
time__sleep_ms(500);
}
}
void loop(){
}