Code is Available under Github repository: https://github.com/ArduWellBeingBot/Robot/
Download it and copy it into your Sketchbook directory.
A patch needs to be realize onto your Arduino hardware directories:
You have to add these 4 definition (digitalPinToPCICR, digitalPinToPCICRbit, digitalPinToPCMSK, digitalPinToPCMSKbit(p) ) into the pin_arduino.h file in these following directories:
- ...\Arduino\hardware\arduino\avr\variants\robot_control
- ...\Arduino\hardware\arduino\avr\variants\robot_motor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) | |
#define digitalPinToPCICRbit(p) 0 | |
#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) | |
#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) | |
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels | |
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; | |
#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) |
No comments:
Post a Comment