Skip to content
Jesús Capistrán
  • About me
  • Blog
  • Courses
  • Publications
  • Log In
  • Toggle website search
Menu Close
Search this website

Simulación de celdas solares SCAPS-1D

  • Home
  • Courses
  • Course
  • Simulación de celdas solares SCAPS-1D

Simulación de celdas solares SCAPS-1D

Curriculum

  • 1 Section
  • 7 Lessons
  • 1 Week
Expand all sectionsCollapse all sections
  • SCAPS-1D: FASnI3 perovskite
    Simulación basada en artículo científico publicado en marzo de 2020
    7
    • 3.1
      Lección 1: Revisión de literatura
    • 3.2
      Lección 2: Diseño de celda solar
    • 3.3
      Lección 3: Construcción de celda solar
    • 3.4
      Lección 4: Simulación de celda solar en iluminación
    • 3.5
      Leccion 5: Simulación de celda solar en obscuridad
    • 3.6
      Lección 6: Obtención de curva JV light + dark
    • 3.7
      Leccion 7: Variación de Rs mediante proceso batch

Use the REPL

Print Friendly, PDF & Email

Objective

  • Use the REPL (Read-Evaluate-Print-Loop)

Use REPL

The REPL means  Read-Evaluate-Print-Loop, this feature helps you to interact with the serial console that means you can program the Raspberry Pi Pico to measure “Somethin” like temperature and print it on the REPL. In The Mu Python editor, you can find it with the icon and label Serial

For more information, you can follow these web links.

  1. https://learn.adafruit.com/welcome-to-circuitpython/interacting-with-the-serial-console
  2. https://learn.adafruit.com/welcome-to-circuitpython/the-repl

Press Ctrl+c to enter REPL

If you are running the last code (blinking led), once you connect your board to Mu editor you will open the Serial then you will press CTRL + C to open the REPL. Here you will se the following statement:

Code done running.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040

>>>

The REPL will tell you the CircuitPython version (7.0.0) and your board (Raspberry Pi Pico with rp2040). Now you can interact introducin Python Code directly to the REPL (Terminal). The first command we are going to use is help()

>>> help()
Welcome to Adafruit CircuitPython 7.0.0!
Please visit learn.adafruit.com/category/circuitpython for project guides.

To list built-in modules please do `help("modules")`.

The response recommends to explore the buil-in modules of our board by executing the command help(“modules”) . Let’s see what happens.

>>> help("modules")
__main__          bitops            microcontroller   storage
_bleio            board             micropython       struct
_eve              builtins          msgpack           supervisor
adafruit_bus_device                 busio             neopixel_write    synthio
adafruit_pixelbuf collections       onewireio         sys
aesio             countio           os                terminalio
alarm             digitalio         pulseio           time
analogio          displayio         pwmio             touchio
array             errno             qrio              traceback
atexit            fontio            rainbowio         ulab
audiobusio        framebufferio     random            usb_cdc
audiocore         gc                re                usb_hid
audiomixer        getpass           rgbmatrix         usb_midi
audiomp3          imagecapture      rotaryio          vectorio
audiopwmio        io                rp2pio            watchdog
binascii          json              rtc
bitbangio         keypad            sdcardio
bitmaptools       math              sharpdisplay
Plus any modules on the filesystem
>>> 

These modules are built-in the board, these are the feature we can use without adding any other library. This can make us think if we are using other sensor or devices we will require to add some external libraries. However, for the moment we will work with the internal modules to explore the potential of the Raspberry Pi Pico + Mu Editor + REPL + Internal Temperature sensor.

import board

Try to import a module in this case use the command import board. After doing enter the command is execuated and you will see that nothing happens. However we have not seen any error too. Now try to execute the command dir(board) to explore all the components (pins) of the board that we can use right now.

>>> import board
>>> dir(board)
['__class__', '__name__', 'A0', 'A1', 'A2', 'A3', 'GP0', 'GP1', 'GP10', 'GP11', 'GP12', 'GP13', 'GP14', 'GP15', 'GP16', 'GP17', 'GP18', 'GP19', 'GP2', 'GP20', 'GP21', 'GP22', 'GP23', 'GP24', 'GP25', 'GP26', 'GP26_A0', 'GP27', 'GP27_A1', 'GP28', 'GP28_A2', 'GP3', 'GP4', 'GP5', 'GP6', 'GP7', 'GP8', 'GP9', 'LED', 'SMPS_MODE', 'VBUS_SENSE', 'VOLTAGE_MONITOR', 'board_id']
>>> 

Those are the list of name of pins we can use from the Raspberry Pi Pico. Look at the end of the list you will find a pin called LED. Now you can check those name with the following image Raspberry Pi Pico Pinout.

Pinout of the Raspberry Pi Pico

Return to serial console

To return to the serial console just press CTRL+D and you will see again the blinking led program. As you can see when you enter to REPL the program of the Raspberry Pi Pico is paused. In REPL mode you can interact directly with your board.

Activity ( Write on the comments below)

Leave a Reply Cancel reply

You must be logged in to post a comment.

Continue with Facebook
Continue with Google
  • About me
  • Blog
  • Courses
  • Publications
  • Log In
©Copyright 2025 - All thoughts and opinions are my own and do not reflect those of my institution.
  • About me
  • Blog
  • Courses
  • Publications
  • Log In
 

Loading Comments...
 

You must be logged in to post a comment.

    Modal title

    Main Content