arduino low power

Hello. first I need to say that i'm noob in arduino coding. I included the Low Power library from GitHub - rocketscream/Low-Power: Low Power Library for Arduino

The github page says:
Devices Supported:

  • ATMega88
  • ATMega168
  • ATMega168P
  • ATMega328P
  • ATMega32U4
  • ATMega644P
  • ATMega1284P
  • ATMega2560
  • ATMega256RFR2
  • ATSAMD21G18A

well, I included the library and got the error like this:
Note: Please install the ID, the version available at Arduino website, not the one in "apt" repos.
Arduino: 1.8.13 (Linux), Board: "Arduino Nano, ATmega328P"
WARNING: library ArduinoLowPower-master claims to run on samd, nrf52 architecture(s) and may be incompatible with your current board which runs on avr architecture(s).
In file included from /home/sage/Downloads/gps_tool_001/gps_tool_001.ino:5:0:
/home/sage/Arduino/libraries/ArduinoLowPower-master/src/ArduinoLowPower.h:7:2: error: #error The library is not compatible with AVR boards
#error The library is not compatible with AVR boards
^~~~~
exit status 1
Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

if this is not the right way to set Arduino to idle please send a link to the helpful that covers this problem.

Are you sure that code is using the library that you think?

I recently downloaded the library from the same link and successfully used it on my Arduino UNO clone as well as a custom 328P board.

When I downloaded the the code, the zip file was called Low-Power-master.zip. I have a folder called Low-Power in my libraries folder with all the files from the zip in it.

Next step is to show us your code ...

btw , there is some stuff wrong with my code. I tried to write a sketch for a simple neo6m+arduino+sd tool.

It seems that various things are wrong with my code. I first figured out that the lines declaring variables , i had written in the void setup() and then fixed it. but still it has problems. Data type, and the function gps not declared, and so on.

#include <SoftwareSerial.h>;
#include <SPI.h>;
#include <SD.h>;
#include <TinyGPS++.h>;
//#include <ArduinoLowPower.h>; deactivated due to error. library incompatible with the board, arduino-nano
double x;
double y;
double z;
float v;
unsigned long t;
SoftwareSerial ss(3,2);
TinyGPSPlus gps;

void setup(){
Serial.begin(4800);
ss.begin(9600);
SD.begin(7);
x=gps.location.lat;
y=gps.location.lng;
t=gps.time.value;

}

void loop(){
if(!SD.begin(7)){
Serial.println("card failed or not present");
return;
Serial.println("card initialized");
File datafile=SD.open("textfile.txt",FILE_WRITE);
while (ss.available()>0);
gps.encode(ss.read());
//datafile.println("time is : ",time);
if (gps.location.isUpdated()){

//z=gps.altitude.meters
//v=gps.speed.kmph
datafile.println("x = ",x);
datafile.println("y = ",y);
delay(10);}

datafile.close();
//LowPowerIdle(60000);
}

Firstly, please have a read of the forum guidelines. Especially the bit about how to post your code.

Secondly, it really helps if you have used the IDE Auto Format tool on your code. Just press CTRL+T in the IDE before copying your code to the forum within the code tags.

I get another error, pinMode(buttonpin,INPUT);
this is my error message:

exit status 1
expected constructor, destructor, or type conversion before ( token.

pinMode(buttonpin,INPUT); - that doesn’t appear in the code you have listed ??

Had the same issue today. Turns out "ArduinoLowPower" (the one available directly via library manager in the IDE) and Low-Power (the one from your link) are not the same (surprise).

#include <SoftwareSerial.h>;

Do not put semicolons at the end of an #include