Hi,
Is there a way to make a input high by software only?
I'm trying to make the interrupt high without the use of any hardware, since the code triggers the interrupt. For now i'm just using the blink sketch. When the first loop is done, the hardware goes to sleep.
#define LED_PIN 13
#define INT_OUTPUT 12
#define INT_INPUT 3
#include <Wire.h>
#include <LowPower.h>
#include <VL53L1X.h>
VL53L1X sensor;
void setup() {
pinMode(LED_PIN, OUTPUT);
pinMode(INT_OUTPUT, OUTPUT);
pinMode(INT_INPUT, INPUT_PULLUP);
for (int i = 0; i < 20; i++) {
if(i != 2)
pinMode(i, OUTPUT);
}
attachInterrupt(0, digitalInterrupt, FALLING); //interrupt for waking up
}
void loop() {
LowPower.powerDown(SLEEP_FOREVER , ADC_OFF, BOD_OFF);
digitalWrite(LED_PIN, HIGH);
delay(1000);
digitalWrite(LED_PIN, LOW);
delay(1000);
digitalWrite(0, HIGH);
if(INT_INPUT == HIGH){
digitalWrite(LED_PIN, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
delay(100);
}
}
void digitalInterrupt(){
//needed for the digital input interrupt
}