hi,
sometimes its difficult to guess whats may be wrong
/* test_H0_stellwk_3
Testsketch for analog and digital Pins
for ARDIUNO Mega 2560
Status : 04.09.2023
Release : 1.2.0
Grund : 'Weichen rechts- u. linksabbiegend unterscheiden per Max- u. Min-Werte
*/
#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
//---------------Start PWMC-settings -------------------------------------------------------------
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40); //setup the board address 0
Adafruit_PWMServoDriver pwm2 = Adafruit_PWMServoDriver(0x41); //setup the board address 0
#define SERVOMIN 150 // This is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX 600 // This is the 'maximum' pulse length count (out of 4096)
#define SERVOCENTER 370 // = 0 degrees ?
//#define SERVOMIN_SW 350 // This is the 'minimum' pulse length count (out of 4096)
//#define SERVOMAX_SW 485 // 45 degrees
#define SERVOMIN_SW 100 // This is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX_SW 400 // 45 degrees
#define SERVOMIN_SW_LA 100 // This is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX_SW_LA 400 // 45 degrees
#define SERVOMIN_SW_RA 400 // This is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX_SW_RA 100 // 45 degrees
#define SW_DIR_TYPE_RIGHT true
#define SW_DIR_TYPE_LEFT false
#define SERVOMIN_FS 340 // This is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX_FS 390 // 10 degrees
//-- try to modify Angle
#define USMIN 100 // This is the rounded 'minimum' microsecond length based on the minimum pulse of 150
#define USMAX 700 // This is the rounded 'maximum' microsecond length based on the maximum pulse of 600
#define SERVO_FREQ 60 // Analog servos run at ~50-60 Hz updates
//#define MAX_CHANNELS 16 maximal verfĂĽgbare Kanaele
#define MAX_CHANNELS_SW 9
#define MAX_CHANNELS_FS 9
uint16_t pulselen = SERVOMIN;
uint16_t my_angle = 50;
uint8_t g1_event = 0;
uint8_t g2_event = 0;
//---------------Ende PWMC-settings -------------------------------------------------------------
// declare the lcd object for auto i2c address location
hd44780_I2Cexp lcd;
// LCD geometry
const int LCD_COLS = 20;
const int LCD_ROWS = 4;
int lcd_status = 0;
lcd_status = 1; //- makes no sense here , only to test for error-message
have checked this code with 'cppcheckgui.exe' : no error, no warning
in IDE the compile error raises at 'lcd_status = 1' and says
'lcd_status does not name a type'
other settings of variables genarate the same error..
in 'Tools' of IDE processor is correctly set to 'Arduino Mega or Mega2560'..
what happens here ?