Hi friends. can anyone help me to reduce the size of my sketch ? it's says your sketch using 100% of storage.
error:
Sketch uses 2058 bytes (100%) of program storage space. Maximum is 2048 bytes.
the sketch:
#include "RF24.h"
RF24 radio(3, 3);
int transmitterId = 0;
const uint64_t pipes[3] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0E2LL, 0xF0F0F0F0E3LL };
int pirPin = 2;
int relayPin = 7;
int calibrationTime = 30;
long unsigned int lowIn;
long unsigned int pause = 10000;
boolean lockLow = true;
boolean takeLowTime;
int PIRValue = 0;
void setup() {
pinMode(pirPin, INPUT);
transmitterId = 64;
radio.begin();
radio.setPayloadSize(2);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipes[1]);
digitalWrite(relayPin, 0);
pinMode(relayPin, OUTPUT);
}
void loop() {
if (digitalRead(pirPin) == HIGH) {
if (lockLow) {
PIRValue = 1;
lockLow = false;
digitalWrite(relayPin, HIGH);
radio.powerUp();
delay(250);
digitalWrite(relayPin, LOW);
radio.write(&transmitterId, 1);
delay(50);
}
takeLowTime = true;
}
if (digitalRead(pirPin) == LOW) {
if (takeLowTime) {
lowIn = millis(); takeLowTime = false;
}
if (!lockLow && millis() - lowIn > pause) {
PIRValue = 0;
lockLow = true;
digitalWrite(relayPin, LOW);
delay(50);
}
}
}