Hello forum,
I bought the kit but I have a problem with the sourcecode for the grove smart plant care kit for arduino. I can not compile the sourcecode completly because I get the following error message:
Arduino: 1.8.11 (Windows 10), Board: “Arduino Uno WiFi Rev2, None (ATMEGA4809)”
[…]
C:\Users[…]\Documents\Arduino\Gardening_demo_Arduino\Gardening_demo_Arduino\Gardening\Gardening.ino: In function ‘void setup()’:
Gardening:136:11: error: no match for ‘operator|=’ (operand types are ‘PORT_t {aka PORT_struct}’ and ‘int’)
PORTB |= 0x21;
^
Library Wire in Version 1.0 in folder: C:\Users[…]\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.5\libraries\Wire is used
Library OLED_Display_128X64-master in Version 1.0.0 in folder: C:\Users[…]\Documents\Arduino\libraries\OLED_Display_128X64-master is used
Library EEPROM in Version 2.0 in folder: C:\Users[…]\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.5\libraries\EEPROM is used
Library Grove_Temperature_And_Humidity_Sensor-master in Version 1.0.0 in folder: C:\Users[…]\Documents\Arduino\libraries\Grove_Temperature_And_Humidity_Sensor-master is used
Library TimerOne_v9 in folder: C:\Users[…]\Documents\Arduino\libraries\TimerOne_v9 (legacy) is used
Library SI114X in folder: C:\Users[…]\Documents\Arduino\libraries\SI114X (legacy) is used
exit status 1
no match for ‘operator|=’ (operand types are ‘PORT_t {aka PORT_struct}’ and ‘int’)
What is the error? How can I fix the erorr?
I found a note that it is not allowed to use
(in line 135) with the CPU “ATMEGA4809”. Therefore I use
</s>DDRB|=0x21<e>
. I found the note on the following website:
</s>PORTB.DIRSET|=0x21;<e>
https://hackaday.io/project/134831/logs?sort=oldest. Is the information right?
Before I changed the source code I get the error message “‘DDRB’ was not declared in this scope”. I have not changed the source code anywhere else.
I hope someone can help me with the problem.
Hi,
Since the code is written for Arduino Uno model which is based on Atmel 328p 8-bit AVR Microcontroller, there might be issues witch the Arduini Uno Rev 2 and it can also be solvable. So can you first try the code with the Arduino and let me know the feedback please, then we can proceed further.
same Problem here i’m using a “Arduini Uno Rev 2”
Its the fisttime coding i am busy with learning python. I hope some one can help me fixing this.
For now its to complicated for me to understand how to make it work
this is the code
void setup() { /* Init OLED */ Wire.begin(); SeeedOled.init(); //initialze SEEED OLED display DDRB|=0x21; PORTB |= 0x21; SeeedOled.clearDisplay(); //clear the screen and set start position to top left corner SeeedOled.setNormalDisplay(); //Set display to normal mode (i.e non-inverse mode) SeeedOled.setPageMode(); //Set addressing mode to Page Mode
this is the error
`Gardening:135:10: error: lvalue required as left operand of assignment
DD0|=0x21;
^~~~
Gardening:136:11: error: no match for ‘operator|=’ (operand types are ‘PORT_t {aka PORT_struct}’ and ‘int’)
PORTB |= 0x21;
^
exit status 1
lvalue required as left operand of assignment`
Please provide a link for you to use the source code and we will test it.
@harm842017 This is really an old, old project. I can’t find the purpose of this project.Also, the project does not support Arduini Uno Rev 2
I know the seeed garden project is a old one. I was more hoping that it would be a easy fix with this board. I will buy the arduino uno rev3 and as i see this will fix the problem for know so i can learn c++.
Thank for the help.