[Solved] wiringPi digitalRead

I’m in the beginnings of programming a mobile robot for school. I’ve got a joystick in blynk controlling a motor, and I’m trying to track the position of the encoder by multi-threading a process, but it’s not working. I’ve tested the EncoderA code in a blank program outside of Blynk, and it tracks the encoder fine. The issue seems to be with digitalRead never going high. I’ve also tested to make sure that the EncoderA is being run.

//#define BLYNK_DEBUG
#define BLYNK_PRINT stdout
#include <BlynkApiWiringPi.h>
#include <BlynkSocket.h>
#include <BlynkOptionsParser.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <wiringPi.h>
#include <wiringSerial.h>

char auth[] = "f7ff33a43fd64934b536db864c4ceca7";


static BlynkTransportSocket _blynkTransport;
BlynkSocket Blynk(_blynkTransport);

#include <BlynkWidgets.h>

unsigned int lastTime = 0;
int fd;
int countEncA;

BLYNK_WRITE(V1)
{
  printf("Got a value: %i\n", param[0].asInt());
}

void DriveMotor(unsigned char speed)
{
	serialPutchar(fd, speed);
}

BLYNK_WRITE(V0)
{
	int jsX = abs(param[0].asInt() - 128);
	int jsY = abs(param[1].asInt() - 128);
	int jsMag = sqrt(jsX*jsX+jsY*jsY);
	unsigned char motorSpeed = round((64 - 64*jsMag/145));
	if ((abs(millis()-lastTime)) > 5)
	{
		 printf("Joystick Magnitutde: %i\n", jsMag);
		 lastTime = millis();
		 DriveMotor(motorSpeed);
	}
}

PI_THREAD(encoderA)
{
	piHiPri(10);
	printf("INITIALIZED");
	pinMode(28, INPUT);
	pinMode(29, INPUT);
	pullUpDnControl(28, PUD_DOWN);
	pullUpDnControl(29, PUD_DOWN);
	for(;;){
		if (digitalRead(28) == 1){
			printf("IF");
			delayMicroseconds(100);
			if (digitalRead(28) == 0){
				printf("TEST");
				if (digitalRead(29) == 0){
					countEncA++;
					printf("%i", countEncA);
				}
				else{
					countEncA--;
					printf("%i", countEncA);
				}
			}
		}
	}
}


//PI_THREAD(encoderB)
//{
//}
int main(int argc, char* argv[])
{
	if (wiringPiSetup() < 0)
		perror("WiringPiSetup Issue");	
	if ((fd = serialOpen("/dev/serial0", 38400)) < 0)
		perror("Device not opened \n");
    const char *auth, *serv;
    uint16_t port;
    parse_options(argc, argv, auth, serv, port);

    Blynk.begin(auth, serv, port);
	piThreadCreate(encoderA);

    while(true) {
        Blynk.run();
    }

		
    return 0;
}

Solved. Blynk and wiringPi both have digitalRead and digitalWrite functions. The pin configuration with wiringPi was set to wiringPi’s pin config,while Blynk was set to BCM.