Hi
Hab mir eine Generation7 Elektronik (mit Atmega1284P-PU) selbst gebaut. Über i2c das Panelolu 2 mit 20x4LCD angeschlossen.
Atmega Pin
Pin23 PC1 (D 17) SDA I2C LCD
Pin22 PC0 (D 16) SCL I2C LCD
Encoder Kontakt EN_A und EN_B
Pin17,D11 EN_A
Pin16,D10 EN_B
Vom Encoder den "Click" (EN_C)Kontakt habe ich an Pin23 MCP23017 angeschlossen. Die anderen beiden Kontakte habe ich nicht über das IC ans laufen bekommen, deswegen direkt an Pin17,D11und Pin16,D10 vom Atmega1284 angeschlossen. Es ist eigentlich egal welcher Pin am Atmega benutzt wird, er muß nur in der Pins.h eingetragen werden.
Die Zeilen Auskommentieren, die nicht eingerückt sind.
Configuration.h
//LCD and SD support
#define ULTRA_LCD //general LCD support, also 16x2
//#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define SDSUPPORT // Enable SD Card Support in Hardware Console
//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
//#define ULTIPANEL //the UltiPanel as on Thingiverse
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
und etwas tiefer
//I2C PANEL
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
#define LCD_I2C_PANELOLU2 in dieser Zeile die // entfernen
#ifdef LCD_I2C_PANELOLU2
#define LCD_I2C_TYPE_MCP23017
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
#define NEWPANEL
#define ULTIPANEL
#define SDSUPPORT
#define LCD_WIDTH 20
#define LCD_HEIGHT 4
#endif
#ifdef LCD_USE_I2C_BUZZER
#define LCD_FEEDBACK_FREQUENCY_HZ 1000
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
#endif
in der Pins.h im Abschnitt Motherboard=13
müssen die Encoder Kontakte und die SD Card eingetragen werden
Pins.h
/**************************************************
* LCD Panelolu *
***************************************************/
#define BTN_EN1 11
#define BTN_EN2 10
#define BTN_ENC -1 // -1 deswegen, weil der Click ja am IC MCP23017 angeschlossen ist
/**************************
* SD-Karte *
***************************/
#define SDPOWER -1
#define SDSS 20 // CS Pin for SD Card support