[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/975/original/image0_%281%29.jpeg?1720736414","metadata":{"caption":"Two \"tricorders\" - \"Pycorder\" on left, Makecode Tricorder on right"}},{"element_type":"text","content":"\n        \u003cp\u003eIn 1968, I participated in my first Science Fair, and I saw a working Tricorder! It was another student's project, an assembly of different instruments for sensing things.\u0026nbsp; I know it included radiation as well as temperature. It had a form of an electrical analog computer as well for calculations. It was all wrapped in a case modeled after the imaginary Tricorders on Star Trek. Pretty impressive for the time (the show was only in it's second season)!\u003c/p\u003e\n\u003cp\u003eOf course, that was a fun project that many have improved upon - there was an\u0026nbsp;\u003ca href=\"https://en.wikipedia.org/wiki/Tricorder_X_Prize\" target=\"_blank\"\u003eX Prize\u003c/a\u003e awarded \u003cspan\u003efor creating a mobile device that can \"diagnose patients better than or equal to a panel of board certified physicians\". And fans have constructed working props - even ones that can provide a variety of sensor readings. It's a great example of how the art of an SF program has inspired real-world engineering and development.\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eMy own efforts are pretty modest, but it's fun to think about ways to craft a sort-of Tricorder device, given platforms like micro:bit or Circuit Playground Express with their multiple built in sensors. Early on I made a micro:bit\u0026nbsp;\u003ca title=\"Makecode code for a micro:bit Tricorder\" href=\"https://makecode.microbit.org/_htkcetJULWtg\" target=\"_blank\"\u003eversion\u003c/a\u003e\u003c/span\u003e\u003cspan\u003e that displayed compass reading, light level and temperature, along with a small vocabulary of \"alien\" words; easy to do with the 5x5 LED matrix on the micro:bit (this was V1 micro:bit, so it didn't use the microphone). There was even an animated picture of the Enterprise.\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eNow, the Circuit Playground Express has good sensors but there is no graphic display, just the ring of ten neopixels - so how do you display readings? I wrote functions to display numbers by converting them to a string, and then, digit by digit, lighting up enough pixels to indicate the value. In addition, for the Circuit Python version I recorded the digits 0-9, and \"point\" and \"minus\" so I could have the device speak the number. I also think it's fun to use Morse code to display info, so for the Makecode version, I added the ability to display a number of sayings (maybe not too practical, but it was fun).\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eI've saved all this in a\u0026nbsp;\u003ca title=\"code repository for Circuit Playground tricorders\" href=\"https://github.com/mrklingon/Tricorders\" target=\"_blank\"\u003erepository\u003c/a\u003e\u003c/span\u003e\u003cspan\u003e\u0026nbsp;- here's the README\u003c/span\u003e\u003c/p\u003e\n\u003ch1 class=\"heading-element\"\u003eTricorders\u003c/h1\u003e\n\u003ch1 class=\"heading-element\"\u003e\u003ca id=\"user-content-tricorders\" class=\"anchor\" href=\"https://github.com/mrklingon/Tricorders/blob/main/README.md#tricorders\"\u003e\u003c/a\u003e\u003c/h1\u003e\n\u003cp\u003eCode for Circuit Playground \"tricorders\"\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003epycorder.py - \"tricorder\" program; toggle through idle/temp/light/gees with button A, get reading with B\u003c/li\u003e\n\u003cli\u003ebach.py - provides musical notes, random music with touch A7, Star Wars Tune with A1\u003c/li\u003e\n\u003c/ul\u003e\n\u003chr\u003e\n\u003ch2 class=\"heading-element\"\u003esave .wav files in \"digits/\" directory 0.wav 1.wav 2.wav 3.wav 4.wav 5.wav 6.wav 7.wav 8.wav 9.wav gees.wav light.wav minus.wav point.wav temp.wav idle.wav\u003c/h2\u003e\n\u003ch1 class=\"heading-element\"\u003e\u003ca id=\"user-content-save-wav-files-in-digits-directory0wav1wav2wav3wav4wav5wav6wav7wav8wav9wavgeeswavlightwavminuswavpointwavtempwavidlewav\" class=\"anchor\" href=\"https://github.com/mrklingon/Tricorders/blob/main/README.md#save-wav-files-in-digits-directory0wav1wav2wav3wav4wav5wav6wav7wav8wav9wavgeeswavlightwavminuswavpointwavtempwavidlewav\"\u003e\u003c/a\u003e\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003eTricorder.js - Javascript version of CircuitPlayground Tricorder - toggle through idle/light/temp/gees/text modes with A+B, get reading with button A. when in \"text\" mode, tilt left/right to choose what phrase to display, press A to get morse code version\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003ch3\u003e\u003cspan style=\"text-decoration: underline;\"\u003e\u003cstrong\u003eTricorder.js\u003c/strong\u003e\u003c/span\u003e\u003c/h3\u003e\n\u003cp\u003eTo use the Javascript code, open up \u003ca title=\"Makecode for Circuit Playground\" href=\"https://makecode.adafruit.com\" target=\"_blank\"\u003ehttps://makecode.adafruit.com\u003c/a\u003e start a new project, switch to Javascript mode and paste in the code. (You can also go directly to this \u003ca title=\"Makecode IDE with Tricorder.\" href=\"https://makecode.com/_36yPPt1ahgUH\" target=\"_blank\"\u003elink\u003c/a\u003e)\u003c/p\u003e\n\u003cp\u003eWhen you run the Makecode version, the program starts by blinking \"hello\" in Morse, then in \"idle\" mode, swirling a rainbow. Press A+B to jump to the next mode. Each mode shows a distinctive color:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eLight (yellow)\u003c/li\u003e\n\u003cli\u003eTemperature (red)\u0026nbsp; - note, switching the CPX switch left, gives Fahrenheit, right give Celsius\u003c/li\u003e\n\u003cli\u003eSound (green)\u003c/li\u003e\n\u003cli\u003eText (blue)\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eWhen in a sensing mode, you'll see a real time graphing of the current value - press \"A\" to read the current numeric value.\u003c/p\u003e\n\u003cp\u003eWhen you are in \"text\" mode, tilt left and right to choose the phrase:\u003c/p\u003e\n\u003cp\u003e\u0026nbsp; \u0026nbsp;0:\u0026nbsp; spock = \"live long and prosper\"\u003cbr\u003e\u0026nbsp; \u0026nbsp;1:\u0026nbsp; yoda = \"do or do not\"\u003cbr\u003e\u0026nbsp; \u0026nbsp;2: yoda2 = \"size matters not\"\u003cbr\u003e\u0026nbsp; \u0026nbsp;3: yoda3 = \"luminous beings are we\"\u003cbr\u003e\u0026nbsp; \u0026nbsp;4: kirk = \"to boldly go\"\u003cbr\u003e\u0026nbsp; \u0026nbsp;5: picard = \"engage\"\u003c/p\u003e\n\u003cp\u003ePress A to see the words displayed in Morse code.\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003ch3\u003e\u003cstrong\u003eCircuitPython version: pycorder.py\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eThis requires you start with a Circuit Playground running Circuit Python (well, of course). Copy all the .wav files to a directory \"digits/\" and pycorder.py to code.py and bach.py on the CPX.\u003c/p\u003e\n\u003cp\u003eWhen it starts, it will flash a few colors, then announce \"idle\", going into swirling colors.\u003c/p\u003e\n\u003cp\u003eAdvance modes by pressing \"A\" button. Again, a signal color announces the mode switch, along with a voiced \"temp\", \"light\", \"gees\", \"idle\". When in a sensing mode, press B to get the current reading.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eTemp (red) - note, switching the CPX switch left, gives Fahrenheit, right give Celsius\u003c/li\u003e\n\u003cli\u003eLight (yellow)\u003c/li\u003e\n\u003cli\u003eGees (green) - note, \"gees\" willl announce THREE different values; the X, Y and the Z axis values\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eFor fun, the A1 touch pad will render a Star Wars tune, and A7 will play a snatch of random tones.\u003c/p\u003e\n\u003cp\u003e-------------------------------------------------\u003c/p\u003e\n\u003cp\u003eSo there you have it, my version of \"Tricorder\" - I'd love to see how others take that idea and make the imaginary real!\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      ","metadata":{}}]