TiLDA MK3/Get Started: Difference between revisions

From EMF Badge
Jump to navigation Jump to search
(Created page with "Upon connecting the badge to a computer, it should appear as a mass storage device, and a virtual serial port. Windows will require a driver file for the serial port, which is...")
 
No edit summary
Line 1: Line 1:
Upon connecting the badge to a computer, it should appear as a mass storage device, and a virtual serial port. Windows will require a driver file for the serial port, which is stored on the badge's mass storage. See here for full instructions.
= Get started ==
 
Hacking your TiLDA badge is easy. We've written it down step by step.
 
If something goes wrong, the badge can be [[TiLDA_MK3/reset|reset]] to its out-of-the-box state, so do not be concerned about breaking anything.
 
== 1. Connect to your computer ==
To get started you need to connect your badge to a computer. You can use any MicroUSB cable - the same type that charges most mobile phones nowadays. It doesn't matter whether the batter is plugged in or not, so don't worry about it.
 
== 2. Check your badge is found by your computer ==
Upon connecting the badge to a computer, it should appear as a "mass storage device" just like a USB key or an external hard disk.
 
'''Important:''' Just like any other USB storage device, if you changed or copied anything on the Badge, please make sure to "eject" or "safely remove" before unplugging your badge or pressing the reset button. Otherwise you might lose all your work :(
 
Windows will require a driver file for the serial port, which is stored on the badge's mass storage. [https://micropython.org/resources/Micro-Python-Windows-setup.pdf More information]
 
== 3. Check you have all the right software ==
 
== (Optional) 4. Update your badge ==
'You can skip this step', but since TiLDA is still a work in progress, it's best to update regularly. It's easy, just follow the instructions on [update.badge.emfcamp.org].
 
== 5. Download the pyboard.py script ==
 
== 6. Test that everything is working ==
 
== 7. Blink ==
 
== 8. Hello Screen ==
 
== 9. Buttons ==
 
== 10. Your own app ==
 
= Alternative ways to work with TiLDA =


All of the python code which runs on the badge can be modified on the mass storage device, and new apps can be added this way too. Be careful when using text editors to modify files on the device, if the mass storage is not 'safely removed' before removal, corruption of the file being edited can occur.
All of the python code which runs on the badge can be modified on the mass storage device, and new apps can be added this way too. Be careful when using text editors to modify files on the device, if the mass storage is not 'safely removed' before removal, corruption of the file being edited can occur.
When writing your own code, it is advised edit code on your computer, then copy it across to the badge, wait for the red 'writing' LED to go out, reset it, and run.
When writing your own code, it is advised edit code on your computer, then copy it across to the badge, wait for the red 'writing' LED to go out, reset it, and run.
This way you don't need to worry about safely removing the badge each time.
This way you don't need to worry about safely removing the badge each time.
If something goes wrong, the badge can be [[TiLDA_MK3/reset|reset]] to its out-of-the-box state, so do not be concerned about breaking anything.
 


To interactively run code on the badge, a python REPL can be accessed via the virtual serial port. Once you have found the serial port, use your favourite serial terminal to connect to the badge. Since the badge will be running the main software, press Ctrl+c to stop it, and the badge will display '>>>' to indicate it is ready to receive commands.
To interactively run code on the badge, a python REPL can be accessed via the virtual serial port. Once you have found the serial port, use your favourite serial terminal to connect to the badge. Since the badge will be running the main software, press Ctrl+c to stop it, and the badge will display '>>>' to indicate it is ready to receive commands.

Revision as of 21:16, 25 July 2016

Get started =

Hacking your TiLDA badge is easy. We've written it down step by step.

If something goes wrong, the badge can be reset to its out-of-the-box state, so do not be concerned about breaking anything.

1. Connect to your computer

To get started you need to connect your badge to a computer. You can use any MicroUSB cable - the same type that charges most mobile phones nowadays. It doesn't matter whether the batter is plugged in or not, so don't worry about it.

2. Check your badge is found by your computer

Upon connecting the badge to a computer, it should appear as a "mass storage device" just like a USB key or an external hard disk.

Important: Just like any other USB storage device, if you changed or copied anything on the Badge, please make sure to "eject" or "safely remove" before unplugging your badge or pressing the reset button. Otherwise you might lose all your work :(

Windows will require a driver file for the serial port, which is stored on the badge's mass storage. More information

3. Check you have all the right software

(Optional) 4. Update your badge

'You can skip this step', but since TiLDA is still a work in progress, it's best to update regularly. It's easy, just follow the instructions on [update.badge.emfcamp.org].

5. Download the pyboard.py script

6. Test that everything is working

7. Blink

8. Hello Screen

9. Buttons

10. Your own app

Alternative ways to work with TiLDA

All of the python code which runs on the badge can be modified on the mass storage device, and new apps can be added this way too. Be careful when using text editors to modify files on the device, if the mass storage is not 'safely removed' before removal, corruption of the file being edited can occur.

When writing your own code, it is advised edit code on your computer, then copy it across to the badge, wait for the red 'writing' LED to go out, reset it, and run. This way you don't need to worry about safely removing the badge each time.


To interactively run code on the badge, a python REPL can be accessed via the virtual serial port. Once you have found the serial port, use your favourite serial terminal to connect to the badge. Since the badge will be running the main software, press Ctrl+c to stop it, and the badge will display '>>>' to indicate it is ready to receive commands.

The badge runs micropython, and as a result does not contain everything you may expect from full python. See the micropython docs in the lniks below for more information. The badge has additional APIs, in particular for the LCD, Wifi and IMU, which are also listed below.