Projekte
workwind
NIBObee Probe Blue
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
NIBObee Probe Blue
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
7426 private projects
385 public projects
16180353 lines compiled
58212 builds
NIBO
@
nibobee_probe_blue/main.cpp [read only]
#include <nibobee/robo.h> #include <nibobee/usart.h> void probe_blue(uint16_t baud, uint8_t led) { int error; led_set (led, 1); usart_disable(); while (!usart_rxempty()) { usart_getchar(); } usart_setbaudrate(baud); usart_enable(); delay(200); usart_putchar('A'); usart_putchar('T'); delay(1200); //error = (usart_rxempty() || (usart_getchar()==0)); //error |= (usart_rxempty() || (usart_getchar()==0)); error = (usart_rxempty() || usart_getchar()!='O'); error |= (usart_rxempty() || usart_getchar()!='K'); led_set (led, 0); while (!error) { delay(250); led_set (led, 1); delay(250); led_set (led, 0); } } void baud_detection() { // set Tx Bit 1 PORTD |= _BV(1); DDRD |= _BV(1); IO_LEDS_PORT |= IO_LEDS_MASK; delay(1000); IO_LEDS_PORT &= ~IO_LEDS_MASK; probe_blue(9600, 0); probe_blue(19200, 1); probe_blue(38400, 2); probe_blue(57600, 3); while(1) { IO_LEDS_PORT &= ~IO_LEDS_MASK; delay(200); IO_LEDS_PORT |= IO_LEDS_MASK; delay(800); } } void echo() { PORTD |= _BV(1); DDRD |= _BV(1); while (1) { if (PIND & _BV(0)) { PORTD |= _BV(1); IO_LEDS_PORT |= _BV(0); IO_LEDS_PORT &= ~_BV(1); } else { PORTD &= ~_BV(1); IO_LEDS_PORT &= ~_BV(0); IO_LEDS_PORT |= _BV(1); } } } int main() { led_init(); feeler_init(); if (feeler_getLeft()) { echo(); } baud_detection(); }
Compiler results:
Werbung
Online
agnesmarlay2699765
alicevib4869957876
angiesonnier022051
anne10s08691251131
arielkellum0637061
austineverard39
bettycarner7200
bobbiehayner228226
bvkdarrel629626
carine251934777
chandradillion322729
claysadleir964730
dewayneo4846447140
drusillapayne578806
edisonlizotte4427
elenal09427874464490
ellismclane316891531
eloise53p4522441
elvialavender09
emersonweir268525
estellegayle25291244
finncrumpton8714756
fugbetsy84526872
genesisalexander6
guillermoherrick8
hassanlaboureyas8
hersheldraper36
humbertoann148070
janetitg188521920
jenscorbo083215402
kathrynw31556745
kendrazeigler82
kristeenchaves915
lamonth4320288971603
latanya2941951547870
leahhager132147765
lenoretousignant247
leonasnook2546856291
lidamascorro550
lieselottebar02823761
luciehateley133886
maribeleverard3
marina42362450713
maxiepalfreyman85
natashaappleton130
natashamoyes64624093
nellcarrol80211569607
odettesear36035
pansyloe03848653699
preciouslefebvre
rosaline10w81270
roscoegibbs2353
roxiewessel0625174
sharyl94996859703161
shauntevieira9697
shellachen05598945
sonjagulley6731
suzettereese1112
thaliaburrow7849884
warren38l1013290
williemaemadden
wolfgangmistry518270
zackirvin72719811111