top of page

Forum Comments

Bittle not performing functions properly.
In General Discussions
Robert Bolling
Mar 21, 2021
OK, I’ve got my Bittle up and running and all the skills are working! Very cool. Here’s the compile error I was seeing, very similar to what Gary originally posted, though obviously we have slightly different paths: In file included from sketch/OpenCat.h:85:0, from /Users/rbolling/Library/Mobile Documents/com~apple~CloudDocs/github/OpenCat/WriteInstinct/WriteInstinct.ino:31: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/Wire.h: In member function 'void Motion::loadDataFromI2cEeprom(unsigned int&)': /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/Wire.h:68:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int) uint8_t requestFrom(int, int); ^~~~~~~~~~~ /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/Wire.h:65:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t) uint8_t requestFrom(uint8_t, uint8_t); ^~~~~~~~~~~ Sketch uses 25758 bytes (79%) of program storage space. Maximum is 32256 bytes. Global variables use 1372 bytes (66%) of dynamic memory, leaving 676 bytes for local variables. Maximum is 2048 bytes. Poking through OpenCat.h it seems the trouble was with line 559 where the compiler is confused by the call Wire.requestFrom function. The way I fixed it was to change the parameter “skillHeader” to a straight integer 4 (see below). I also tried another fix that also works by changing the declaration in line 558 to: int skillHeadder = 4; loadDataFromI2cEeprom(unsigned int &eeAddress) { Wire.beginTransmission(DEVICE_ADDRESS); Wire.write((int)((eeAddress) >> 8)); // MSB Wire.write((int)((eeAddress) & 0xFF)); // LSB Wire.endTransmission(); byte skillHeader = 4; // Wire.requestFrom(DEVICE_ADDRESS, skillHeader); //line 559 Wire.requestFrom(DEVICE_ADDRESS, 4);// <—-changed “skillHeader” to “4” period = Wire.read(); //PTL("read " + String(period) + " frames"); for (int i = 0; i < 2; i++) expectedRollPitch[i] = (int8_t)Wire.read(); angleDataRatio = Wire.read(); byte frameSize; if (period < -1) { skillHeader = 7; frameSize = 20; Wire.requestFrom(DEVICE_ADDRESS, 3); for (byte i = 0; i < 3; i++) loopCycle[i] = Wire.read(); } else frameSize = period > 1 ? WALKING_DOF : 16; int len = abs(period) * frameSize; //delete []dutyAngles;//check here Once I successfully compiled and loaded I still had to get the skills working. For me, both the manual section 6 on Calibration and Dobromir’s advice to type “YYY” were a bit misleading. Though both are essentially correct, you don’t just type “YYY” you actually must do each of those calibrations. If you type a Y at the servo calibration it zeros out any calibrations you did before. I’ve learned to write down my settings. This saves having to redo the tedious, but necessary servo calibration using the “L” gauge, I just re type in my numbers. Next the very first time you run WriteInstincts you HAVE to answer “Y” to update the instincts otherwise the instincts never get loaded. The manual is a bit misleading here because it implies you only say “Y” if you’ve changed anything. That’s true but you also have to say “Y” if it’s you first time through. Next you really have to calibrate the sensor with the Bittle body flat, all servo legs move out and up out of the way otherwise he’s a bit unstable. Now own to teaching Bittle new tricks!
0
0

Robert Bolling

More actions
bottom of page