程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Two ways to brush raspberry pie Pico into micropython kernel

編輯:Python

One 、MicroPython brief introduction

MicroPython yes Python 3 Simple and efficient implementation of programming language , These include Python A small part of the standard library , And optimized , It can run in microcontroller and restricted environment .

Can be in 256k Code space and 16k Of RAM Internal installation and operation .

Official website :https://micropython.org/

Two 、 download Thonny

Thonny, yes MicroPython The development environment used .

Download url :https://thonny.org/

3、 ... and 、 download MicroPython The kernel of

1. Method 1

stay Raspberry Pi Pico Found on the BOOTSEL Button .

Hold down BOOTSEL Button , At the same time micro USB Connect the other end of the cable to the computer . This will your Raspberry Pi Pico in USB High capacity storage device .

stay Thonny The lower right corner of the window , You will see the currently used Python edition . single click Python Version and select “MicroPython (Raspberry Pi Pico)”:

A dialog box will pop up , In your Raspberry Pi Pico Install the latest version of MicroPython The firmware .

single click install Button to copy the firmware to your Raspberry Pi Pico.

2. Method 2

The first method is very convenient , But you need an extranet . If there are no conditions, you can choose method 2 .

stay Raspberry Pi Pico Found on the BOOTSEL Button .

Hold down BOOTSEL Button , At the same time micro USB Connect the other end of the cable to the computer . This will your Raspberry Pi Pico in USB High capacity storage device .

Go to the official website to download firmware , Then towed to RPI-RP2 Inside . Then insert it again .

You can use this link :https://micropython.org/download/rp2-pico/rp2-pico-latest.uf2 download

Or this link :https://micropython.org/resources/firmware/rp2-pico-20210902-v1.17.uf2 download

Four 、 Lighting test

MicroPython Added hardware specific modules , for example machine It can be used for Raspberry Pi Pico Programming .

Let's create a machine.Pin And onboard LED The corresponding object , have access to GPIO Pin 25 Access the object .

If you will LED Is set to 1, It will light up .

Enter the following code , Make sure to click... After each line Enter.

from machine import Pin
led = Pin(25, Pin.OUT)
led.value(1)

Type the code to set the value to 0 To close LED.

led.value(0)

More reference :

Raspberry pie PICO Official development documents :https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico

Raspberry pie PICO Brush in MicroPython More articles about the two ways of the kernel

  1. Linux Kernel analysis - Both ways use the same system call

    Experimental part According to the system call table , Select a system call . I chose mkdir This system call , Its system call number is 39, namely 0x27 because mkdir The prototype of the function is int mkdir (const char *filename, ...

  2. LInux Kernel analysis -- Use library functions API and C Code embedded assembly code, two ways to use the same system call

    The experimenter : Jiang Jun ID:fuchen1994 Description of the experiment : Select a system call (13 System call time With the exception of ), For a list of system calls, see http://codelab.shiyanlou.com/xref/linux-3 ...

  3. linux Kernel analysis job 4: Use library functions API and C Code embedded assembly code, two ways to use the same system call

    system call : Library functions encapsulate system calls , Dealing with system calls through library functions User mode : Low level execution state , The scope of control of the code will be limited . Kernel mode : High executive level , Code portability privilege directive , Access any physical address Why is it graded : If all the privileges ...

  4. Kernel knowledge is the first 12 speak ,SSDT surface . In two ways from user mode to system mode .

    Kernel knowledge is the first 12 speak ,SSDT surface . In two ways from user mode to system mode . I. 1 IDT analysis . We know .IDT All kinds of interrupt information are stored in the table . For example, when we call int 3 When , It will call IDT The third item in the table .  The function ...

  5. yum And compile two ways to upgrade or Downgrade Centos kernel

    http://blog.51cto.com/renzhiyuan/1882599 Today we are going to talk about yum There are two ways to upgrade or upgrade the kernel : upgrade : Like playing kvm,docker Wait for virtualization ,centos The kernel is upgraded ...

  6. Linux Summary of the fourth week of kernel design Use library functions API and C Code embedded assembly code, two ways to use the same system call

    Chen qiaoran's original works Reprint please indicate the source <Linux Kernel analysis >MOOC Course http://mooc.study.163.com/course/USTC-1000029000 The experiment purpose : Use library functions A ...

  7. Two ways of multi-threaded communication ? ( Reentrant lock ReentrantLock and Object)

    ( One )Java The two most common ways of thread cooperation in : (1) utilize Object Of wait().notify() and notifyAll() The method and synchronized (2) Use Condition.Reentra ...

  8. By calling C The library function of a language is similar to that in C The code uses two ways of inline assembly to use the same system call to analyze the working mechanism of system call

    By calling C The library function of a language is similar to that in C The code uses two ways of inline assembly to use the same system call to analyze the working mechanism of system call Preface explains This is Netease cloud class Linux Homework for the fourth week of kernel analysis , I'll call C The library function of a language is similar to that in C In the code ...

  9. [ Operating system knowledge reserve , Process related concepts , Two ways to start a process 、 process Queue Introduce ]

    [ Operating system knowledge reserve , Process related concepts , Two ways to start a process . process Queue Introduce ] Operating system knowledge review Why have an operating system . Programmers can't understand all the details of hardware operation , It's very tedious to manage and optimize these hardware ...

  10. placeholder Two ways to achieve

    /** * PlaceHolder Components * $(input).placeholder({ * word: // @string Tip text * color: // @string text color * evtT ...

Random recommendation

  1. Sql Server The journey —— The twelfth stop sqltext The parameterization of

    Speaking of sql The parameterization of , Are you kidding me? , because sql The engine is really a very powerful system , We usually add cache when we do the system , I think if there's no cache , There won't be anything Big websites can run , Moreover, large companies usually pay more attention to one thing ...

  2. [3D Parkour ] DataManager

    DataManager Manage in-game data , Of course, most of the properties and methods in this class are Public Function list

  3. PAT- Class B -1019. Digital black hole (20)

    1019. Digital black hole (20) The time limit 100 ms Memory limit 65536 kB Code length limit 8000 B The procedure of judging questions Standard author CHEN, Yue Given any number that is not exactly the same 4 position ...

  4. bzoj 3043 ( Differential sequence application )

    Maintain differential sequence Obviously, we need to make the post of the difference sequence n-1 Position as 0 For the original interval operation Only one point or two points are needed It's turned into For differential sequences, but with a number + or - Or a +1 At the same time - ans1=max(sum1,su ...

  5. Centos6.8 To solve the problem that the server is mined as a broiler

    I just went to work and found that some services couldn't run , Enter the server to check the reason : The first part : One ,#top Because I was just kill Drop once ,kill It will start automatically after the meeting , Before yam Process accounting cpu yes 200% Two ,# vim /etc/r ...

  6. [poj P2482] Stars in Your Window

    [poj P2482] Stars in Your Window Time Limit: 1000MS  Memory Limit: 65536K Description Fleeting time ...

  7. SpriteKit About categoryBitMask collisionBitMask contactTestBitMask Some problems encountered

    Handwriting copy Let's have an official explanation First of all categoryBitMask /** A mask that defines which category the physical rigid body belongs to . Each physical rigid body in a scene can be assigned to reach 32 Different categories ( Parameters int bitmas ...

  8. css Player button implementation

    design sketch html Code // Play button <div id="playBtn" class="circle" color: rgba(0, 0, 0, 0.32);margin-bottom: 8px;">1. package reflectionZ; import java.lang.reflect.Method; public class Treflection06 { public static ...

  9. poj 1696( Polar ordering )

    Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 3924   Accepted: 2457 Descrip ...


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved