#avr Logs

Feb 18 2020

#avr Calendar

12:10 AM day__ is now known as day
12:44 AM rue_bed: yea, your debugging wrong
12:44 AM rue_bed: break you code into simple system testss
12:45 AM rue_bed: test each on its own
12:45 AM rue_bed: then put them togethor one by one
12:45 AM rue_bed: you dont likley need more than an led or a pin to a scope (or digital logic analizer) to work out any issues
02:35 AM day: nabil: there are hardened versions which afaik often use a larger node, come in a different package and cost a fortune :D
06:23 PM twnqx: do
06:52 PM djph: /wc
11:41 PM rue_mohr: without context?
11:42 PM rue_mohr: unsigned long pa[] = {1, 10, 100, 1000, 10000, 100000, 1000000 };
11:42 PM rue_mohr: int rollDigit(int v, int p) {
11:42 PM rue_mohr: long A, B, C, D, E, F;
11:42 PM rue_mohr: A = v / pa[p+1] ; // left half after digit
11:42 PM rue_mohr: B = v / pa[p];
11:42 PM rue_mohr: C = A * 10;
11:42 PM rue_mohr: D = (B - C); // the digit
11:42 PM rue_mohr:
11:42 PM rue_mohr: E = D * pa[p];
11:42 PM rue_mohr: F = v - E; // the position is cleared
11:42 PM rue_mohr: D = (D>=9)?0:D+1; // increment with non-carry rollover
11:42 PM rue_mohr: return (F+(D*pa[p]));
11:42 PM rue_mohr: }
11:42 PM rue_mohr: the idea is that you have a button for each place the the value you want to change, you can 'roll the digits' to set a value
11:42 PM rue_mohr: anyone see any errors cause its not behaving and I think its due to a compiler optimization
11:43 PM rue_mohr: rollDigit( 54321, 1) should be 54331
11:44 PM rue_mohr: but for some reason it looks like D is not limited to 0-9 which doesn't add up
11:44 PM rue_mohr: I'v gone over this a few times, I can again
11:45 PM rue_mohr: that code is de-optimized, I didn't re-test it
11:45 PM rue_mohr: I'm wondering if my optimizations goofed it
11:46 PM rue_mohr: its also possible I'm having a hardware issue...
11:47 PM rue_mohr: if the keyboard read I'm using goes sparattic
11:47 PM rue_mohr: hmm
11:47 PM rue_mohr: things to test