Search found 126 matches
- Wed Oct 27, 2021 3:44 pm
- Forum: General Discussion and Questions
- Topic: How to remember value from sensor when button pressed
- Replies: 4
- Views: 1372
Re: How to remember value from sensor when button pressed
In MicroPython, no variable declaration, you just need to use one. from machine import Pin def get_heading(): # Your code to get heading pass def move_right(): # Your code to move right pass def move_left(): # Your code to move left pass button_pin = Pin(27, Pin.IN, Pin.PULL_UP) # Get first heading ...
- Tue Oct 26, 2021 9:16 pm
- Forum: General Discussion and Questions
- Topic: How to remember value from sensor when button pressed
- Replies: 4
- Views: 1372
Re: How to remember value from sensor when button pressed
I suppose you get heading value from the BNO055 with I2C.
Can you share a link to your current Arduino code? It will be easier to try to translate your code in MicroPython.
Can you share a link to your current Arduino code? It will be easier to try to translate your code in MicroPython.
- Tue Oct 26, 2021 5:11 am
- Forum: General Discussion and Questions
- Topic: Class Motor control. Pin setup ?
- Replies: 2
- Views: 1102
- Mon Oct 04, 2021 6:55 pm
- Forum: Programs, Libraries and Tools
- Topic: Multiaxis stepper motors using RMT
- Replies: 37
- Views: 29420
Re: Multiaxis stepper motors using RMT
On one axis, this seem to be doable, but this will depend on the number of acceleration and deceleration steps, because we are limited in memory. Regarding multi-axis method, this will not work as it has been wrote today. I plan to create g01() without acceleration / deceleration and an other one g0...
- Tue Jul 27, 2021 5:30 am
- Forum: ESP32 boards
- Topic: Compiled binary of micropython
- Replies: 5
- Views: 3464
- Thu Jul 22, 2021 5:28 am
- Forum: Programs, Libraries and Tools
- Topic: Problem running Micropython program on REPL
- Replies: 2
- Views: 1345
Re: Problem running Micropython program on REPL
Can you try this?
Depending on your schematic, you may have to use Pin(29, Pin.IN, Pin.PULL_UP) or Pin(29, Pin.IN, Pin.PULL_DOWN).
Code: Select all
from machine import Pin
waterdetect = Pin(29, Pin.IN)
if waterdetect.value():
print('1')
else:
print('0')
- Tue Jun 01, 2021 4:55 am
- Forum: Raspberry Pi microcontroller boards
- Topic: How to read Map() function in micropython?
- Replies: 11
- Views: 26290
- Sun Apr 18, 2021 8:16 am
- Forum: General Discussion and Questions
- Topic: Time control in a while loop
- Replies: 2
- Views: 1719
Re: Time control in a while loop
Did you try machine.Timer()? The documentation is available here.
- Tue Apr 13, 2021 10:27 am
- Forum: Programs, Libraries and Tools
- Topic: Porting Libraries important for Machine Learning to Micropython
- Replies: 4
- Views: 3868
Re: Porting Libraries important for Machine Learning to Micropython
You can look here, it's a project about Neural Network for MicroPython.
- Thu Apr 08, 2021 7:36 am
- Forum: ESP32 boards
- Topic: Is it possible to disable ADC?
- Replies: 3
- Views: 3284
Re: Is it possible to disable ADC?
Did you try to deinit ADC and Pin?
or maybe this method:
Code: Select all
from machine import ADC
pin_adc = Pin(32)
adc = ADC(pin_adc)
# your code
adc.deinit()
pin_adc.deinit()
Code: Select all
from machine import ADC
adc = ADC(Pin(32))
# your code
adc.deinit()