Projekte
Maik Tester
blinkemulti
main.cpp
Projekte
Forum
Doku
Öffentliche Projekte
Startseite
Beispielprogramme
Projekte von anderen
Welcome
Username
Passwort
Eingeloggt bleiben
Zugangsdaten vergessen?
Registrieren
Projektverwaltung
⇨ Please choose! ⇦
——————————————————
✎ Create new project...
★ Browse existing projects...
——————————————————
⚬ MotorTest#1
⚬ C Tutorial 8#1
⚬ NIBO2 C Project#1
⚙ C Tutorial 15#1
⚬ 2010_11_18_el_test001#1
blinkemulti
main.cpp
Project details
Compiler settings
Nachrichten
Sie sind nicht eingeloggt.
Neuigkeiten
★
NiboRoboLib 3.6
2017-01-17: Neue Version 3.6
★
NiboRoboLib 3.4.1
2016-04-16: Neue Version 3.4.1
★
Coding Tutorial
2015-11-22: Jetzt auch für den NIBO burger!
Site-Statistic
7430 private projects
378 public projects
16178470 lines compiled
58188 builds
NIBO
@
blinkemulti/main.cpp [read only]
#include <nibobee/robomain.h> //Zahlendifinitionen #define COUNTER_lr_MAX 10000 #define COUNTER_ly_MAX 20000 #define COUNTER_rr_MAX 30000 #define COUNTER_ry_MAX 40000 // Globale Variablen difunieren uint32_t counter_lr = COUNTER_lr_MAX; uint32_t counter_ly = COUNTER_ly_MAX; uint32_t counter_rr = COUNTER_rr_MAX; uint32_t counter_ry = COUNTER_ry_MAX; // status uint8_t status_lr = 0; uint8_t status_ly = 0; uint8_t status_rr = 0; uint8_t status_ry = 0; void setup() { led_init(); } void loop() { //VERARBEITUNG // LEDS blinken lassen links rot if (counter_lr == 0) { if (status_lr == 0) { status_lr = 1; } else { status_lr = 0; } } //Zähler runterzählen bzw auf Startwert setzen if (counter_lr > 0) { counter_lr = counter_lr - 1; } else { counter_lr = COUNTER_lr_MAX; } //output // LEDS wie gespeichert ein- ausschalten led_set(LED_L_RD, status_lr); // LEDS blinken lassen links gelb if (counter_ly == 0) { if (status_ly == 0) { status_ly = 1; } else { status_ly = 0; } } //Zähler runterzählen bzw auf Startwert setzen if (counter_ly > 0) { counter_ly = counter_ly - 1; } else { counter_ly = COUNTER_ly_MAX; } //output // LEDS wie gespeichert ein- ausschalten led_set(LED_L_YE, status_ly); // LEDS blinken lassen rechst rot if (counter_rr == 0) { if (status_rr == 0) { status_rr = 1; } else { status_rr = 0; } } //Zähler runterzählen bzw auf Startwert setzens if (counter_rr > 0) { counter_rr = counter_rr - 1; } else { counter_rr = COUNTER_rr_MAX; } //output // LEDS wie gespeichert ein- ausschalten led_set(LED_R_RD, status_rr); // LEDS blinken lassen rechst gelb if (counter_ry == 0) { if (status_ry == 0) { status_ry = 1; } else { status_ry = 0; } } //Zähler runterzählen bzw auf Startwert setzen if (counter_ry > 0) { counter_ry = counter_ry - 1; } else { counter_ry = COUNTER_ry_MAX; } //output // LEDS wie gespeichert ein- ausschalten led_set(LED_R_YE, status_ry); }
Compiler results:
Werbung
Online
beulahreveley5193
GermanDelt
hunter94
KylieSat
warrenhinder6456