Hello, im currently working on a project for e mechatronics course. WE had to create a device that uses a light sensor, 2 display drivers and a dual digit seven segment display that displays values of ligth from 0-99. We started by doing all of our hardwiring and a pretty confident in that but, as we move onto the code, we are running into some issues. Our professor is asking that we use bit_write commands and use the basic set up that we have in our current code but we are stuck and dont know where to go from what we have. here is the code. any help is appreciated. Thanks
int sensorPin=A1;
int sensorValue;
void bit_Write(char);
void setup() {
Serial.begin(9600);
for(int k=2;k<10;++k)
pinMode(k,OUTPUT);
}
void loop() {
sensorValue=analogRead(sensorPin);
sensorValue=map(sensorValue,0,1023,0,99);
Serial.println(sensorValue);
delay(1000);
int digit1=(sensorValue/10);
int digit2=sensorValue%10;
{
void bit_Write(char);
int pin=2;
char mask=0x01;
for (int j=0;j<8;j++);
{digitalWrite(pin, digit1&0001);
digit1 = digit1>>1;
}
{
void bit_Write(char);
int pin=6;
char mask=0x01;
for (int j=0;j<8;j++);
{digitalWrite(pin, digit2&0001);
digit2 = digit2>>1;
}
}}}
AS of right now, we are etting the ligthsensor part of the code to work, the values are appearing in the serial monitor but we cant get the 7 seg display to show anything