Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3466

SDK • Math functions not working with Pico VSCode extension

$
0
0
I've just installed the VSCode Pico extension and I'm trying to convert over a project that previously worked with the old style SDK interface. The code doesn't work! I've single stepped through it and found it fails when I call any function from the math.h library.

To check this out I created a new project with the Pico extension, put this modified "Hello world" style program into it. The code calls the math pow() function. It also fails when pow() is called. I'm stumped, shouldn't this just work?

Code:

#include <stdio.h>#include <math.h>#include "pico/stdlib.h"int main(){    stdio_init_all();    while (true) {        printf("Sandbox testing!\n");        printf("%f\n",pow(2,2)); \\ Fails here        sleep_ms(1000);    }}

Statistics: Posted by redlegjed — Fri Nov 01, 2024 8:41 pm — Replies 1 — Views 45



Viewing all articles
Browse latest Browse all 3466

Trending Articles