

we can create variables based off of those resultsĬonsole.log("Promises started") // This object is just here so that this snippet makes sense on StackOverflow. which is an array of the words capitalized

The analog output from the LM35 should go to the A0 pin of your Arduino or Teensy. the next line waits until all the promies are done, and uses the result as the variable listOfWords, For other Arduino boards, consult the documentation on the Wire library. this converts the array of words into an array of promises generated by the sleepAndUppercase function defined aboveĪrr.map((word, i) => sleepAndUppercase(i, word)) () => resolve(word.toUpperCase()), seconds*1000 This function returns a promise that resolves after `seconds` amount of seconds, returning the value of `word` to uppercaseĬonst sleepAndUppercase = (seconds, word) => new Promise( Clearly, many libraries have yet to be tested. This page aims to collect all libraries with any modifications and special instructions specific to Teensy.
Teensy wire library code#
and, as MAS3 says, youd be better off asking about a Teensy in. Libraries Most code libraries designed for Arduino boards work on Teensy and Teensy++ with little or no modification. However the addresses from 0 to 7 are not used because are reserved so the first address that can be used is 8. shift the value one bit to the right), yielding an address between 0 and 127. Teensy 4.0 will fully erase its non-volatile memory and return the flash memory to a simple LED blink program if the program button is held between 13 to 17 seconds. If you have a datasheet or sample code that uses 8-bit address, you’ll want to drop the low bit (i.e. When specifying the I2C address to the Arduino/Teensy wire library, you must omit the R/W bit. The Wire library uses 7 bit addresses throughout. Generally on Teensys you need 2 pull-up resistors, one between SCL (pin 19/A5). This is an example of a function that returns a promise. I googled a bit, and found no references to teensy 3.1 and I2C, except for people having trouble with it. The BNO055Fusion library supports passing an I2C object by reference.
