Cutipy-MicroPython LED Ring Counter demo

From wiki.emacinc.com
Revision as of 15:36, 31 May 2022 by Ebraun (talk | contribs) (Added the "Additional Information" section. It's worth noting that the link to the script is useless right now since the script hasn't been uploaded to GitLab. I'll change this one the script is uploaded.)
Jump to: navigation, search

Intro

Here we will demonstrate the functionality of the LED's on the CutiPy, in addition to timer interrupts and pushbutton functionality.

Required Materials

  1. CutiPy device running MicroPython

  2. A personal computer

  3. ringCounter.py script

Steps

ON YOUR PC:

  1. Connect your CutiPy to your personal computer using a microUSB cable ( Steps Covered Here )

  2. Copy ringCounter.py into the CutiPy drive

  3. Reset your CutiPy board to update the file system

  4. Download Thonny IDE and configure it for use with EMAC products ( Steps Covered Here )

  5. On the CutiPy drive, edit boot.py and uncomment the following line towards the bottom of the script:

    #pyb.main('main.py') # main script to run after this one
    
  6. Then, change the line to read 'ringCounter.py' instead of 'main.py', as shown below:

    pyb.main('ringCounter.py') # main script to run after this one
    
  7. Save the file, then establish a REPL terminal connection ( Steps Covered Here )

Demo

  • Press PB1 once quickly, and the LED's will begin to light in order, going from LED1-LED4 before restarting at LED1 again. Each time the LED's cycle, the REPL connection will display the number of cycles. Press PB1 again to stop the cycle.
  • Hold PB1 for a second, and the same thing happens, except this time the LED's cycle in reverse from LED4-LED1. Press PB1 again to stop the cycle.
  • To exit the demo, press ctrl + b

Additional Information

Micropython

Bluemix on Micropython

Wifi and MQTT on the RS9113 in Micropython

Cutipy-MicroPython Bluetooth LE demo