AaronDayton
New member
Good morning,
I messaged Paul on Facebook last night and was directed to this forum for some assistance.
I'm not a C++ expert by any means but I enjoy the challenge of typing code and hitting compile and it either working or not
Onto my project.
I have a Teensy 3.0
I have an SSD1306 128x64 display
Arduino 1.8.2 IDE
U8g2 library 2.15.2
Some wire.
The end goal is to create an 8 temp thermocouple display.
The source code.
What I know,
On an arduino nano and teensy 2.0 the code works as expected with using the correct HW specific pins for SDA and SCL
On a teensy 3.0 the code works as expected with
But this is where my skills tend to fall off a cliff...
My understanding is I would use one of these lines of code for the Teensy 3.0
I picked up a Rigol DS1054Z a year or so ago when they came out, hot deals... I probed the hardware SPI pins on the Teensy 3.0 and they don't do a thing.
After googling a couple things I found a couple threads but just quite don't understand it based on my current skillset, but it sounds like it isn't a unknown problem.
I found the code
https://github.com/FriedCircuits/Ug8lib_Teensy
This looks quite old though, I installed the library just dropping it into the libraries directory tried to include the .h file in my code and it kind of dumps.
So moving on, im kind of going in a couple different directions and not sure what to do....
I'm looking for what I need to throw into my code to get this thing to work Software SPI is super slow.. also to note the LED low/high code is just for me to watch something blink and visually see how fast the code loops... fyi its not very fast.
Thank you for the assistance!
--Aaron
I messaged Paul on Facebook last night and was directed to this forum for some assistance.
I'm not a C++ expert by any means but I enjoy the challenge of typing code and hitting compile and it either working or not
Onto my project.
I have a Teensy 3.0
I have an SSD1306 128x64 display
Arduino 1.8.2 IDE
U8g2 library 2.15.2
Some wire.
The end goal is to create an 8 temp thermocouple display.
The source code.
Code:
#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#include <u8g_teensy.h>
#endif
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, 2, 3);
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0);
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_SSD1306_128X64_NONAME_F_2ND_HW_I2C u8g2(U8G2_R0);
int cyl01;
int cyl02;
int cyl03;
int cyl04;
int led = 13;
void setup(void) {
u8g2.begin();
u8g2.setFont(u8g2_font_6x13_mf );
pinMode(led, OUTPUT);
}
void loop(void) {
digitalWrite(led, HIGH);
u8g2.drawStr(0,9,"Cyl 1");
u8g2.drawStr(0,20,"CYL 2");
u8g2.drawStr(0,31,"CYL 3");
u8g2.drawStr(0,42,"CYL 4");
//u8g2.sendBuffer();
//u8g2.clearBuffer(); // clear the internal memory
//u8g2.setDrawColor(0);
cyl01 = random(1,100);
cyl02 = random(1,999);
cyl03 = random(1,999);
cyl04 = random(1,999);
u8g2.setCursor(36,9);
u8g2.print(cyl01);
u8g2.setCursor(36,20);
u8g2.print(cyl02);
u8g2.setCursor(36,31);
u8g2.print(cyl03);
u8g2.setCursor(36,42);
u8g2.print(cyl04);
digitalWrite(led, LOW);
u8g2.sendBuffer(); // transfer internal memory to the display
}
What I know,
On an arduino nano and teensy 2.0 the code works as expected with using the correct HW specific pins for SDA and SCL
Code:
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0);
On a teensy 3.0 the code works as expected with
Code:
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, 2, 3);
But this is where my skills tend to fall off a cliff...
My understanding is I would use one of these lines of code for the Teensy 3.0
Code:
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
U8G2_SSD1306_128X64_NONAME_F_2ND_HW_I2C u8g2(U8G2_R0);
I picked up a Rigol DS1054Z a year or so ago when they came out, hot deals... I probed the hardware SPI pins on the Teensy 3.0 and they don't do a thing.
After googling a couple things I found a couple threads but just quite don't understand it based on my current skillset, but it sounds like it isn't a unknown problem.
I found the code
https://github.com/FriedCircuits/Ug8lib_Teensy
This looks quite old though, I installed the library just dropping it into the libraries directory tried to include the .h file in my code and it kind of dumps.
C:\Tools\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Tools\Arduino\hardware -hardware C:\Users\Root\AppData\Local\Arduino15\packages -tools C:\Tools\Arduino\tools-builder -tools C:\Tools\Arduino\hardware\tools\avr -tools C:\Users\Root\AppData\Local\Arduino15\packages -built-in-libraries C:\Tools\Arduino\libraries -libraries C:\Users\Root\Documents\Arduino\libraries -fqbn=teensy:avr:teensy30:usb=serial,speed=96,opt=o2std,keys=en-us -vid-pid=0X16C0_0X0483 -ide-version=10802 -build-path C:\Users\Root\AppData\Local\Temp\arduino_build_854646 -warnings=none -build-cache C:\Users\Root\AppData\Local\Temp\arduino_cache_899282 -verbose C:\Users\Root\Documents\Arduino\EGT_SD1306_01\EGT_Display_01\EGT_Display_01.ino
C:\Tools\Arduino\arduino-builder -compile -logger=machine -hardware C:\Tools\Arduino\hardware -hardware C:\Users\Root\AppData\Local\Arduino15\packages -tools C:\Tools\Arduino\tools-builder -tools C:\Tools\Arduino\hardware\tools\avr -tools C:\Users\Root\AppData\Local\Arduino15\packages -built-in-libraries C:\Tools\Arduino\libraries -libraries C:\Users\Root\Documents\Arduino\libraries -fqbn=teensy:avr:teensy30:usb=serial,speed=96,opt=o2std,keys=en-us -vid-pid=0X16C0_0X0483 -ide-version=10802 -build-path C:\Users\Root\AppData\Local\Temp\arduino_build_854646 -warnings=none -build-cache C:\Users\Root\AppData\Local\Temp\arduino_cache_899282 -verbose C:\Users\Root\Documents\Arduino\EGT_SD1306_01\EGT_Display_01\EGT_Display_01.ino
Using board 'teensy30' from platform in folder: C:\Tools\Arduino\hardware\teensy\avr
Using core 'teensy3' from platform in folder: C:\Tools\Arduino\hardware\teensy\avr
Detecting libraries used...
"C:\Tools\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++11 -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX128__ -DTEENSYDUINO=137 -DARDUINO=10802 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Tools\Arduino\hardware\teensy\avr\cores\teensy3" "C:\Users\Root\AppData\Local\Temp\arduino_build_854646\sketch\EGT_Display_01.ino.cpp" -o "nul"
"C:\Tools\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++11 -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX128__ -DTEENSYDUINO=137 -DARDUINO=10802 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Tools\Arduino\hardware\teensy\avr\cores\teensy3" "-IC:\Users\Root\Documents\Arduino\libraries\U8g2\src" "C:\Users\Root\AppData\Local\Temp\arduino_build_854646\sketch\EGT_Display_01.ino.cpp" -o "nul"
"C:\Tools\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++11 -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX128__ -DTEENSYDUINO=137 -DARDUINO=10802 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Tools\Arduino\hardware\teensy\avr\cores\teensy3" "-IC:\Users\Root\Documents\Arduino\libraries\U8g2\src" "-IC:\Tools\Arduino\hardware\teensy\avr\libraries\SPI" "C:\Users\Root\AppData\Local\Temp\arduino_build_854646\sketch\EGT_Display_01.ino.cpp" -o "nul"
"C:\Tools\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++11 -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX128__ -DTEENSYDUINO=137 -DARDUINO=10802 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Tools\Arduino\hardware\teensy\avr\cores\teensy3" "-IC:\Users\Root\Documents\Arduino\libraries\U8g2\src" "-IC:\Tools\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Tools\Arduino\hardware\teensy\avr\libraries\Wire" "C:\Users\Root\AppData\Local\Temp\arduino_build_854646\sketch\EGT_Display_01.ino.cpp" -o "nul"
"C:\Tools\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++11 -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX128__ -DTEENSYDUINO=137 -DARDUINO=10802 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Tools\Arduino\hardware\teensy\avr\cores\teensy3" "-IC:\Users\Root\Documents\Arduino\libraries\U8g2\src" "-IC:\Tools\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Tools\Arduino\hardware\teensy\avr\libraries\Wire" "C:\Users\Root\AppData\Local\Temp\arduino_build_854646\sketch\EGT_Display_01.ino.cpp" -o "C:\Users\Root\AppData\Local\Temp\arduino_build_854646\preproc\ctags_target_for_gcc_minus_e.cpp"
C:\Users\Root\Documents\Arduino\EGT_SD1306_01\EGT_Display_01\EGT_Display_01.ino:6:24: fatal error: u8g_teensy.h: No such file or directory
compilation terminated.
Using library U8g2 at version 2.15.2 in folder: C:\Users\Root\Documents\Arduino\libraries\U8g2
Using library SPI at version 1.0 in folder: C:\Tools\Arduino\hardware\teensy\avr\libraries\SPI
Using library Wire at version 1.0 in folder: C:\Tools\Arduino\hardware\teensy\avr\libraries\Wire
Error compiling for board Teensy 3.0.
So moving on, im kind of going in a couple different directions and not sure what to do....
I'm looking for what I need to throw into my code to get this thing to work Software SPI is super slow.. also to note the LED low/high code is just for me to watch something blink and visually see how fast the code loops... fyi its not very fast.
Thank you for the assistance!
--Aaron