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;
|
||||
|
||||
uint count = 0;
|
||||
while (true) {
|
||||
bool sw = user_sw.read();
|
||||
bool a = button_a.read();
|
||||
bool b = button_b.read();
|
||||
while(true) {
|
||||
bool sw_pressed = user_sw.read();
|
||||
bool a_pressed = button_a.read();
|
||||
bool b_pressed = button_b.read();
|
||||
|
||||
if(sw) {
|
||||
if(sw_pressed) {
|
||||
speed = DEFAULT_SPEED;
|
||||
}
|
||||
else {
|
||||
if(a) speed--;
|
||||
if(b) speed++;
|
||||
if(a_pressed) speed--;
|
||||
if(b_pressed) speed++;
|
||||
}
|
||||
speed = std::min((int)255, std::max((int)1, speed));
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue