Teensy 2.0 with LabVIEW & teensyduino & LIFA

Status
Not open for further replies.

Mark

Well-known member
Teensy 2.0 & 3.1 with LabVIEW & teensyduino & LIFA

I'm getting compile errors when compiling the 'LVIFA_Base.ino' file. It complains about multiple instances of accelstepper.cpp. Compiles in the Arduino IDE without errors to an Uno. It works until installing teensyduino.

Assuming at one time this worked, what revs of LabVIEW, LVIFA (now LIFA) and teensyduino were used to verify it?

I'm using LabVIEW Dev 2012 (32-bit), LIFA 2.2.079, teensyduino 1.17 and a Teensy 2.0 on Win7-64bit.

<edit> Ok, it compiled and loaded to the teensy 2.0 without including the libraries in the teensyduino install. I'll go see how much more trouble I can get into. :) Since I haven't seen a documented step-by-step, and if anything can be broken I'll find the way, I'll post more progress - or lack of - as I go.

<edit2> Blink.vi works. Dare I try teensyduino 1.18rc3 with a teensy 3.1? Of course! If it ain't broke, fix it until it is :)

Thanks, Mark
 
Last edited:
Teensyduino 1.18rc3 worked ok for the 2.0 board. Compiling for the 3.1 threw these errors at compile.

******************
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.5 (Windows 7), Board: "Teensy 3.1"
AFMotor.cpp:94: error: #error "This chip is not supported!"
AFMotor.cpp:108: error: #error "This chip is not supported!"
AFMotor.cpp:125: error: #error "This chip is not supported!"
AFMotor.cpp:140: error: #error "This chip is not supported!"
AFMotor.cpp:158: error: #error "This chip is not supported!"
AFMotor.cpp:172: error: #error "This chip is not supported!"
AFMotor.cpp:192: error: #error "This chip is not supported!"
AFMotor.cpp:206: error: #error "This chip is not supported!"
In file included from AFMotor.cpp:13:0:
AFMotor.h:121: error: 'CS01' was not declared in this scope
AFMotor.cpp: In constructor 'AF_Stepper::AF_Stepper(uint16_t, uint8_t)':
AFMotor.cpp:310: error: 'CS20' was not declared in this scope
********************

Duh! These libraries were way before 3.x. The relevant code snippet which needs duplicated for 3.x is:
************
#if defined(__AVR_ATmega32U4__) && defined(CORE_TEENSY)
// Alternate pins when used on Teensy 2.0
// TODO: figure out pins & timers to make this work...
#define AFMOTOR_PWM1_NO_OUTPUT
#define AFMOTOR_PWM2_NO_OUTPUT
#define AFMOTOR_PWM3_NO_OUTPUT
#define AFMOTOR_PWM4_NO_OUTPUT
*****************
Looks to me like the strings "CORE_TEENSY" and "(__AVR_ATmega32U4__)" need to be replaced with the correct values from the ?IDE?Board readback? I have no idea what they'd be, or where to look - but I'll poke around. Please tell me if you know. :)

<EDIT> Found here - I hope,
http://forum.pjrc.com/threads/24634...no-1-17-Released?p=38353&viewfull=1#post38353

If that's all it takes, next stop the LINX libraries (successor to LVIFA/LIFA)??

(and yes, I am a total Arduino/Teensy newb getting in WAY over my head)

Mark
 
Last edited:
Added these lines:
*********************
#if defined(__MK20DX128__) && defined(CORE_TEENSY)
// Alternate pins when used on Teensy 3.0 - mark 2014-02-05
// TODO: figure out pins & timers to make this work...
#define AFMOTOR_PWM1_NO_OUTPUT
#define AFMOTOR_PWM2_NO_OUTPUT
#define AFMOTOR_PWM3_NO_OUTPUT
#define AFMOTOR_PWM4_NO_OUTPUT
#elif defined(__MK20DX256__) && defined(CORE_TEENSY)
// Alternate pins when used on Teensy 3.1 - mark 2014-02-05
// TODO: figure out pins & timers to make this work...
#define AFMOTOR_PWM1_NO_OUTPUT
#define AFMOTOR_PWM2_NO_OUTPUT
#define AFMOTOR_PWM3_NO_OUTPUT
#define AFMOTOR_PWM4_NO_OUTPUT
#endif
***********************

and now getting different errors. PROGRESS!?
*******************
Arduino: 1.0.5 (Windows 7), Board: "Teensy 3.1"
C:\Program Files (x86)\Arduino\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=117 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy3 -IC:\Program Files (x86)\Arduino\libraries\Wire -IC:\Program Files (x86)\Arduino\libraries\SPI -IC:\Program Files (x86)\Arduino\libraries\Servo -IC:\Program Files (x86)\Arduino\libraries\LiquidCrystal C:\Users\Mark\AppData\Local\Temp\build3675111296492445353.tmp\AccelStepper.cpp -o C:\Users\Mark\AppData\Local\Temp\build3675111296492445353.tmp\AccelStepper.cpp.o

C:\Program Files (x86)\Arduino\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=117 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy3 -IC:\Program Files (x86)\Arduino\libraries\Wire -IC:\Program Files (x86)\Arduino\libraries\SPI -IC:\Program Files (x86)\Arduino\libraries\Servo -IC:\Program Files (x86)\Arduino\libraries\LiquidCrystal C:\Users\Mark\AppData\Local\Temp\build3675111296492445353.tmp\AFMotor.cpp -o C:\Users\Mark\AppData\Local\Temp\build3675111296492445353.tmp\AFMotor.cpp.o


In file included from AFMotor.cpp:13:0:
AFMotor.h:134: error: 'CS01' was not declared in this scope
AFMotor.cpp: In constructor 'AF_Stepper::AF_Stepper(uint16_t, uint8_t)':
AFMotor.cpp:310: error: 'CS20' was not declared in this scope
*****************

More reading...
 
Last edited:
Typo in Teensyduino 1.18rc3?

arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=117

Probably not the source of the AFMotor.cpp errors, but just something I noticed.
 
Status
Not open for further replies.
Back
Top