build error
jackhu1990 opened this issue · 3 comments
jackhu1990 commented
jackhu1990 commented
this is my code. the error looks not related to "stm32duino/STM32FreeRTOS", but i think if you create a project for me, maybe you can help me to resolve.
#include <Arduino.h>
#include <ArduinoJson.h>
#include <STM32FreeRTOS.h>
void setup() {
// put your setup code here, to run once:
pinMode(PB0,OUTPUT);
pinMode(PB1,OUTPUT);
pinMode(PA0,INPUT_PULLUP);
pinMode(PA1,INPUT_PULLUP);
pinMode(PA2,INPUT_PULLUP);
pinMode(PA3,INPUT_PULLUP);
gpio_set_mode(GPIOA, 13, GPIO_OUTPUT_PP);
gpio_set_mode(GPIOA, 14, GPIO_OUTPUT_PP);
afio_cfg_debug_ports(AFIO_DEBUG_NONE);
digitalWrite(PA13, LOW);
digitalWrite(PA14, HIGH);
pinMode(PB5,OUTPUT);
digitalWrite(PB5,HIGH);
Serial1.begin(9600, SERIAL_8N1);
char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
DynamicJsonDocument doc(1024);
deserializeJson(doc, json);
long time = doc["time"];
Serial1.println(time);
}
void loop() {
Serial1.println("Hello STM32, Mac OSX with VSCode and PlatForm IO.");
// put your main code here, to run repeatedly:
digitalWrite(PB0,HIGH);
digitalWrite(PB1,LOW);
delay(500);
digitalWrite(PB0,LOW);
digitalWrite(PB1,HIGH);
delay(500);
if(digitalRead(PA0) == LOW){
digitalWrite(PA13, HIGH);
digitalWrite(PA14, LOW);
}else{
digitalWrite(PA13, LOW);
digitalWrite(PA14, HIGH);
}
if(digitalRead(PA1) == LOW){
for(int i=0; i< 10; i++){
digitalWrite(PB5,LOW);
delay(10);
digitalWrite(PB5,HIGH);
delay(100);
}
}
if(digitalRead(PA2) == LOW){
for(int i=0; i< 10; i++){
digitalWrite(PB5,LOW);
delay(10);
digitalWrite(PB5,HIGH);
delay(10);
}
}
if(digitalRead(PA3) == LOW){
for(int i=0; i< 10; i++){
digitalWrite(PB5,LOW);
delay(1);
digitalWrite(PB5,HIGH);
delay(1);
}
}
}
jackhu1990 commented
fpistm commented
This library is for "official" STM32 core not maple. That's why it misses several types.