Projekte
BirgerT
Nibo2_BGX1
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
Nibo2_BGX1
bgx1_protocol.h
main.c
nibo2_bgx1.c
nibo2_bgx1.h
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
7427 private projects
385 public projects
16180848 lines compiled
58218 builds
NIBO
@
nibo2_bgx1/main.c [read only]
/* NIBO2 C project */ /* NIBO 2 Tutorial Sensoren und Akkusppanung */ #include <stdlib.h> // Umwandlung einer Fließkommazahl in eine Zeichenkette #include <stdio.h> // sprintf #include <avr/io.h> //ATmega128 #include <avr/interrupt.h> // Interrupts #include <avr/pgmspace.h> // FLASH #include <avr/eeprom.h> // EEPROM #include "nibo/niboconfig.h" #include "nibo/iodefs.h" // mit den Makros aus iodefs.h lassen sich eigene Makros kreieren #define toggle_output_bit(NAME) _PPCAT(NAME,_PORT) ^= (unsigned char)_BV(_PPCAT(NAME,_BIT)) // HEADLIGHT EIN, AUS und TRUE wenn eingeschaltet #define head_on set_output_bit(IO_LED_WHITE) #define head_off clear_output_bit(IO_LED_WHITE) #define head_is_on (1<<IO_LED_WHITE_BIT == get_output_bit(IO_LED_WHITE)) // DIPLAYLIGHT EIN, AUS und TRUE wenn eingeschaltet #define disp_on set_output_bit(IO_DISP_LIGHT) #define disp_off clear_output_bit(IO_DISP_LIGHT) #define disp_is_on (1<<IO_DISP_LIGHT_BIT == get_output_bit(IO_DISP_LIGHT)) #include "nibo/delay.h" //#include "nibo/display.h" //#include "nibo/gfx.h" // fehlende defines in gfx.h #define GFX_DISP_WIDTH 128 #define GFX_DISP_HEIGHT 64 #include "nibo/spi.h" #include "nibo/copro.h" #include "nibo/adc.h" #include "nibo/floor.h" #include "nibo/leds.h" #include "nibo/pwm.h" #include "nibo/bot.h" #include "nibo/i2cmaster.h" #include "nibo/nds3.h" #include "bgx1_protocol.h" #include "nibo2_bgx1.h" int main() { i2c_init(); while (!bgx1_init()); bgx1_setIllumination(1020); while(1) { sei(); if (bgx1_getStatus()==0xff) { delay(1500); bgx1_reset(); bgx1_termPrint("Please press a key..."); bgx1_Leds=0x01; bgx1_syncInterface(); delay(2000); bgx1_Leds=0x00; bgx1_syncInterface(); delay(2000); bgx1_Leds=0x02; bgx1_syncInterface(); delay(2000); bgx1_Leds=0x00; bgx1_syncInterface(); bgx1_termGoto(0, 2); } delay(1); bgx1_syncInterface(); if (bgx1_Keys!=0) { switch (bgx1_Keys) { case 0x01: bgx1_termPrint("Hello! "); break; case 0x02: bgx1_termPrint("I am the autonomous NIBO2 robot. "); break; case 0x04: bgx1_termPrint("\n"); break; case 0x08: bgx1_termClear(); break; } while (bgx1_Keys!=0) { bgx1_syncInterface(); delay(1); } } } return 0; }
Compiler results:
Werbung
Online
blaubaer48
cashstreakdenis
maribate728972257846