Editing Arduino Nano RP2040 Connect

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
A simple IDE to program [[MicroPython]] on the board is the [[Arduino Lab for MicroPython]] IDE. Alternatives are, [[Jupyter Notebook]] or [[Thonny IDE]].
+
https://docs.arduino.cc/learn/programming/arduino-and-python
  
= Upgrade the Arduino Firmware =
+
https://docs.arduino.cc/hardware/nano-rp2040-connect
  
* Reinstall the MicroPython Firmware (version 1.22.2 tested)
+
https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-python-api#imu-lsm6dsox
* Install the [[Arduino IDE]]
 
* Start Arduino IDE and select the Arduino RP2040 board
 
* Go to Tools -> Firmware Update -> Check updates and select version 1.5.0 and press Install
 
  
= Install the MicroPython Firmware =
+
https://github.com/openmv/openmv/blob/918ccb937730cc759ee5709df089d9de516dc7bf/scripts/libraries/lsm6dsox.py
<b>Note:</b> Before installing [[MicroPython]] ensure you have the latest Arduino Firmware, see [[Arduino Nano RP2040 Connect#Upgrade the Arduino Firmware|Upgrade the Arduino Firmware]].
 
  
* Download the firmware for the Arduino Nano RP2040 Connect from https://micropython.org/download/ARDUINO_NANO_RP2040_CONNECT/
+
= Install the Arduino Nano RP2040 Connect Firmware =
* Unplug the board from the computer.
+
Download the firmware for the Arduino Nano RP2040 Connect from https://micropython.org/download/ARDUINO_NANO_RP2040_CONNECT/
* Force the board in bootloader mode by connecting GND and REC pin with a wire: https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-openmv-setup/
 
  
[[File:Arduino01a.jpg|x150px]] [[File:Bootpin.jpg|x150px]] [[File:Pinout-nano.png|x150px]]
+
Unplug the board from the computer.
 
+
   
* Plug the board into the USB port on your computer, it appears as a drive in your filesystem
+
Force the board in bootloader mode by connecting GND and REC pin with a wire:
 +
https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-openmv-setup/
 +
[[File:Arduino01a.jpg|200px]]
  
 +
Plug the board into the USB port on your computer, it appears as a drive in your filesystem
 
[[File:Drive01.png|200px]]
 
[[File:Drive01.png|200px]]
  
* Remove the wire between the GND and REC pin (before you copy the file onto the device)  
+
Remove the wire between the GND and REC pin (before you copy the file onto the device)  
* Copy the firmware you downloaded on the drive that showed up in your file system
 
  
 +
Copy the firmware you downloaded on the drive that showed up in your file system
 
[[File:file-copy.PNG|200px]]
 
[[File:file-copy.PNG|200px]]
  
* Once it is completely copied to the device, unplug the board and plug in again  
+
Once it is completely copied to the device, unplug the board and plug in again  
 
 
 
[[File:Arduino02a.PNG|200px]]
 
[[File:Arduino02a.PNG|200px]]
  
* Now you should be able to use Arduino Lab for the Micropython development environment: https://labs.arduino.cc/en/labs/micropython
+
Now you should be able to use Arduino Lab for Micropython development environment, https://labs.arduino.cc/en/labs/micropython
 
 
= Pinout =
 
 
 
[[File:Pinout-nano.png|400px]]
 
  
 
= How to control the Builtin LED MicroPython =
 
= How to control the Builtin LED MicroPython =
Line 53: Line 46:
 
       myLED.off()
 
       myLED.off()
 
       sleep(0.5)
 
       sleep(0.5)
</syntaxhighlight>
 
 
=== Example: Read Accelerometer and Gyro ===
 
<syntaxhighlight lang="python" line='line'>
 
import time
 
from lsm6dsox import LSM6DSOX
 
 
from machine import Pin, I2C
 
lsm = LSM6DSOX(I2C(0, scl=Pin(13), sda=Pin(12)))
 
 
while (True):
 
    accel_data = lsm.accel()
 
    print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*accel_data))
 
    gyro_data = lsm.gyro()
 
    print('Gyroscope:    x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*gyro_data))
 
    print("")
 
    time.sleep_ms(100)
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 155: Line 131:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==External links==
 
* https://docs.arduino.cc/learn/programming/arduino-and-python
 
* https://docs.arduino.cc/hardware/nano-rp2040-connect
 
* https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-python-api#imu-lsm6dsox
 
* https://github.com/openmv/openmv/blob/918ccb937730cc759ee5709df089d9de516dc7bf/scripts/libraries/lsm6dsox.py
 
 
[[Category:Microcontrollers]]
 
 
[[Category:Arduino Nano RP2040 Connect]]
 
[[Category:Arduino Nano RP2040 Connect]]

Please note that all contributions to Sketching with Hardware at LMU Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see My wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)