Wio terminal and 'DDRD' error

Hello everybody! :slight_smile:
I’m trying to make Wio terminal work with the Grove sensor - infrared temperature sensor matrix (AMG8833) but once I open the code on the Arduino IDE and verified it tells me:

error: ‘DDRD’ was not declared in this scope

 #define TFT_DC_HIGH {DDRD | = 0x40; PORTD | = 0x40;}

what does it mean?
and how can I modify the code to make it work properly?
or alternatively is there a code to operate the sensor with the Wio terminal?

Many thanks for any help.

Hi @alberto1

We do have a demo with this sensor using Wio Terminal:

https://wiki.seeedstudio.com/Wio-Terminal-Thermal-Camera/

Hope you like this :smiley:

it still doesn’t work… same error…

When the does error appear? is this a compile error? Can you provide a screenshot when this happens so i have a better picture

Thanks

Arduino:1.8.12 (Windows 10), Scheda:“Seeeduino Wio Terminal, Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off”

In file included from C:\Users\Marco\Documents\Arduino\libraries\Seeed_AMG8833-master\TFTv2.cpp:23:0:

C:\Users\Marco\Documents\Arduino\libraries\Seeed_AMG8833-master/TFTv2.h: In member function ‘void TFT::sendCMD(unsigned char)’:

C:\Users\Marco\Documents\Arduino\libraries\Seeed_AMG8833-master/TFTv2.h:104:26: error: ‘DDRD’ was not declared in this scope

 #define TFT_DC_LOW  {DDRD |= 0x40;PORTD &=~ 0x40;}

                      ^

C:\Users\Marco\Documents\Arduino\libraries\Seeed_AMG8833-master/TFTv2.h:136:9: note: in expansion of macro ‘TFT_DC_LOW’

     TFT_DC_LOW;

     ^~~~~~~~~~

C:\Users\Marco\Documents\Arduino\libraries\Seeed_AMG8833-master/TFTv2.h:104:45: error: no match for ‘operator&=’ (operand types are ‘_EPortType’ and ‘int’)

 #define TFT_DC_LOW  {DDRD |= 0x40;PORTD &=~ 0x40;}

                                   ~~~~~~^~~~~

and line by line…

exit status 1
Errore durante la compilazione per la scheda Seeeduino Wio Terminal.

same problem now T.T
what is the problem?

Hi I downloaded the sample and I see what the problem is.

For some reason, the Seeed_AMG8833 library includes the TFTv2 library (which is a library for this TFT screen https://www.seeedstudio.com/2-8-TFT-Touch-Shield-V2-0.html ).

The TFTv2 library uses registers that only exist on the Atmel ATMega chips (DDRD is a pin direction register). It does NOT exist on the WIO Terminal’s SAMD51 chip (it’s pin direction register is named PINCFGy, not DDRD).

The good news is I simply went to the library directory and deleted the two files that pertain to the TFTv2 device. They are named TFTv2.cpp and TFTv2.h. The library can be found in your libraries directory where your sketches are stored.

The code at the link ansonhe97 posted compiled https://wiki.seeedstudio.com/Wio-Terminal-Thermal-Camera/ and I ‘assume’ it works. I don’t have an AMG8833 to test.

Let me know if this works.

Thanks a lot. Now I can try.

Please let me know if it works…

Hi @Dennis_Mabrey @youngil_sohn

That should be the problem, you may have an old verison of TFT library (whether in the AMG8833 library) or just an old version downloaded in your Arduino/libraries files. Can you please delete this file and try?

The TFT file should named sth like Seeed_Arduino_LCD

It works well.
Thank you so much !!!
I just deleted TFTv2.cpp and TFTv2.h.

1 Like

Great glad it works!

1 Like

Just an FYI I asked them to remove the TFTv2 portion from the AMG8833 library on Github and they just did. So anyone downloading the library should no longer have this problem if they download the library now.

2 Likes

it is so amazing and interesting. w/o TFTv2 library, we can get much insteresting system within 1 hour even for the youngsters. That is very very appealing points. I am really enjoying this software.

Yes we are looking at using it to teach children as well. We have a number of Arduino students… mostly doing robotics but we have pure electronic courses also.

This summer we have to teach online remotely and using the Grove sensors seem to reduce the complexity of wiring things up. Trying to debug a student’s wiring problem online is ‘difficult’.