This works. Prints "DATA_RDY" when I pull AO high.
#include <Arduino.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#define VBI_DATA_RDY A0
void setup()
{
Serial.begin(115200,SERIAL_8N1);
pinMode(VBI_DATA_RDY,INPUT);
DDRC= B01010000;
DDRD= B00000110;
}
void loop()
{
while (1) {
if (digitalRead(VBI_DATA_RDY)) {
Serial.println("DATA_RDY");
}
}
}
This does not? I see nothing wrong here and it compiles with no errors.
// Include Files
#include <Arduino.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#define VBI_DATA_RDY PINC & 0x20
void setup()
{
Serial.begin(115200,SERIAL_8N1);
DDRC= B01010000;
DDRD= B00000110;
}
void loop()
{
while (1) {
if (VBI_DATA_RDY) {
Serial.println("DATA_RDY");
}
}
}
I don't want to use digitalRead(). Too slow.