Error in serial communication

Hi, i have a problem i cannot see / solve.

I have a code that runs a focus motor to a telescope with a program on my laptop via USB, it sends different serial commands to my arduino and the arduino sends data like steps etc. back to the program (FocusMax)

I started to mod that code so that i could run that motor with two buttons, in and out.
That worked well, later on, i bought a LCD that i wanted to display the steps the motor has turned, and a DHT22-sensor that displays temp and hygrometer.
To display the steps on the LCD and to not slow the motor down, i wrote the lcd.print outside the loop with a timer… i think it might be that who bugs?

I have the codes in the attached text file.

code.rtf (37.4 KB)

You can attach the code directly, without embedding it in an rtf document that is hard to read.

What type of motor controller if any do you use? How often do you need to send the control signal to change or maintain speed?

The motorcontroller is a easydriver and really dont know how often it sends commands, i could not post the code due to many characters :-/

i could not post the code due to many characters

So, you embedded the ino/pde in an rtf document, and attached that. Why didn't you just attach the ino/pde file?

PaulS:

i could not post the code due to many characters

So, you embedded the ino/pde in an rtf document, and attached that. Why didn’t you just attach the ino/pde file?

Good point :stuck_out_tongue:

SGL_Focuser_Driver_nolcd_2_0_0I.pde (13.6 KB)

SGL_Focuser_Driver_LCD_DHT_STEPS_BUTTONS.ino (16.5 KB)

LiquidCrystal lcd (12, 11, 10, 9, 7, 6);
HalfStepper myHalfStepper = HalfStepper(960, 9, 10, 11, 12);

So, what's REALLY connected to pins 9, 10, 11, and 12?

Nothing but the lcd is at pin 9... i wonder what halfstepper is, the only pin i have my easydriver at is pin 2 and 3...

I put all the lcd-related code in /* --- */ and now it works without any errors in SGL's FucusMax :)

Thanks for the help!

EDIT: That didnt work at all :/

Hmm... tried to reassign the pins regarding the half stepper but it seems to have some function even though i have the easy driver, can someone see what the myHalfStepper is doing?

I reassigned the myHalfStepper to pin (960, 961, 962, 963, 964) but received question marks in the "communication field" in SGL's FocusMax add-on...

can someone see what the myHalfStepper is doing?

Perhaps you could post a link to the library you are using.

Heres the library files…

I tried to change to this HalfStepper myHalfStepper = HalfStepper(960, 19, 110, 111, 112);
just to assign the half stepper to other pins… but the error message still is there…
when i put all the lcd-code within /* tags i didn’t recieve any error at all, what could be wrong? :confused:

i also attached a print screen of the program with the error message.

HalfStepper.zip (5.1 KB)

The motorcontroller is a easydriver

The EasyDriver doesn't need the Stepper or HalfStepper library. It has just two pins that connect to the Arduino. Set the dir pin HIGH or LOW to control the direction. Set the step pin HIGH then LOW to step.

Then, you don't have to worry about which 4 pins to use for the HalfStepper library.

I think you need to uncomment the LCD calls one at a time to see which one causes problems. I don't recognize the code you are trying to run. Nor do I see why the LCD should be interfering.

I have now changed all the pins on the librarys i dont have to use (helfstepper and powerpin) LCD works like a charm, it seems to be the code regarding the DHT-sensor and the float that gives me the errors... wonder how i am going to fix that :/

wonder how i am going to fix that

Wonder if you are going to repost the code.

PaulS:

wonder how i am going to fix that

Wonder if you are going to repost the code.

Good point :wink:

SGL_Focuser_Driver_LCD_DHT_STEPS_BUTTONS.ino (16.2 KB)

Are you using AF_Stepper or HalfStepper to control THE stepper motor?

none i think... i am using Easydriver, this code is written to support three kinds of motorsetups i think...

this code is written to support three kinds of motorsetups i think.

If you are NOT using it that way, delete the stuff you don't need.

So, now i have deleted all of the code that is not relevant and the program is running along fine now… and less stress on the arduino i think…
Now to the DHT-sensor and the float problem :confused:
Is there to many floats perhaps?

Deleted_SGL.ino (14.6 KB)

Again, I’d start with uncommenting one line at a time. You are aware, I hope, that reading the temperature and humidity with that sensor can take as much as 3/4 of a second.

I’m not sure I see the purpose of the EasyDriverStep() function when you don’t call it in loop().