Hi. I had a 42x19mm wheel encoder working a few days ago. I wired up the second one and it stopped working. I noticed that I had somehow swapped the VCC and GND lines so I corrected the problem but they still don’t work. Is it bad that I had the VCC and GND lines swapped? Did I break my encoders? I can see with a digital camera that the IR emitters still work. I’m hoping that I’m just doing something else dumb but I’ve checked the connections a few times and checked my code as well. I have a simple loop and I spin the wheels manually:
int main()
{
unsigned int bat;
unsigned int motors = 0;
svp_set_mode(SVP_MODE_ENCODERS);
bat = read_battery_millivolts_svp();
print_long(bat);
delay_ms(2000);
while(1)
{
lcd_goto_xy(0,0);
print_long(svp_get_counts_ab());
print(" ");
lcd_goto_xy(4,0);
print_long(svp_get_counts_cd());
print(" ");
delay_ms(50);
}
}