SensorTile

The official STMicroelectronics Arduino core
oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 2:26 pm

It compiles without error

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: SensorTile

Post by caniggia » Wed Nov 01, 2017 2:36 pm

OK, i have tried to compile your code with NUCLEO_L476RG and got this error:
'PG12' was not declared in this scope.
So you probably defined PG12 but apparently not ok.

Try with pin name PG_12 instead of PG12 in your blink sketch.

oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 2:48 pm

I tried with PG_12 in the sketch, that compiled without error as well, but did not work either.

Also added a #define LED2 PG_12, and used LED2 in the sketch, that also compiled without error, but did not work either.

I added PG_12 to variant.cpp, and PG12 to variant.h, in the same position of the respective array.

That took care of the " 'PG12' was not declared in this scope" error.

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: SensorTile

Post by caniggia » Wed Nov 01, 2017 2:54 pm

You don't have to add PG_12 anywhere, because it's allready in "PinNames.h":
https://github.com/stm32duino/Arduino_C ... mes.h#L151
Last edited by caniggia on Wed Nov 01, 2017 3:13 pm, edited 1 time in total.

oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 3:06 pm

Hmm.. Do you think because I added it to the .cpp file that would have any negative effect on it?

I'll have to play with it once I get home.

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: SensorTile

Post by caniggia » Wed Nov 01, 2017 3:49 pm

Choose "NUCLEO_L476RG" (not your ST SensorTile variant),
and try with PG_12 in your sketch.
So we can see if it works wit built-in PG_12.

oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 5:03 pm

I am using the NUCLEO_L476RG variant - haven't made my own yet.

Tried the PG_12 yesterday, same results - compiles but doesn't do anything.

The LED is definitely tied to PG12 too, here is the schematic: http://www.st.com/content/ccc/resource/ ... ematic.pdf

Also cross checked the BSP from ST, and they have LED2 tied to PG_12.

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: SensorTile

Post by caniggia » Wed Nov 01, 2017 6:32 pm

What changes did you do to variant.h & variant.cpp ?

oneselflost
Posts: 27
Joined: Mon Jul 24, 2017 2:32 am

Re: SensorTile

Post by oneselflost » Wed Nov 01, 2017 6:39 pm

Just added "PG12" to the bottom of the extern const PinName digitalPin[] array in variant.h, and "PG_12" to the bottom of that in variant.cpp (which you mentioned I won't need, I'll try it without that in the cpp tonight)

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: SensorTile

Post by caniggia » Wed Nov 01, 2017 6:55 pm

I toght you've put PG_12 next to PG12 in variant.h

Did you add PG12 in variant.h before PEND ?

Post Reply