hey people how are u i am a beginner and i have started working on arduino recently. I am doing one project of ov7670 camera but there are lot of errors in the coding could you pls help me put of this. pls pls pls pls pls i would be grateful to you.
cam.ino (22.7 KB)
system
July 14, 2019, 9:58am
3
I can't see your code because I'm posting from my phone, but how did it get so big with "lot of errors in the coding"?
Edit: On my laptop now
twiAddr(uint8_t addr, uint8_t typeTWI){ <<--What's this?
TWDR = addr;//send address
TWCR = _BV(TWINT) | _BV(TWEN); /* clear interrupt to start transmission */
while ((TWCR & _BV(TWINT)) == 0); /* wait for transmission */
if ((TWSR & 0xF8) != typeTWI)
error_led();
}
voidwriteReg(uint8_t reg, uint8_t dat){ <<-- And this?
//send start condition
twiStart();
twiAddr(camAddr_WR, TW_MT_SLA_ACK);
twiWriteByte(reg, TW_MT_DATA_ACK);
twiWriteByte(dat, TW_MT_DATA_ACK);
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);//send stop
_delay_ms(1);
}
This looks like very bad cut-and-paste, but cut-and-paste is usually foolproof.
Did you manually transcribe this?