hi guys i have some problem
in my project(ardunio mega) sleep mode and wake up not worked via digital pin 1 or 9 i testet and sleep and wake up worked only via digital pin 52
i need use pin 9 from SET sleep mode
digital pin 9 is healthy
please help me for use pin 9 from sleep mode
void loop()
{// When the ignition switch is turned, executes the next two ifs
if (ignition == true && digitalRead(9) == LOW)
{
ignition = false;
display.ssd1306_command(SSD1306_DISPLAYOFF);
sleep_enable(); // enables the sleep mode
set_sleep_mode(SLEEP_MODE_PWR_DOWN); // set the sleep mode
cli();
sleep_disable(); // disables the brown out detector to consume less power while sleeping
sei();
sleep_mode(); // microcontroller goes to sleep
if (ignition == true && digitalRead(9) == HIGH)
{
ignition = false; // this variable is needed in order to run once the code inside this if
logohold = millis(); // hold the LOGO screen on, for 2 sec
inst_disp = true;
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.drawBitmap(0, 0, logo, 128, 64, WHITE);
display.display();
while (millis() - logohold < 2000) ;
void ignitionSignal() // this is called everytime the ingintion signal changes -- if the
microcontroller is in sleep mode, it will wake up
{
ignition = !ignition;
}