Subversion Repositories group.electronics

Rev

Rev 187 | Rev 189 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 187 Rev 188
Line 160... Line 160...
160
 
160
 
161
            return rslt;
161
            return rslt;
162
        }
162
        }
163
 
163
 
164
        public override int Input() {
164
        public override int Input() {
165
            //Console.WriteLine(data.buttons.ToString("X") + " " + data.axis[0].value.ToString());
-
 
166
            foreach (Control control in this.controls) {
165
            foreach (Control control in this.controls) {
167
                control.data = this.data;
166
                control.data = this.data;
168
                control.Tick();
167
                control.Tick();
169
            }
168
            }
170
            
169
            
Line 178... Line 177...
178
 
177
 
179
                BitImage flap_rotate = new BitImage(flap_needle);
178
                BitImage flap_rotate = new BitImage(flap_needle);
180
                BitImage flap_display = new BitImage(flap_background);
179
                BitImage flap_display = new BitImage(flap_background);
181
 
180
 
182
                UInt16 flap_set = Globals.map_uint16(flap_value, 0, 0xffff, 0, 90);
181
                UInt16 flap_set = Globals.map_uint16(flap_value, 0, 0xffff, 0, 90);
183
                Console.WriteLine("{0} {1} {2}", flap_set, flap_value, flap_shadow);
-
 
184
                flap_rotate.rotate(flap_set);
182
                flap_rotate.rotate(flap_set);
185
                flap_display.blit(flap_rotate, 60, 4);
183
                flap_display.blit(flap_rotate, 60, 4);
186
                oled.buffer = flap_display.toByteArray();
184
                oled.buffer = flap_display.toByteArray();
-
 
185
                oled.i2c.SetGpio(1, 1);
187
                oled.display();
186
                oled.display();
-
 
187
                oled.i2c.SetGpio(1, 0);
188
 
188
 
189
                this.flap_shadow = this.flap_value;
189
                this.flap_shadow = this.flap_value;
190
            }
190
            }
191
 
191
 
192
            return 1;
192
            return 1;