2025-11-21 11:59 AM
I was following the tutorial in the link:
https://www.youtube.com/watch?v=vy1c1LbypuM&list=PLfIJKC1ud8giOsk-C4BCOwSHtbXqTNb1W&index=3
I couldn't gett the upclick to count greater than 9 and below 0. the screenView.hpp and cpp as follows:
hpp:
#ifndef SCREEN1VIEW_HPP
#define SCREEN1VIEW_HPP
#include <gui_generated/screen1_screen/Screen1ViewBase.hpp>
#include <gui/screen1_screen/Screen1Presenter.hpp>
class Screen1View : public Screen1ViewBase
{
public:
Screen1View();
virtual ~Screen1View() {}
virtual void setupScreen();
virtual void tearDownScreen();
virtual void downclicked();
virtual void upclicked();
protected:
uint16_t counter = 0;
};
#endif // SCREEN1VIEW_HPP
cpp:
#include <gui/screen1_screen/Screen1View.hpp>
Screen1View::Screen1View()
{
}
void Screen1View::setupScreen()
{
Screen1ViewBase::setupScreen();
}
void Screen1View::tearDownScreen()
{
Screen1ViewBase::tearDownScreen();
}
void downclicked(){
counter--;
Unicode::snprintf(textArea1Buffer, TEXTAREA1_SIZE, "%u", counter);
textArea1.invalidate();
}
void upclicked(){
counter++;
Unicode::snprintf(textArea1Buffer, TEXTAREA1_SIZE, "%u", counter);
textArea1.invalidate();
}