Comments (13)
that error means that the AVR_ATmega1284 is not defined at compile time... maybe it is lacking a terminal p, try with AVR_ATmega1284P instead
and let me know if the code works so that we can include it into the lib
from arduinomenu.
Well I think I found a sollution.
I have changed the following in the PCINT.h file:
#if ( defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega16u4__) )
const uint8_t PROGMEM pcintPinMap[4][8]={{8,9,10,11,12,13,-1,-1},{A0,A1,A2,A3,A4,A5,-1,-1},{0,1,2,3,4,5,6,7},{-1,-1,-1,-1,-1,-1,-1,-1}};
#elif ( defined(__AVR_ATmega2560__) )
const uint8_t PROGMEM pcintPinMap[4][8]={{53,52,51,50,10,11,12,13},{0,15,14,-1,-1,-1,-1,-1},{A8,A9,A10,A11,A12,A13,A14,A15},{-1,-1,-1,-1,-1,-1,-1,-1}};
#elif ( defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644__))
const uint8_t PROGMEM pcintPinMap[4][8]={{A0,A1,A2,A3,A4,A5,A6,A7},{0,1,2,3,4,5,6,7},{16,17,18,19,20,21,22,23},{8,9,10,11,12,13,14,15}};
#else
#error "uC PCINT REVERSE MAP IS NOT DEFINED"
#endif
#define digitalPinFromPCINTSlot(slot,bit) pgm_read_byte(pcintPinMap+(((slot)<<4)+(bit)))
#define pcintPinMapBank(slot) ((uint8_t*)((uint8_t*)pcintPinMap+((slot)<<4)))
#define digitalPinFromPCINTBank(bank,bit) pgm_read_byte((uint8_t*)bank+bit)
It compilles but I still need to test it on the chip itself.
Ben
from arduinomenu.
Well I tried to run my code and unfortunatley it doesn't work. When I attach the encoder to D2 and D3 or D8 and D9 the chip seems to reset itself. On other digital pins I get no response. Maybe I did something wrong on the PCINT.h file.
I added my sketch.
from arduinomenu.
try making port B the first port (you can leave the rest as -1 for now, just for testing), and of coz wire the encoder to portB pins
from arduinomenu.
Tested with only the B ports in the PCINT file. No succes on this side. I only got response on the pins D2 and D3. But then the board resets itself.
from arduinomenu.
on the above pin map "PROGMEM pcintPinMap[4][8]" there should be ONLY 3 bytes defined, as this code derives from atmega328p code and event tables support only 3 port.
then, what board definition are you using? and what IDE?
looking on the net i saw several pin numbering for the atmega1284p, the board definition maps arbitrary numbers over port pins... so board definition is crucial.
original maps define port B,C,D pins to the board defined pin number, should preserve this port order because of the PCINT port handler vectors
from arduinomenu.
I tried "PROGMEM pcintPinMap[4][8]" as well as PROGMEM pcintPinMap[3][8]". With the B pins first and all the rest -1.
I'm woorking with the 1.6.9 IDE. I'm using the board definitions from this link: https://github.com/JChristensen/mighty-1284p/tree/v1.6.3
I'm using the Bobuino variant.
from arduinomenu.
const uint8_t PROGMEM pcintPinMap[3][8]={{21,20,19,18,17,16,15,14},{4,5,6,7,10,11,12,13},{22,23,24,25,26,27,28,29}};
can you check this?
based on:
home/Sketchbook/hardware/mighty-1284p/avr/variants/bobuino/pins_arduino.h
home/Sketchbook/hardware/mighty-1284p/avr/variants/bobuino/pins.ods
from arduinomenu.
Well I've tested your input. With the Bobuino board I can't get it to work. I instaled the Uno Pro files in the \Arduino\hardware\arduino\avr\variants folder that i got from the vendors page: http://www.hobbytronics.co.uk/arduino-uno-pro-1284p It seems for now that I only can use the Analog pins to work with the encoder.
from arduinomenu.
const uint8_t PROGMEM pcintPinMap[3][8]={{21,20,19,18,17,16,15,14},{4,5,2,3,10,11,12,13},{22,23,24,25,26,27,28,29}};
extracted from the pins_arduino.h file downloaded from that link, mapping for the Uno*Pro board...
from arduinomenu.
I have created this sketch that can be used on any arduino like board and print out to Serial the c++ definition of board pin map
https://github.com/neu-rah/PCINT/tree/master/examples/mkPCIntMap
from arduinomenu.
Thanks for the help on the issue. Now the scroling true the menu works. But the selection of the menu item doesn't work. Its like the arduino doesn't rec the pushbutton. I ve tested the button in another sketch en the hardware works. When i touch the knob the screen begins to flicker.
from arduinomenu.
what output device are you using? I've just pushed some corrections on the LCD driver to deal with PROGMEM (was causing resets)
can you open this as other issue? it helps further users
from arduinomenu.
Related Issues (20)
- EDIT via rotary encoder
- is your libary compatible with OLED display with 1309 controller
- Use of SSD1306ASCII_OUT HOT 1
- Not working without serial connection HOT 1
- TFT_eSPI and FreeFont (custom font) HOT 1
- error: reference to 'config' is ambiguous
- Full graphic smart controller - cannot get the ecnoder to scroll nicely
- Disable SerialOut HOT 1
- Starting integration of LCDGFX display driver with ArduinoMenu HOT 1
- Events on SELECT-submenu out of sync
- Feature Request: Have a way to disable a menu entry by default
- After defining MENU_DEBUG project doesn't compile for ESP32
- Example request: A working ESP32WebMenu example would be nice
- SubMenu does not respond unless extra menu item is added
- noMacros example should also show how to incorporate inputs and outputs without macros
- Doesn't compile with latest board ESP32 v. 3.0.0-alpha2
- Hide a menu
- Support for EA DOGM series of displays using SSD1803 controller IC
- Support for Initialization Outside of Main HOT 2
- Debouncing Buttons HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinomenu.