Search found 17 matches

by berke
Wed Nov 17, 2021 5:02 am
Forum: Raspberry Pi microcontroller boards
Topic: Raspberry pi pico making loop / OSError: core1 in use
Replies: 4
Views: 4479

Re: Raspberry pi pico making loop / OSError: core1 in use

It is possible you're running into this issue . I have encountered erratic behaviour accessing UARTs and SPI devices on the second core. You might want to consider achieving concurrency with uasyncio rather than dual core. Yes I was using UART for http response. That's why I guess. Now I am not usi...
by berke
Mon Nov 15, 2021 10:11 am
Forum: Raspberry Pi microcontroller boards
Topic: Raspberry pi pico making loop / OSError: core1 in use
Replies: 4
Views: 4479

Re: Raspberry pi pico making loop / OSError: core1 in use

You can only start a new thread once because you only have one spare core. If you want the motor to run continuously you want to do something like: def runstepper(): enaPin.low() while True: pulPin.low() time.sleep_ms(1) pulPin.high() time.sleep_ms(1) When I do something like that for hx711, it sto...
by berke
Mon Nov 15, 2021 7:04 am
Forum: Raspberry Pi microcontroller boards
Topic: Raspberry pi pico making loop / OSError: core1 in use
Replies: 4
Views: 4479

Raspberry pi pico making loop / OSError: core1 in use

Hello everyone, ı am using raspberry pi pico. When I write this line, stepper's full rotation is 5 seconds. def runstepper(): enaPin.low() pulPin.low() time.sleep_ms(1) pulPin.high() time.sleep_ms(1) while True: runstepper() When I wrote this code, stepper's full rotation is 2.24 minute. It is too s...
by berke
Sun Nov 14, 2021 6:47 pm
Forum: General Discussion and Questions
Topic: Stepper Motor with Loadcell
Replies: 8
Views: 3249

Re: Stepper Motor with Loadcell

What do you need two cores for? Even the oldest 8-bit microcontrollers were fast enough to manage motor drive and metering It didn't worked. What errors did you get? What did you expect and what did you get instead? I am not having error. I want to run stepper for one direction until hx711 measure ...
by berke
Fri Nov 12, 2021 11:41 am
Forum: General Discussion and Questions
Topic: Stepper Motor with Loadcell
Replies: 8
Views: 3249

Re: Stepper Motor with Loadcell

I used https://github.com/robert-hh/hx711/blob ... 711_pio.py this library, now I can use two cores. Stepper and loadcell working together without problem. Now I need to comunicate 2 cores :D . Thank you everyone.
by berke
Fri Nov 12, 2021 10:52 am
Forum: General Discussion and Questions
Topic: Stepper Motor with Loadcell
Replies: 8
Views: 3249

Re: Stepper Motor with Loadcell

I tried to use 2 core for better solution but I couldn't do that with this code hx711 is working but stepper is not working. Is there any Idea for me? I am not expert I started 2-3 months ago. import utime import _thread from machine import Pin from hx711 import HX711 from utime import sleep_us impo...
by berke
Fri Nov 12, 2021 5:43 am
Forum: General Discussion and Questions
Topic: Stepper Motor with Loadcell
Replies: 8
Views: 3249

Re: Stepper Motor with Loadcell

... When I write time.sleep_us(1) it is really really slow, I can't work like this.I think the problem is loadcell. Are you sure that you want to be using sleep_us(), which uses microseconds? Real physical sensors take a while to settle down, and it takes some time for an HX711 to read and send its...
by berke
Thu Nov 11, 2021 6:00 pm
Forum: General Discussion and Questions
Topic: Stepper Motor with Loadcell
Replies: 8
Views: 3249

Re: Stepper Motor with Loadcell

... When I write time.sleep_us(1) it is really really slow, I can't work like this.I think the problem is loadcell. Are you sure that you want to be using sleep_us(), which uses microseconds? Real physical sensors take a while to settle down, and it takes some time for an HX711 to read and send its...
by berke
Thu Nov 11, 2021 5:59 pm
Forum: General Discussion and Questions
Topic: Stepper Motor with Loadcell
Replies: 8
Views: 3249

Re: Stepper Motor with Loadcell

When I add oadcell>= 200 gr . I am trying to write but when I write like this: CODE: SELECT ALL def calcWeight(import,isbigger=True): isWeightOk = True while isWeightOk: for i in range(250): enaPin.low() pulPin.low() time.sleep_us(1) pulPin.high() time.sleep_us(1) val = (scales.stable_value()*(0.005...
by berke
Thu Nov 11, 2021 1:31 pm
Forum: General Discussion and Questions
Topic: Stepper Motor with Loadcell
Replies: 8
Views: 3249

Stepper Motor with Loadcell

Hello everyone, I am trying to use stepper motor with load cell. I want to run stepper motor until loadcell>= 200 gr . I am trying to write but when I write like this: def calcWeight(import,isbigger=True): isWeightOk = True while isWeightOk: enaPin.low() pulPin.low() time.sleep_us(1) pulPin.high() t...