Error Message: Unknown version number found in c_cpp_properties.json

I’m using PlatformIO in VS Code and i’m getting this error:
Unknown version number found in c_cpp_properties.json. Some features may not work as expected.

Here is the content of my c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "!!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags",
            "intelliSenseMode": "msvc-x64"
        },
        {
            "name": "Win32",
            "includePath": [
                "C:/Users/Beto/.platformio/packages/framework-arduinoavr/cores/arduino",
                "C:/Users/Beto/.platformio/packages/framework-arduinoavr/variants/micro",
                "C:/Users/Beto/.platformio/lib/Mouse_ID890/src",
                "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/HID/src",
                "C:/Users/Beto/.platformio/lib/Keyboard_ID891/src",
                "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/EEPROM/src",
                "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI/src",
                "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SoftwareSerial/src",
                "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/Wire/src",
                "C:/Users/Beto/.platformio/packages/tool-unity",
                "c:/Users/Beto/Documents/PlatformIO/Projects/KeyboardMouseControl/include",
                "c:/Users/Beto/Documents/PlatformIO/Projects/KeyboardMouseControl/src",
                ""
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": "${workspaceRoot}/.vscode/.browse.c_cpp.db",
                "path": [
                    "C:/Users/Beto/.platformio/packages/framework-arduinoavr/cores/arduino",
                    "C:/Users/Beto/.platformio/packages/framework-arduinoavr/variants/micro",
                    "C:/Users/Beto/.platformio/lib/Mouse_ID890/src",
                    "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/HID/src",
                    "C:/Users/Beto/.platformio/lib/Keyboard_ID891/src",
                    "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/EEPROM/src",
                    "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI/src",
                    "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SoftwareSerial/src",
                    "C:/Users/Beto/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/Wire/src",
                    "C:/Users/Beto/.platformio/packages/tool-unity",
                    "c:/Users/Beto/Documents/PlatformIO/Projects/KeyboardMouseControl/include",
                    "c:/Users/Beto/Documents/PlatformIO/Projects/KeyboardMouseControl/src",
                    ""
                ]
            },
            "defines": [
                "PLATFORMIO=40000",
                "ARDUINO_AVR_MICRO",
                "F_CPU=16000000L",
                "ARDUINO_ARCH_AVR",
                "ARDUINO=10805",
                "USB_VID=0x2341",
                "USB_PID=0x0037",
                "USB_PRODUCT=\"Arduino Micro\"",
                "USB_MANUFACTURER=\"Arduino\"",
                "__AVR_ATmega32U4__",
                ""
            ],
            "intelliSenseMode": "clang-x64",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "compilerPath": "\"C:/Users/Beto/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe\" -mmcu=atmega32u4"
        }
    ],
    "version": 3
}

PlatformIO core version, VSCode version?

Visual Studio Code: 1.19.1
PlatformIO: 1.7.1

It seems only the “Mouse.h” doesn’t work in PlatformIO, i’ve tried with the library from PlatformIO Manager and with the library from Arduino Library directory.
I compared the code of the two libraries and they are the same.

So according to this you are using a VScode version from November 2017?

When i click on the gear i get “Updates not available”, i use the VS Code .zip not the installer version.

These old ZIP versions do not seem to updateble, I would just get the 64-bit .zip from Download Visual Studio Code - Mac, Linux, Windows and retry

1 Like

Yeah i found out in Portable Mode in Visual Studio Code
I need to create a folder named data in the root directory of VS code, and all i need to do is to move this data folder to a newer extracted version of VS Code. I will try PlatformIO with the latest version and give feedback here, thanks.

1 Like

All right, i downloaded the latest version of VS Code with PlatformIO, i also downloaded the library Mouse.h from PlatformIO Library Manager, and even so, after i upload the code to my Micro Pro the mouse does not respond to the joystick!
But the same code works when i upload via Arduino IDE!

What’s the version of the used libraries in your Arduino IDE and what’s the version of the board package for your pro micro? (in the board manager)

1 Like

I compared the Mouse.h from .platformio/lib with the Mouse.h from program files\Arduino\libraries
I compared the Mouse.cpp from .platformio/lib with the Mouse.cpp from program files\Arduino\libraries

And they have exactly the same code!
All the files starts as this:

/*
  Mouse.h

  Copyright (c) 2015, Arduino LLC
  Original code (pre-library): Copyright (c) 2011, Peter Barrett

So, i think the problem is not the libraries.

And the board package version?

For the versions i see that all are up to date:

Updating tool-scons @ 2.20501.7 [Up-to-date]
Updating tool-unity @ 1.20403.0 [Up-to-date]
Updating contrib-pysite @ 2.27.190418 [Up-to-date]
Updating contrib-piohome @ 2.0.2 [Up-to-date]
Updating tool-pioplus @ 2.2.1 [Up-to-date]

Platform Manager

Platform Atmel AVR

Updating atmelavr @ 1.13.0 [Up-to-date]
Updating toolchain-atmelavr @ 1.50400.0 [Up-to-date]
Updating framework-arduinoavr @ 3.10623.190424 [Up-to-date]
Updating tool-avrdude @ 1.60300.190424 [Up-to-date]

Library Manager

Updating Keyboard @ 1.0.2 [Up-to-date]
Updating Mouse @ 1.0.1 [Up-to-date]

And in the Arduino IDE?

I saw the folder with a version 1.6.21 in AppData\Local\Arduino15\packages\arduino\hardware\avr
I think that is it.

Arduino AVR Core and platform.

------------------------------

For more info:

Arduino IDE 1.5 3rd party Hardware specification · arduino/Arduino Wiki · GitHub

name=Arduino AVR Boards
version=1.6.21

Can you replace platform with

platform = atmelavr@1.9.0

in your platformio.ini and retry.

1 Like

platformio.ini

[env:micro]
platform = atmelavr@1.9.0
board = micro
framework = arduino

I upload to the Micro Pro with no avail, it’s just me that can’t use the library Mouse.h on PlatformIO?

Which exact code are you using? Are you using the 5V or 3.3V version?

This is my board, PRO MICRO 5V:

Here is my code:

/* HID Joystick Mouse Example
   by: Jim Lindblom
   date: 1/12/2012
   license: MIT License - Feel free to use this code for any purpose.
   No restrictions. Just keep this license if you go on to use this
   code in your future endeavors! Reuse and share.

   This is very simplistic code that allows you to turn the
   SparkFun Thumb Joystick (http://www.sparkfun.com/products/9032)
   into an HID Mouse. The select button on the joystick is set up
   as the mouse left click.
 */

#include <Arduino.h>
#include <Mouse.h>
int horzPin = A0;  // Analog output of horizontal joystick pin
int vertPin = A1;  // Analog output of vertical joystick pin
int selPin = 9;  // select button pin of joystick

int vertZero, horzZero;  // Stores the initial value of each axis, usually around 512
int vertValue, horzValue;  // Stores current analog output of each axis
const int sensitivity = 200;  // Higher sensitivity value = slower mouse, should be <= about 500
int mouseClickFlag = 0;

void setup()
{
  pinMode(horzPin, INPUT);  // Set both analog pins as inputs
  pinMode(vertPin, INPUT);
  pinMode(selPin, INPUT);  // set button select pin as input
  digitalWrite(selPin, HIGH);  // Pull button select pin high
  delay(1000);  // short delay to let outputs settle
  vertZero = analogRead(vertPin);  // get the initial values
  horzZero = analogRead(horzPin);  // Joystick should be in neutral position when reading these
}

void loop()
{
  vertValue = analogRead(vertPin) - vertZero;  // read vertical offset
  horzValue = analogRead(horzPin) - horzZero;  // read horizontal offset
//delay(3000);

  if (vertValue != 0)
    Mouse.move(0, vertValue/sensitivity, 0);  // move mouse on y axis
  if (horzValue != 0)
    Mouse.move((horzValue/sensitivity) *-1, 0, 0);  // move mouse on x axis

  if ((digitalRead(selPin) == 0) && (!mouseClickFlag))  // if the joystick button is pressed
  {
    mouseClickFlag = 1;
    Mouse.press(MOUSE_LEFT);  // click the left button down
  }
  else if ((digitalRead(selPin))&&(mouseClickFlag)) // if the joystick button is not pressed
  {
    mouseClickFlag = 0;
    Mouse.release(MOUSE_LEFT);  // release the left button
  }
}

I am the only one that has tried to use Mouse.h in PlatformIO in VSCode???