Difference between revisions of "Cutipy-MicroPython LED Ring Counter demo"
(Created this page as an LED demo for the CutiPy) |
(Changed the instructions a bit) |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
1. CutiPy device running MicroPython | 1. CutiPy device running MicroPython | ||
* A personal computer | * A personal computer | ||
− | * [http://git.emacinc.com/micropython-public/micropython-helper-scripts/ | + | * [http://git.emacinc.com/micropython-public/micropython-helper-scripts/blob/master/ringCounter.py ringCounter.py script] |
</cl> | </cl> | ||
Line 16: | Line 16: | ||
* Copy ringCounter.py into the CutiPy drive | * Copy ringCounter.py into the CutiPy drive | ||
* Reset your CutiPy board to update the file system | * Reset your CutiPy board to update the file system | ||
− | * | + | * Establish a REPL terminal connection ([[ Cutipy_Getting_Started | Steps Covered Here ]]) |
− | * | + | * In the terminal, import the Ring Counter script using the following command |
<syntaxhighlight lang=python> | <syntaxhighlight lang=python> | ||
− | + | >> import ringCounter.py | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</cl> | </cl> | ||
==Demo== | ==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. | * 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. | * 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 + d | ||
+ | |||
+ | == Additional Information == | ||
+ | [http://wiki.emacinc.com/wiki/Micropython Micropython] | ||
+ | |||
+ | [http://wiki.emacinc.com/wiki/Micropython_Bluemix Bluemix on Micropython] | ||
+ | |||
+ | [http://wiki.emacinc.com/wiki/Wifi_and_mqtt_on_the_rs9113 Wifi and MQTT on the RS9113 in Micropython] | ||
+ | |||
+ | [[Cutipy-MicroPython Bluetooth LE demo | Cutipy-MicroPython Bluetooth LE demo]] |
Latest revision as of 16:00, 31 May 2022
Intro
Here we will demonstrate the functionality of the LED's on the CutiPy, in addition to timer interrupts and pushbutton functionality.
Required Materials
-
CutiPy device running MicroPython
-
A personal computer
Steps
ON YOUR PC:
-
Connect your CutiPy to your personal computer using a microUSB cable ( Steps Covered Here )
-
Copy ringCounter.py into the CutiPy drive
-
Reset your CutiPy board to update the file system
-
Establish a REPL terminal connection ( Steps Covered Here )
-
In the terminal, import the Ring Counter script using the following command
>> import ringCounter.py
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 + d