kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Fixed indentation of rainbow example
rodzic
a46ea3b097
commit
a347eb468f
|
@ -55,17 +55,17 @@ int main() {
|
||||||
float offset = 0.0f;
|
float offset = 0.0f;
|
||||||
|
|
||||||
uint count = 0;
|
uint count = 0;
|
||||||
while (true) {
|
while(true) {
|
||||||
bool sw = user_sw.read();
|
bool sw_pressed = user_sw.read();
|
||||||
bool a = button_a.read();
|
bool a_pressed = button_a.read();
|
||||||
bool b = button_b.read();
|
bool b_pressed = button_b.read();
|
||||||
|
|
||||||
if(sw) {
|
if(sw_pressed) {
|
||||||
speed = DEFAULT_SPEED;
|
speed = DEFAULT_SPEED;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(a) speed--;
|
if(a_pressed) speed--;
|
||||||
if(b) speed++;
|
if(b_pressed) speed++;
|
||||||
}
|
}
|
||||||
speed = std::min((int)255, std::max((int)1, speed));
|
speed = std::min((int)255, std::max((int)1, speed));
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue