Projekte
workwind
NIBO 2 IR Rx Tx Test
main.c
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
NIBO 2 IR Rx Tx Test
main.c
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
7433 private projects
378 public projects
16180353 lines compiled
58212 builds
NIBO
@
nibo_2_ir_rx_tx_test/main.c [read only]
/* Dieses Programm zeigt das zuletzt empfangene RC5-Kommando an. Wenn der Taster S3 gedrückt wird sendet es einen RC5 Code, der verwendete Code wird bei jedem Senden um eins erhöht (0x3500, 0x3501, 0x3502, ...) */ #include <nibo/niboconfig.h> #include <nibo/display.h> #include <nibo/gfx.h> #include <nibo/spi.h> #include <nibo/copro.h> #include <nibo/delay.h> #include <nibo/iodefs.h> #include <nibo/bot.h> #include <avr/interrupt.h> #include <nibo/i2cmaster.h> #include <stdio.h> int main() { sei(); // enable interrupts bot_init(); spi_init(); display_init(); /* Displayansteuerung initialisieren */ gfx_init(); /* Grafikdisplay initialisieren */ gfx_move(62, 0); gfx_set_proportional(1); gfx_print_text("rc5test"); gfx_set_proportional(0); delay(50); uint16_t code = 0x3500; while (1) { if (!get_input_bit(IO_INPUT_1)) { delay(20); while (!get_input_bit(IO_INPUT_1)) { delay(20); } copro_transmitRC5(code++); } // IR Controller delay(10); char text[20]="RC5: ----"; if (copro_update()) { sprintf(text, "RC5: %04x", (int)copro_rc5_cmd); } gfx_move(35, 45); gfx_print_text(text); // Spannung bot_update(); float volt = 0.0166 * bot_supply - 1.19; sprintf(text, "%2.1fV ", (double)volt); gfx_move(25, 0); gfx_print_text(text); } return 0; }
Compiler results:
Werbung
Online
alonzoneitenstein
charmainpottinger02
warrenhinder6456