![]() |
I need your help (MPGuino code change for Arduino mega 2560?)
In MPGuino V0.86 entries for the injector and VSS Pins are made with these,
injector open D2 (int0) injector closed D3 (int1) speed C0 (pcint8) I needed to change the code of these Pins, so that work in Arduino mega 2560, which has D2 as (int4) and D3 as (INT5) and C0 there is no pcint8. What parts should I change the code and how should I do. Thank you José Rodrigues |
find:
#define RISING 3 #define FALLING 2 These into whatever interruptpins you are using. find: #define vssBit ( 1 << 0 ) 0 into whatever analog pin you are using. |
Quote:
Later I will post here the changes I made and a video with the result. Thank you José Rodrigues |
Not changed the (# define RISING 3) (# define FALLING 2), because I use the pin 2 and 3, which amends and the INT0 and INT1, which belongs to pins 20 and 21.
Part code of injectors. Code:
injectorSettleTime = injhold; Or put the value of the pin? The pin that I use is the "A8" which uses pin "62" on the arduino mega. If you have something wrong, please correct me. As shown in the video, the program starts fine, but then when I trigger any of the buttons does a reset type, do not know what causes it. https://www.youtube.com/watch?v=_oFHlihGZog If I can help I thank José Rodrigues |
Quote:
Code:
#define vssBit (1 << PINC0) Quote:
|
Quote:
mpguino_alt3_ino:251: error: 'PINK11' was not declared in this scope mpguino_alt3_ino:251: error: 'PINK12' was not declared in this scope mpguino_alt3_ino:251: error: 'PINK13' was not declared in this scope mpguino_alt3_ino.ino: In function 'void __vector_10()': mpguino_alt3_ino:398: error: 'PINK8' was not declared in this scope mpguino_alt3_ino.ino: In function 'void mainloop()': mpguino_alt3_ino:577: error: 'PINK11' was not declared in this scope mpguino_alt3_ino:577: error: 'PINK13' was not declared in this scope mpguino_alt3_ino:584: error: 'PINK12' was not declared in this scope mpguino_alt3_ino:608: error: 'PINK11' was not declared in this scope mpguino_alt3_ino:608: error: 'PINK12' was not declared in this scope mpguino_alt3_ino:608: error: 'PINK13' was not declared in this scope mpguino_alt3_ino:613: error: 'PINK11' was not declared in this scope mpguino_alt3_ino:613: error: 'PINK12' was not declared in this scope mpguino_alt3_ino:613: error: 'PINK13' was not declared in this scope mpguino_alt3_ino.ino: In function 'void editParm(byte)': mpguino_alt3_ino:1368: error: 'PINK11' was not declared in this scope mpguino_alt3_ino:1368: error: 'PINK13' was not declared in this scope mpguino_alt3_ino:1379: error: 'PINK12' was not declared in this scope mpguino_alt3_ino:1407: error: 'PINK11' was not declared in this scope mpguino_alt3_ino:1407: error: 'PINK12' was not declared in this scope mpguino_alt3_ino:1407: error: 'PINK13' was not declared in this scope mpguino_alt3_ino:1412: error: 'PINK11' was not declared in this scope mpguino_alt3_ino:1412: error: 'PINK12' was not declared in this scope mpguino_alt3_ino:1412: error: 'PINK13' was not declared in this scope Here is a picture to help with the mega pins. http://imageshack.us/a/img826/1596/l293.th.jpg Thank you José Rodrigues |
PinK? :)
|
Quote:
http://imageshack.us/a/img826/1596/l293.th.jpg |
The error above was my mistake, define, # define vssBit (1 << PINK8); # define lbuttonBit (1 << PINK11); # define mbuttonBit (1 << PINK12); # define rbuttonBit (1 << pink13), but these pins is not are the correct, the correct are# define vssBit (1 << PINK0); # define lbuttonBit (1 << pink3); # define mbuttonBit (1 << PINK4); # define rbuttonBit (1 << PINK5), the K Pins are 0 to 7.
I've been a bit sleep. But even with these changes, the problem remains. Will be a registration on the changes I made, what needs to be changed too? Any registration that points to a different Pin. Thank you José Rodrigues |
Can you give us a list of the interrupt vectors you're using? Such as -
Code:
ISR( TIMER2_OVF_vect ) { // system timer interrupt handler It turns out that the Arduino compiler would blindly accept anything placed within the "ISR()" parentheses. For my serial output ISR, I could have written: Code:
ISR( this_is_not_defined_vect ) { // serial UART transmit data ready vector The reason that is important is because if Arduino does not have the actual interrupt vector that is found in interrupts.h (mentioned near the beginning of the MPGuino code), then whatever is inside the ISR() parentheses will default to interrupt vector 0. That happens to be the processor reset vector. |
All times are GMT -4. The time now is 03:24 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com