Fixed Class sketch
This commit is contained in:
parent
b2c702dac1
commit
e5d70a0cdf
File diff suppressed because it is too large
Load Diff
@ -147,6 +147,6 @@ void CDisplay::beep(uint16_t time_ms, uint8_t pitch)
|
||||
|
||||
void CDisplay::setPixelAt(int col, int row, bool val)
|
||||
{
|
||||
if(val) display[row] |= 1<<col+1;
|
||||
else display[row] &= ~(1<<col+1);
|
||||
if(val) display[row] |= 1<<col;
|
||||
else display[row] &= ~(1<<col);
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ void USSR()
|
||||
disp.beep(300, 8);
|
||||
}
|
||||
|
||||
void displayButtonPresses(int row)
|
||||
void displayButtonPresses()
|
||||
{
|
||||
// switch(row)
|
||||
// {
|
||||
@ -82,11 +82,39 @@ void displayButtonPresses(int row)
|
||||
// default:
|
||||
// return;
|
||||
// }
|
||||
if(ud_adc > 2200)
|
||||
{
|
||||
disp.setPixelAt(10, 3, true);
|
||||
disp.setPixelAt(10, 4, true);
|
||||
}
|
||||
|
||||
if(ud_adc < 2000)
|
||||
{
|
||||
disp.setPixelAt(10, 6, true);
|
||||
disp.setPixelAt(10, 7, true);
|
||||
}
|
||||
|
||||
if(lr_adc > 2200)
|
||||
{
|
||||
disp.setPixelAt(11, 5, true);
|
||||
disp.setPixelAt(12, 5, true);
|
||||
}
|
||||
|
||||
if(lr_adc < 2000)
|
||||
{
|
||||
disp.setPixelAt(8, 5, true);
|
||||
disp.setPixelAt(9, 5, true);
|
||||
}
|
||||
|
||||
if(bb) disp.setPixelAt(6, 8, true);
|
||||
if(ba) disp.setPixelAt(3, 5, true);
|
||||
}
|
||||
|
||||
void setup() {
|
||||
// USSR();
|
||||
disp.initDisplay();
|
||||
for(int i=0; i<12; i++) disp.setRow(i, bitmap[i]);
|
||||
disp.beep(100, 15);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
@ -96,6 +124,7 @@ void loop() {
|
||||
|
||||
ud_adc = analogRead(ADC_UD);
|
||||
lr_adc = analogRead(ADC_LR);
|
||||
for(int i=0; i<12; i++) disp.setRow(i, bitmap[i]);
|
||||
for(int i=0; i<12; i++) disp.setRow(i, buttons[i]);
|
||||
displayButtonPresses();
|
||||
disp.drawScreen(1);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user