Teensy 4.0 - based Audio Guestbook

Quick question . Is this good to power the teensy board ? Or could it burn the board ? https://www.amazon.com/ICV-USB-Wall...lpcontext&ref_=fplfs&psc=1&smid=A4LYBGKZAPPLR

I haven't used that particular wall wart, but in general assuming the wall wart delivers USB power within specifications (i.e. 4.8 to 5.2 volts, and it provides at least 500mA of power) it should be fine. If you need more than 500 mA (or 0.5 amps) than the USB 2.0 specification calls for, then you need to check the unit to see if it can provide the amount of power that you need, and you also may need to check how you are providing power to the devices the Teensy is connected to. In general, you typically only need that much power if you are connecting to motors, servos, large amounts of LEDs, and/or large displays.
 
Finally sorted my buzzing issue. And it’s such a simple fix I’m annoyed I got stressed and didn’t try it sooner.
I had installed some wiring to the existing mic lines and soldered and heat shrunk additional wiring. When I did this, I soldered the wire directly to headers on the audio board - bad idea.
Now I’ve removed the additional wiring and added wire that has a header on the end and the buzzing has completely gone.

Annoying but hopefully someone else won’t cut the corner like me!
 
Code:
20:13:27.782 (ports 5): Begin, version=1.57, high-res time
20:13:27.782 (ports 5): LoadLibrary cfgmgr32 ok
20:13:27.782 (ports 5): LoadLibrary ntdll ok
20:13:27.786 (ports 5): callback 0024
20:13:27.786 (ports 5): callback 0081
20:13:27.789 (ports 5): callback 0083
20:13:27.789 (ports 5): hWnd = 3475668
20:13:27.792 (ports 5): nothing new, skipping HID & Ports enum
20:14:03.912 (ports 5): WM_DEVICECHANGE DBT_DEVICEARRIVAL
20:14:03.914 (ports 5): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:14:03.914 (ports 5): found_usb_device, loc=usb:0/140000/0/2    Port_#0002.Hub_#0001
20:14:03.914 (ports 5): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0107
20:14:03.914 (ports 5): found_usb_device, devinst=00000003
20:14:03.914 (ports 5): add: loc=usb:0/140000/0/2, class=HID, vid=16C0, pid=0478, ver=0107, serial=0011a9ee, dev=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:14:03.915 (ports 5): hiddev_from_devinst_list: iface=0
20:14:03.916 (ports 5): found_usb_device complete
20:14:03.918 (ports 5): hid, found devinst=00000007
20:14:03.918 (ports 5): hid, path=\\?\hid#vid_16c0&pid_0478#6&2bc5e7a5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
20:14:03.918 (ports 5): hid,  opened handle
20:14:03.918 (ports 5):  devinst=00000007, location=usb:0/140000/0/2
20:14:03.918 (ports 5):  vid=16C0, pid=0478, ver=0107, usepage=FF9C, use=0024
20:14:03.918 (ports 5):  devpath=\\?\hid#vid_16c0&pid_0478#6&2bc5e7a5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
20:14:03.919 (ports 5): usb_add: usb:0/140000/0/2  hid#vid_16c0&pid_0478 (Teensy 4.0) Bootloader
20:14:03.952 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:14:03.952 (ports 5): nothing new, skipping HID & Ports enum
20:14:31.461 (post_compile 1): Begin, version=1.57, high-res time
20:14:31.659 (loader): Teensy Loader 1.57, begin program
20:14:31.733 (loader): Listening for remote control on port 3149
20:14:31.733 (loader): initialized, showing main window
20:14:31.767 (loader): remote connection 1268 opened
20:14:31.768 (loader): remote cmd from 1268: "comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)"
20:14:31.768 (post_compile 1): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)
20:14:31.769 (loader): remote cmd from 1268: "status"
20:14:31.770 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:14:31.855 (loader): HID/win32:  vid:16C0 pid:0478 ver:0107  usb:0/140000/0/2
20:14:31.855 (loader): HID/win32:  usage_page:FF9C, usage:0024
20:14:31.856 (loader): secure mode can not be locked: this is Standard Teensy
20:14:31.856 (loader): encryption is possible on this Teensy, but not yet configured
20:14:31.856 (loader): but without secure mode locked, encryption will NOT be secure!
20:14:31.856 (loader): Device came online, code_size = 2031616
20:14:31.857 (loader): Board is: Teensy 4.0 (IMXRT1062), version 1.07
20:14:31.858 (loader): set background IMG_ONLINE
20:14:31.862 (post_compile 1): Status: 0, 0, 1, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_577662\, Part_1_02_Hardware_Test.ino.hex
20:14:31.862 (post_compile 1): Sending command: dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\
20:14:31.862 (loader): remote cmd from 1268: "dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\"
20:14:31.862 (loader): remote cmd from 1268: "file:Blink.ino.hex"
20:14:31.862 (post_compile 1): Sending command: file:Blink.ino.hex
20:14:31.869 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\Blink.ino.hex", 19456 bytes
20:14:31.869 (loader): File "Blink.ino.hex". 19456 bytes, 1% used
20:14:31.920 (loader): remote cmd from 1268: "status"
20:14:31.920 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :-)
20:14:31.921 (post_compile 1): Status: 1, 0, 1, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\, Blink.ino.hex
20:14:31.921 (post_compile 1): Disconnect
20:14:31.932 (loader): remote connection 1268 closed
20:14:32.012 (post_compile 2): Begin, version=1.57, high-res time
20:14:32.013 (loader): remote connection 1268 opened
20:14:32.013 (loader): remote cmd from 1268: "comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)"
20:14:32.013 (loader): remote cmd from 1268: "status"
20:14:32.014 (post_compile 2): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)
20:14:32.014 (loader): remote cmd from 1268: "dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\"
20:14:32.014 (loader): remote cmd from 1268: "file:Blink.ino.hex"
20:14:32.015 (post_compile 2): Status: 1, 0, 1, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\, Blink.ino.hex
20:14:32.015 (post_compile 2): Sending command: dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\
20:14:32.015 (post_compile 2): Sending command: file:Blink.ino.hex
20:14:32.021 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\Blink.ino.hex", 19456 bytes
20:14:32.021 (loader): File "Blink.ino.hex". 19456 bytes, 1% used
20:14:32.068 (loader): remote cmd from 1268: "status"
20:14:32.069 (post_compile 2): Status: 1, 0, 1, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\, Blink.ino.hex
20:14:32.069 (post_compile 2): Disconnect
20:14:32.087 (loader): remote connection 1268 closed
20:14:32.087 (post_compile 3): Running teensy_reboot: "C:\Program Files (x86)\Arduino\hardware\teensy\..\tools\teensy_reboot.exe" teensy_reboot.exe "-board=TEENSY40" "-port=usb:0/140000/0/2" "-portlabel=hid#vid_16c0&pid_0478 Bootloader" "-portprotocol=Teensy"
20:14:32.088 (loader): remote connection 1268 opened
20:14:32.105 (reboot 4): Begin, version=1.57, high-res time
20:14:32.105 (reboot 4): location = usb:0/140000/0/2
20:14:32.105 (reboot 4): portlabel = hid#vid_16c0&pid_0478 Bootloader
20:14:32.105 (reboot 4): portprotocol = Teensy
20:14:32.105 (reboot 4): Only location usb:0/140000/0/2 will be tried
20:14:32.105 (reboot 4): LoadLibrary cfgmgr32 ok
20:14:32.105 (reboot 4): LoadLibrary ntdll ok
20:14:32.106 (reboot 4): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:14:32.106 (reboot 4): found_usb_device, loc=usb:0/140000/0/2    Port_#0002.Hub_#0001
20:14:32.106 (reboot 4): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0107
20:14:32.106 (reboot 4): found_usb_device, devinst=00000003
20:14:32.106 (reboot 4): add: loc=usb:0/140000/0/2, class=HID, vid=16C0, pid=0478, ver=0107, serial=0011a9ee, dev=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:14:32.106 (reboot 4): hiddev_from_devinst_list: iface=0
20:14:32.108 (reboot 4): found_usb_device complete
20:14:32.108 (reboot 4): hid, found devinst=00000007
20:14:32.109 (reboot 4): usb scan found 1 devices
20:14:32.110 (loader): remote connection 1312 opened
20:14:32.110 (loader): remote cmd from 1312: "show:arduino_attempt_reboot"
20:14:32.110 (loader): got request to show arduino rebooting message
20:14:32.111 (reboot 4): found Teensy Loader, version 1.57
20:14:32.111 (reboot 4): Sending command: show:arduino_attempt_reboot
20:14:32.114 (reboot 4): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_reboot)
20:14:32.114 (loader): remote cmd from 1312: "comment: Teensyduino 1.57 - WINDOWS (teensy_reboot)"
20:14:32.114 (loader): remote cmd from 1312: "status"
20:14:32.114 (loader): remote cmd from 1312: "auto:on"
20:14:32.114 (reboot 4): Status: 1, 0, 1, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\, Blink.ino.hex
20:14:32.114 (reboot 4): send: auto:on
20:14:32.114 (reboot 4): Sending command: auto:on
20:14:32.115 (reboot 4): Disconnect
20:14:32.123 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\Blink.ino.hex", 19456 bytes
20:14:32.123 (loader): File "Blink.ino.hex". 19456 bytes, 1% used
20:14:32.176 (loader): elf appears to be for Teensy 4.0 (IMXRT1062) (2031616 bytes)
20:14:32.176 (loader): elf binary data matches hex file
20:14:32.176 (loader): elf file is for Teensy 4.0 (IMXRT1062)
20:14:32.176 (loader): using hex file
20:14:32.227 (loader): begin operation
20:14:32.240 (loader): remote connection 1312 closed
20:14:32.241 (loader): remote connection 1268 closed
20:14:32.247 (loader): flash, block=0, bs=1024, auto=1
20:14:32.248 (loader): flash, block=1, bs=1024, auto=1
20:14:32.248 (loader): flash, block=2, bs=1024, auto=1
20:14:32.570 (loader): flash, block=3, bs=1024, auto=1
20:14:32.570 (loader): flash, block=4, bs=1024, auto=1
20:14:32.574 (loader): flash, block=5, bs=1024, auto=1
20:14:32.575 (loader): flash, block=6, bs=1024, auto=1
20:14:32.577 (loader): flash, block=7, bs=1024, auto=1
20:14:32.579 (loader): flash, block=8, bs=1024, auto=1
20:14:32.579 (loader): flash, block=9, bs=1024, auto=1
20:14:32.581 (loader): flash, block=10, bs=1024, auto=1
20:14:32.582 (loader): flash, block=11, bs=1024, auto=1
20:14:32.584 (loader): flash, block=12, bs=1024, auto=1
20:14:32.585 (loader): flash, block=13, bs=1024, auto=1
20:14:32.586 (loader): flash, block=14, bs=1024, auto=1
20:14:32.588 (loader): flash, block=15, bs=1024, auto=1
20:14:32.589 (loader): flash, block=16, bs=1024, auto=1
20:14:32.591 (loader): flash, block=17, bs=1024, auto=1
20:14:32.592 (loader): flash, block=18, bs=1024, auto=1
20:14:32.604 (loader): sending reboot
20:14:32.604 (loader): begin wait_until_offline
20:14:32.614 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
20:14:32.661 (loader): offline, waited 1
20:14:32.661 (loader): end operation, total time = 0.435 seconds
20:14:32.663 (loader): set background IMG_REBOOT_OK
20:14:32.665 (loader): redraw timer set, image 14 to show for 1200 ms
20:14:32.665 (loader): remote connection 1308 opened
20:14:32.668 (ports 5): remove: loc=usb:0/140000/0/2
20:14:32.668 (ports 5): usb_remove: usb:0/140000/0/2
20:14:32.668 (ports 5): nothing new, skipping HID & Ports enum
20:14:32.670 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:14:32.670 (ports 5): nothing new, skipping HID & Ports enum
20:14:32.718 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:14:32.718 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:14:32.719 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:14:32.719 (loader): HID/win32:  vid:06CB pid:7F28 ver:0003  usb:150000/1
20:14:32.719 (loader): HID/win32:  vid:06CB pid:7F28 ver:0003  usb:150000/1
20:14:32.998 (ports 5): WM_DEVICECHANGE DBT_DEVICEARRIVAL
20:14:32.999 (ports 5): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#11576140#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:14:32.999 (ports 5): found_usb_device, loc=usb:0/140000/0/2    Port_#0002.Hub_#0001
20:14:32.999 (ports 5): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
20:14:32.999 (ports 5): found_usb_device, devinst=00000014
20:14:32.999 (ports 5): add: loc=usb:0/140000/0/2, class=USB, vid=16C0, pid=0483, ver=0279, serial=11576140, dev=\\?\usb#vid_16c0&pid_0483#11576140#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:14:32.999 (ports 5):   comport_from_devinst_list attempt
20:14:32.999 (ports 5):   found Ports in classguid_list at index=1
20:14:32.999 (ports 5):   port COM5 found from devnode
20:14:32.999 (ports 5): found_usb_device complete
20:14:33.000 (ports 5): usb_add: usb:0/140000/0/2  COM5 (Teensy 4.0) Serial
20:14:33.020 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:14:33.021 (ports 5): nothing new, skipping HID & Ports enum
20:14:33.034 (ports 5): WM_DEVICECHANGE DBT_DEVICEARRIVAL
20:14:33.035 (ports 5): nothing new, skipping HID & Ports enum
20:14:33.035 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:14:33.036 (ports 5): nothing new, skipping HID & Ports enum
20:14:33.861 (loader): redraw, image 9
20:14:40.949 (loader): Verbose Info event
20:15:27.420 (serialmon 6): Begin, version=1.57, high-res time
20:15:27.420 (serialmon 6): listening for location: usb:0/140000/0/2
20:15:27.420 (serialmon 6): LoadLibrary cfgmgr32 ok
20:15:27.420 (serialmon 6): LoadLibrary ntdll ok
20:15:27.423 (serialmon 6): callback 0024
20:15:27.423 (serialmon 6): callback 0081
20:15:27.426 (serialmon 6): callback 0083
20:15:27.426 (serialmon 6): hWnd = 526472
20:15:27.426 (serialmon 6): loop stdin, ready=262143
20:15:27.427 (serialmon 6): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#11576140#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:15:27.427 (serialmon 6): found_usb_device, loc=usb:0/140000/0/2    Port_#0002.Hub_#0001
20:15:27.427 (serialmon 6): found_usb_device, devinst=00000002
20:15:27.427 (serialmon 6): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
20:15:27.427 (serialmon 6): add: loc=usb:0/140000/0/2, class=USB, vid=16C0, pid=0483, ver=0279, serial=11576140, dev=\\?\usb#vid_16c0&pid_0483#11576140#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:15:27.427 (serialmon 6):   comport_from_devinst_list attempt
20:15:27.427 (serialmon 6):   found Ports in classguid_list at index=1
20:15:27.427 (serialmon 6):   port COM5 found from devnode
20:15:27.427 (serialmon 6): found_usb_device complete
20:15:27.429 (serialmon 6): usb_add: usb:0/140000/0/2
20:15:27.429 (serialmon 6): translate "COM5" -> "\\.\COM5"
20:15:27.455 (serialmon 6): GetDefaultCommConfig success
20:15:27.480 (serialmon 6): SetDefaultCommConfig success
20:15:27.480 (serialmon 6): Opened \\.\COM5 Serial
20:15:27.481 (ports 5): callback 001A
20:15:27.509 (loader): remote connection 2028 opened
20:15:29.469 (loader): remote connection 2028 closed
20:17:54.219 (post_compile 7): Begin, version=1.57, high-res time
20:17:54.221 (loader): remote connection 1584 opened
20:17:54.222 (loader): remote cmd from 1584: "comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)"
20:17:54.222 (loader): remote cmd from 1584: "status"
20:17:54.222 (post_compile 7): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)
20:17:54.224 (post_compile 7): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_679220\, Blink.ino.hex
20:17:54.224 (post_compile 7): Sending command: dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\
20:17:54.225 (loader): remote cmd from 1584: "dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\"
20:17:54.225 (post_compile 7): Sending command: file:Part_1_02_Hardware_Test.ino.hex
20:17:54.225 (loader): remote cmd from 1584: "file:Part_1_02_Hardware_Test.ino.hex"
20:17:54.239 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\Part_1_02_Hardware_Test.ino.hex", 73728 bytes
20:17:54.239 (loader): File "Part_1_02_Hardware_Test.ino.hex". 73728 bytes
20:17:54.244 (loader): remote cmd from 1584: "status"
20:17:54.246 (post_compile 7): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.246 (post_compile 7): Disconnect
20:17:54.271 (loader): remote connection 1584 closed
20:17:54.343 (post_compile 8): Begin, version=1.57, high-res time
20:17:54.344 (loader): remote connection 1560 opened
20:17:54.345 (loader): remote cmd from 1560: "comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)"
20:17:54.345 (loader): remote cmd from 1560: "status"
20:17:54.345 (post_compile 8): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)
20:17:54.347 (loader): remote cmd from 1560: "dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\"
20:17:54.347 (loader): remote cmd from 1560: "file:Part_1_02_Hardware_Test.ino.hex"
20:17:54.347 (post_compile 8): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.347 (post_compile 8): Sending command: dir:C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\
20:17:54.347 (post_compile 8): Sending command: file:Part_1_02_Hardware_Test.ino.hex
20:17:54.361 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\Part_1_02_Hardware_Test.ino.hex", 73728 bytes
20:17:54.361 (loader): File "Part_1_02_Hardware_Test.ino.hex". 73728 bytes
20:17:54.366 (loader): remote cmd from 1560: "status"
20:17:54.368 (post_compile 8): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.368 (post_compile 8): Disconnect
20:17:54.380 (loader): remote connection 1560 closed
20:17:54.380 (loader): remote connection 1728 opened
20:17:54.380 (post_compile 9): Running teensy_reboot: "C:\Program Files (x86)\Arduino\hardware\teensy\..\tools\teensy_reboot.exe" teensy_reboot.exe "-board=TEENSY40" "-port=usb:0/140000/0/2" "-portlabel=hid#vid_16c0&pid_0478 Bootloader" "-portprotocol=Teensy"
20:17:54.391 (reboot 10): Begin, version=1.57, high-res time
20:17:54.391 (reboot 10): location = usb:0/140000/0/2
20:17:54.391 (reboot 10): portlabel = hid#vid_16c0&pid_0478 Bootloader
20:17:54.391 (reboot 10): portprotocol = Teensy
20:17:54.391 (reboot 10): Only location usb:0/140000/0/2 will be tried
20:17:54.391 (reboot 10): LoadLibrary cfgmgr32 ok
20:17:54.391 (reboot 10): LoadLibrary ntdll ok
20:17:54.391 (reboot 10): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#11576140#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:17:54.391 (reboot 10): found_usb_device, loc=usb:0/140000/0/2    Port_#0002.Hub_#0001
20:17:54.391 (reboot 10): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
20:17:54.391 (reboot 10): found_usb_device, devinst=00000002
20:17:54.391 (reboot 10): add: loc=usb:0/140000/0/2, class=USB, vid=16C0, pid=0483, ver=0279, serial=11576140, dev=\\?\usb#vid_16c0&pid_0483#11576140#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:17:54.391 (reboot 10):   comport_from_devinst_list attempt
20:17:54.391 (reboot 10):   found Ports in classguid_list at index=1
20:17:54.391 (reboot 10):   port COM5 found from devnode
20:17:54.391 (reboot 10): found_usb_device complete
20:17:54.393 (reboot 10): usb scan found 1 devices
20:17:54.394 (loader): remote connection 1564 opened
20:17:54.394 (loader): remote cmd from 1564: "show:arduino_attempt_reboot"
20:17:54.394 (loader): got request to show arduino rebooting message
20:17:54.395 (reboot 10): found Teensy Loader, version 1.57
20:17:54.395 (reboot 10): Sending command: show:arduino_attempt_reboot
20:17:54.397 (reboot 10): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_reboot)
20:17:54.398 (loader): remote cmd from 1564: "comment: Teensyduino 1.57 - WINDOWS (teensy_reboot)"
20:17:54.398 (loader): remote cmd from 1564: "status"
20:17:54.400 (reboot 10): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.400 (reboot 10): do_reset (serial) COM5
20:17:54.403 (loader): remote cmd from 1564: "status"
20:17:54.405 (reboot 10): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.405 (reboot 10): status read, retry 0
20:17:54.441 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
20:17:54.442 (ports 5): remove: loc=usb:0/140000/0/2
20:17:54.442 (ports 5): usb_remove: usb:0/140000/0/2
20:17:54.442 (ports 5): nothing new, skipping HID & Ports enum
20:17:54.450 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
20:17:54.451 (ports 5): nothing new, skipping HID & Ports enum
20:17:54.505 (loader): remote cmd from 1564: "status"
20:17:54.509 (reboot 10): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.509 (reboot 10): status read, retry 1
20:17:54.611 (loader): remote cmd from 1564: "status"
20:17:54.613 (reboot 10): Status: 1, 1, 0, 1, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.613 (reboot 10): status read, retry 2
20:17:54.703 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:17:54.704 (ports 5): nothing new, skipping HID & Ports enum
20:17:54.711 (ports 5): WM_DEVICECHANGE DBT_DEVICEARRIVAL
20:17:54.712 (ports 5): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:17:54.712 (ports 5): found_usb_device, loc=usb:0/140000/0/2    Port_#0002.Hub_#0001
20:17:54.712 (ports 5): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0107
20:17:54.712 (ports 5): found_usb_device, devinst=00000003
20:17:54.712 (ports 5): add: loc=usb:0/140000/0/2, class=HID, vid=16C0, pid=0478, ver=0107, serial=0011a9ee, dev=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:17:54.712 (ports 5): hiddev_from_devinst_list: iface=0
20:17:54.713 (ports 5): found_usb_device complete
20:17:54.714 (ports 5): usb_add: usb:0/140000/0/2  [no_device] (Teensy 4.0) Bootloader
20:17:54.714 (loader): remote cmd from 1564: "status"
20:17:54.715 (loader): secure mode can not be locked: this is Standard Teensy
20:17:54.715 (loader): encryption is possible on this Teensy, but not yet configured
20:17:54.715 (loader): but without secure mode locked, encryption will NOT be secure!
20:17:54.715 (loader): Device came online, code_size = 2031616
20:17:54.715 (loader): Board is: Teensy 4.0 (IMXRT1062), version 1.07
20:17:54.735 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\Part_1_02_Hardware_Test.ino.hex", 73728 bytes
20:17:54.735 (loader): File "Part_1_02_Hardware_Test.ino.hex". 73728 bytes, 4% used
20:17:54.786 (loader): set background IMG_ONLINE
20:17:54.802 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\Part_1_02_Hardware_Test.ino.hex", 73728 bytes
20:17:54.802 (loader): File "Part_1_02_Hardware_Test.ino.hex". 73728 bytes, 4% used
20:17:54.854 (loader): elf appears to be for Teensy 4.0 (IMXRT1062) (2031616 bytes)
20:17:54.855 (loader): elf binary data matches hex file
20:17:54.855 (loader): elf file is for Teensy 4.0 (IMXRT1062)
20:17:54.855 (loader): using hex file
20:17:54.902 (loader): begin operation
20:17:54.917 (reboot 10): Status: 1, 1, 1, 2, 0, 1, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:54.924 (loader): flash, block=0, bs=1024, auto=1
20:17:54.925 (loader): flash, block=1, bs=1024, auto=1
20:17:54.925 (loader): flash, block=2, bs=1024, auto=1
20:17:54.925 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:17:54.926 (ports 5): hid, found devinst=00000007
20:17:54.926 (ports 5): hid, path=\\?\hid#vid_16c0&pid_0478#6&2bc5e7a5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
20:17:54.926 (ports 5): hid,  opened handle
20:17:54.926 (ports 5):  devinst=00000007, location=usb:0/140000/0/2
20:17:54.926 (ports 5):  vid=16C0, pid=0478, ver=0107, usepage=FF9C, use=0024
20:17:54.926 (ports 5):  devpath=\\?\hid#vid_16c0&pid_0478#6&2bc5e7a5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
20:17:54.926 (ports 5): usb_add: usb:0/140000/0/2  hid#vid_16c0&pid_0478 (Teensy 4.0) Bootloader
20:17:55.077 (loader): remote cmd from 1564: "status"
20:17:55.077 (loader): flash, block=3, bs=1024, auto=1
20:17:55.078 (reboot 10): Status: 1, 1, 1, 2, 0, 1, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:55.078 (loader): flash, block=4, bs=1024, auto=1
20:17:55.084 (loader): flash, block=5, bs=1024, auto=1
20:17:55.087 (loader): flash, block=6, bs=1024, auto=1
20:17:55.090 (loader): flash, block=7, bs=1024, auto=1
20:17:55.093 (loader): flash, block=8, bs=1024, auto=1
20:17:55.095 (loader): flash, block=9, bs=1024, auto=1
20:17:55.097 (loader): flash, block=10, bs=1024, auto=1
20:17:55.103 (loader): flash, block=11, bs=1024, auto=1
20:17:55.105 (loader): flash, block=12, bs=1024, auto=1
20:17:55.106 (loader): flash, block=13, bs=1024, auto=1
20:17:55.108 (loader): flash, block=14, bs=1024, auto=1
20:17:55.109 (loader): flash, block=15, bs=1024, auto=1
20:17:55.110 (loader): flash, block=16, bs=1024, auto=1
20:17:55.112 (loader): flash, block=17, bs=1024, auto=1
20:17:55.113 (loader): flash, block=18, bs=1024, auto=1
20:17:55.115 (loader): flash, block=19, bs=1024, auto=1
20:17:55.116 (loader): flash, block=20, bs=1024, auto=1
20:17:55.117 (loader): flash, block=21, bs=1024, auto=1
20:17:55.118 (loader): flash, block=22, bs=1024, auto=1
20:17:55.120 (loader): flash, block=23, bs=1024, auto=1
20:17:55.121 (loader): flash, block=24, bs=1024, auto=1
20:17:55.138 (loader): remote cmd from 1564: "status"
20:17:55.139 (reboot 10): Status: 1, 1, 1, 2, 0, 1, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:55.139 (loader): flash, block=25, bs=1024, auto=1
20:17:55.140 (loader): flash, block=26, bs=1024, auto=1
20:17:55.142 (loader): flash, block=27, bs=1024, auto=1
20:17:55.143 (loader): flash, block=28, bs=1024, auto=1
20:17:55.145 (loader): flash, block=29, bs=1024, auto=1
20:17:55.147 (loader): flash, block=30, bs=1024, auto=1
20:17:55.148 (loader): flash, block=31, bs=1024, auto=1
20:17:55.150 (loader): flash, block=32, bs=1024, auto=1
20:17:55.151 (loader): flash, block=33, bs=1024, auto=1
20:17:55.152 (loader): flash, block=34, bs=1024, auto=1
20:17:55.153 (loader): flash, block=35, bs=1024, auto=1
20:17:55.154 (loader): flash, block=36, bs=1024, auto=1
20:17:55.156 (loader): flash, block=37, bs=1024, auto=1
20:17:55.173 (loader): flash, block=38, bs=1024, auto=1
20:17:55.174 (loader): flash, block=39, bs=1024, auto=1
20:17:55.176 (loader): flash, block=40, bs=1024, auto=1
20:17:55.176 (loader): flash, block=41, bs=1024, auto=1
20:17:55.178 (loader): flash, block=42, bs=1024, auto=1
20:17:55.179 (loader): flash, block=43, bs=1024, auto=1
20:17:55.181 (loader): flash, block=44, bs=1024, auto=1
20:17:55.182 (loader): flash, block=45, bs=1024, auto=1
20:17:55.183 (loader): flash, block=46, bs=1024, auto=1
20:17:55.184 (loader): flash, block=47, bs=1024, auto=1
20:17:55.203 (loader): remote cmd from 1564: "status"
20:17:55.203 (loader): flash, block=48, bs=1024, auto=1
20:17:55.203 (reboot 10): Status: 1, 1, 1, 2, 0, 1, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:55.204 (loader): flash, block=49, bs=1024, auto=1
20:17:55.206 (loader): flash, block=50, bs=1024, auto=1
20:17:55.207 (loader): flash, block=51, bs=1024, auto=1
20:17:55.209 (loader): flash, block=52, bs=1024, auto=1
20:17:55.210 (loader): flash, block=53, bs=1024, auto=1
20:17:55.212 (loader): flash, block=54, bs=1024, auto=1
20:17:55.214 (loader): flash, block=55, bs=1024, auto=1
20:17:55.216 (loader): flash, block=56, bs=1024, auto=1
20:17:55.218 (loader): flash, block=57, bs=1024, auto=1
20:17:55.219 (loader): flash, block=58, bs=1024, auto=1
20:17:55.220 (loader): flash, block=59, bs=1024, auto=1
20:17:55.221 (loader): flash, block=60, bs=1024, auto=1
20:17:55.223 (loader): flash, block=61, bs=1024, auto=1
20:17:55.225 (loader): flash, block=62, bs=1024, auto=1
20:17:55.227 (loader): flash, block=63, bs=1024, auto=1
20:17:55.229 (loader): flash, block=64, bs=1024, auto=1
20:17:55.230 (loader): flash, block=65, bs=1024, auto=1
20:17:55.231 (loader): flash, block=66, bs=1024, auto=1
20:17:55.232 (loader): flash, block=67, bs=1024, auto=1
20:17:55.234 (loader): flash, block=68, bs=1024, auto=1
20:17:55.236 (loader): flash, block=69, bs=1024, auto=1
20:17:55.238 (loader): flash, block=70, bs=1024, auto=1
20:17:55.240 (loader): flash, block=71, bs=1024, auto=1
20:17:55.261 (loader): remote cmd from 1564: "status"
20:17:55.261 (reboot 10): Status: 1, 1, 1, 2, 0, 2, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:55.262 (loader): sending reboot
20:17:55.263 (loader): begin wait_until_offline
20:17:55.278 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
20:17:55.278 (ports 5): remove: loc=usb:0/140000/0/2
20:17:55.278 (ports 5): usb_remove: usb:0/140000/0/2
20:17:55.278 (ports 5): nothing new, skipping HID & Ports enum
20:17:55.321 (loader): offline, waited 1
20:17:55.321 (loader): end operation, total time = 0.419 seconds
20:17:55.322 (loader): set background IMG_REBOOT_OK
20:17:55.324 (loader): redraw timer set, image 14 to show for 1200 ms
20:17:55.324 (loader): remote cmd from 1564: "status"
20:17:55.325 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:17:55.325 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:17:55.326 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:17:55.326 (loader): HID/win32:  vid:06CB pid:7F28 ver:0003  usb:150000/1
20:17:55.326 (loader): HID/win32:  vid:06CB pid:7F28 ver:0003  usb:150000/1
20:17:55.326 (reboot 10): Status: 1, 1, 0, 2, 0, 0, C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\, Part_1_02_Hardware_Test.ino.hex
20:17:55.326 (reboot 10): status read, retry 3
20:17:55.326 (reboot 10): Success
20:17:55.326 (reboot 10): Disconnect
20:17:55.328 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:17:55.328 (ports 5): nothing new, skipping HID & Ports enum
20:17:55.349 (loader): remote connection 1564 closed
20:17:55.351 (loader): remote connection 1728 closed
20:17:56.537 (loader): redraw, image 9
20:17:56.897 (ports 5): purge, name=hid#vid_16c0&pid_0478 (Teensy 4.0) Bootloader, loc=usb:0/140000/0/2, age=1.619 sec
20:18:05.544 (loader): Verbose Info event
20:18:25.852 (ports 5): WM_DEVICECHANGE DBT_DEVICEARRIVAL
20:18:25.855 (ports 5): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:18:25.855 (ports 5): found_usb_device, loc=usb:0/140000/0/2    Port_#0002.Hub_#0001
20:18:25.855 (ports 5): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0107
20:18:25.855 (ports 5): found_usb_device, devinst=00000003
20:18:25.855 (ports 5): add: loc=usb:0/140000/0/2, class=HID, vid=16C0, pid=0478, ver=0107, serial=0011a9ee, dev=\\?\usb#vid_16c0&pid_0478#0011a9ee#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
20:18:25.858 (ports 5): hiddev_from_devinst_list: iface=0
20:18:25.859 (ports 5): found_usb_device complete
20:18:25.861 (ports 5): usb_add: usb:0/140000/0/2  [no_device] (Teensy) Bootloader
20:18:25.874 (loader): secure mode can not be locked: this is Standard Teensy
20:18:25.874 (loader): encryption is possible on this Teensy, but not yet configured
20:18:25.874 (loader): but without secure mode locked, encryption will NOT be secure!
20:18:25.875 (loader): Device came online, code_size = 2031616
20:18:25.875 (loader): Board is: Teensy 4.0 (IMXRT1062), version 1.07
20:18:25.890 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\Part_1_02_Hardware_Test.ino.hex", 73728 bytes
20:18:25.890 (loader): File "Part_1_02_Hardware_Test.ino.hex". 73728 bytes, 4% used
20:18:25.938 (loader): set background IMG_ONLINE
20:18:25.955 (loader): File "C:\Users\dasau\AppData\Local\Temp\arduino_build_740553\Part_1_02_Hardware_Test.ino.hex", 73728 bytes
20:18:25.955 (loader): File "Part_1_02_Hardware_Test.ino.hex". 73728 bytes, 4% used
20:18:26.002 (loader): elf appears to be for Teensy 4.0 (IMXRT1062) (2031616 bytes)
20:18:26.003 (loader): elf binary data matches hex file
20:18:26.003 (loader): elf file is for Teensy 4.0 (IMXRT1062)
20:18:26.003 (loader): using hex file
20:18:26.047 (loader): begin operation
20:18:26.067 (loader): flash, block=0, bs=1024, auto=1
20:18:26.068 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:18:26.068 (loader): flash, block=1, bs=1024, auto=1
20:18:26.069 (ports 5): update_usb_device, devinst list change, old had 1, new has 2
20:18:26.069 (ports 5): hiddev_from_devinst_list: iface=0
20:18:26.069 (loader): flash, block=2, bs=1024, auto=1
20:18:26.070 (ports 5): hid, found devinst=00000007
20:18:26.070 (ports 5): hid, path=\\?\hid#vid_16c0&pid_0478#6&2bc5e7a5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
20:18:26.070 (ports 5): hid,  opened handle
20:18:26.070 (ports 5):  devinst=00000007, location=usb:0/140000/0/2
20:18:26.070 (ports 5):  vid=16C0, pid=0478, ver=0107, usepage=FF9C, use=0024
20:18:26.070 (ports 5):  devpath=\\?\hid#vid_16c0&pid_0478#6&2bc5e7a5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
20:18:26.070 (ports 5): usb_add: usb:0/140000/0/2  hid#vid_16c0&pid_0478 (Teensy 4.0) Bootloader
20:18:26.388 (loader): flash, block=3, bs=1024, auto=1
20:18:26.388 (loader): flash, block=4, bs=1024, auto=1
20:18:26.398 (loader): flash, block=5, bs=1024, auto=1
20:18:26.400 (loader): flash, block=6, bs=1024, auto=1
20:18:26.402 (loader): flash, block=7, bs=1024, auto=1
20:18:26.403 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:18:26.404 (ports 5): nothing new, skipping HID & Ports enum
20:18:26.404 (loader): flash, block=8, bs=1024, auto=1
20:18:26.406 (loader): flash, block=9, bs=1024, auto=1
20:18:26.408 (loader): flash, block=10, bs=1024, auto=1
20:18:26.409 (loader): flash, block=11, bs=1024, auto=1
20:18:26.411 (loader): flash, block=12, bs=1024, auto=1
20:18:26.413 (loader): flash, block=13, bs=1024, auto=1
20:18:26.414 (loader): flash, block=14, bs=1024, auto=1
20:18:26.417 (loader): flash, block=15, bs=1024, auto=1
20:18:26.419 (loader): flash, block=16, bs=1024, auto=1
20:18:26.420 (loader): flash, block=17, bs=1024, auto=1
20:18:26.422 (loader): flash, block=18, bs=1024, auto=1
20:18:26.423 (loader): flash, block=19, bs=1024, auto=1
20:18:26.424 (loader): flash, block=20, bs=1024, auto=1
20:18:26.426 (loader): flash, block=21, bs=1024, auto=1
20:18:26.428 (loader): flash, block=22, bs=1024, auto=1
20:18:26.430 (loader): flash, block=23, bs=1024, auto=1
20:18:26.431 (loader): flash, block=24, bs=1024, auto=1
20:18:26.433 (loader): flash, block=25, bs=1024, auto=1
20:18:26.435 (loader): flash, block=26, bs=1024, auto=1
20:18:26.437 (loader): flash, block=27, bs=1024, auto=1
20:18:26.438 (loader): flash, block=28, bs=1024, auto=1
20:18:26.440 (loader): flash, block=29, bs=1024, auto=1
20:18:26.442 (loader): flash, block=30, bs=1024, auto=1
20:18:26.444 (loader): flash, block=31, bs=1024, auto=1
20:18:26.447 (loader): flash, block=32, bs=1024, auto=1
20:18:26.448 (loader): flash, block=33, bs=1024, auto=1
20:18:26.450 (loader): flash, block=34, bs=1024, auto=1
20:18:26.452 (loader): flash, block=35, bs=1024, auto=1
20:18:26.453 (loader): flash, block=36, bs=1024, auto=1
20:18:26.455 (loader): flash, block=37, bs=1024, auto=1
20:18:26.457 (loader): flash, block=38, bs=1024, auto=1
20:18:26.459 (loader): flash, block=39, bs=1024, auto=1
20:18:26.461 (loader): flash, block=40, bs=1024, auto=1
20:18:26.463 (loader): flash, block=41, bs=1024, auto=1
20:18:26.464 (loader): flash, block=42, bs=1024, auto=1
20:18:26.466 (loader): flash, block=43, bs=1024, auto=1
20:18:26.468 (loader): flash, block=44, bs=1024, auto=1
20:18:26.470 (loader): flash, block=45, bs=1024, auto=1
20:18:26.471 (loader): flash, block=46, bs=1024, auto=1
20:18:26.475 (loader): flash, block=47, bs=1024, auto=1
20:18:26.476 (loader): flash, block=48, bs=1024, auto=1
20:18:26.478 (loader): flash, block=49, bs=1024, auto=1
20:18:26.480 (loader): flash, block=50, bs=1024, auto=1
20:18:26.482 (loader): flash, block=51, bs=1024, auto=1
20:18:26.484 (loader): flash, block=52, bs=1024, auto=1
20:18:26.485 (loader): flash, block=53, bs=1024, auto=1
20:18:26.487 (loader): flash, block=54, bs=1024, auto=1
20:18:26.489 (loader): flash, block=55, bs=1024, auto=1
20:18:26.491 (loader): flash, block=56, bs=1024, auto=1
20:18:26.493 (loader): flash, block=57, bs=1024, auto=1
20:18:26.495 (loader): flash, block=58, bs=1024, auto=1
20:18:26.497 (loader): flash, block=59, bs=1024, auto=1
20:18:26.499 (loader): flash, block=60, bs=1024, auto=1
20:18:26.500 (loader): flash, block=61, bs=1024, auto=1
20:18:26.502 (loader): flash, block=62, bs=1024, auto=1
20:18:26.504 (loader): flash, block=63, bs=1024, auto=1
20:18:26.506 (loader): flash, block=64, bs=1024, auto=1
20:18:26.508 (loader): flash, block=65, bs=1024, auto=1
20:18:26.509 (loader): flash, block=66, bs=1024, auto=1
20:18:26.511 (loader): flash, block=67, bs=1024, auto=1
20:18:26.513 (loader): flash, block=68, bs=1024, auto=1
20:18:26.515 (loader): flash, block=69, bs=1024, auto=1
20:18:26.517 (loader): flash, block=70, bs=1024, auto=1
20:18:26.519 (loader): flash, block=71, bs=1024, auto=1
20:18:26.531 (loader): sending reboot
20:18:26.531 (loader): begin wait_until_offline
20:18:26.541 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
20:18:26.541 (ports 5): remove: loc=usb:0/140000/0/2
20:18:26.541 (ports 5): usb_remove: usb:0/140000/0/2
20:18:26.541 (ports 5): nothing new, skipping HID & Ports enum
20:18:26.592 (loader): offline, waited 1
20:18:26.592 (loader): end operation, total time = 0.545 seconds
20:18:26.594 (loader): set background IMG_REBOOT_OK
20:18:26.598 (loader): redraw timer set, image 14 to show for 1200 ms
20:18:26.606 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
20:18:26.606 (ports 5): nothing new, skipping HID & Ports enum
20:18:26.623 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:18:26.623 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:18:26.624 (loader): HID/win32:  vid:056A pid:51C5 ver:0002  usb:150001/1
20:18:26.624 (loader): HID/win32:  vid:06CB pid:7F28 ver:0003  usb:150000/1
20:18:26.624 (loader): HID/win32:  vid:06CB pid:7F28 ver:0003  usb:150000/1
20:18:27.798 (loader): redraw, image 9
20:18:28.177 (ports 5): purge, name=hid#vid_16c0&pid_0478 (Teensy 4.0) Bootloader, loc=usb:0/140000/0/2, age=1.635 sec
20:18:31.904 (loader): Verbose Info event

Can you please with port is being disabled after installing some sketches (i.e., hardware test from example) while Blink or bare minimum is working?


Memory Usage on Teensy 4.0:
FLASH: code:55756, data:9352, headers:8616 free for files:1957892
RAM1: variables:11904, code:53384, padding:12152 free for local variables:446848
RAM2: variables:15520 free for malloc/new:508768
Board at usb:0/140000/0/2 is not available
 
Last edited by a moderator:
okay. so my power supply that im using is a 2 wire USB cable, that I have cut and soldered together inside the phone to use the existing RJ port as a sort of "way in".
When i power the phone using a laptop as USB power source, there is a minimal amount of humming / buzz - not noticeable at all really. The powerbank gives no buzzing whatsoever. However the USB plug adapter is causing the buzzing / humming over the recordings. Now how can I minimise the impact of a USB plug adapter from causing this permanently? I'm struggling to find a 3-pin UK plug that has a ground pin (most are just plastic). or am i just going to be limited to a power bank (not ideal really, seeing as will need to wire in an external switch to power the device)
 
Hey Mates, what a good project! Thanks a lot.
After some little misstakes i am looking for a way to increase the volume.

For the microphone i drill some new holes, thats enough.

But i want to increase the volume of the speaker, the greeting message is to quiet.
Any Tips?

Thank you
 
Hi all, are there any advantages to going with the teensy 4.0 vs 4.1? The 4.1 already has a SD slot so an audio adapter would not be necessary.
 
But i want to increase the volume of the speaker, the greeting message is to quiet.

You can try two things:
* if you record the greeting message with the telephone itself (this is possible with the latest sketch), you can adjust the microphone preamp sensitivity in line of the sketch, so that the greeting message recording itself uses all the dynamic range possible. For different microphone capsules, this has to be adjusted, try different values (max is 63, as far as I remember)

Code:
  sgtl5000_1.micGain(8);

* the playback volume can be adjusted here (max is 1.0)

Code:
sgtl5000_1.volume(0.85);
 
Hi all, are there any advantages to going with the teensy 4.0 vs 4.1? The 4.1 already has a SD slot so an audio adapter would not be necessary.

No, the Teensy audio board is necessary, because:
* it has a built-in adjustable gain pre-amplifier for the microphone input
* it has a good quality ADC
* it has a good quality DAC (which the T4 does not have)

The SD adapter on the T4.1 is much faster than the one on the audio board and thus can potentially lead to less glitches in the audio

One additional advantage is, that at the moment the T4.0 seems unobtainable and the T4.1 can be bought at many places.

So, my recommendation for this project would be to use the T4.1 and the Teensy audio board (buy the one specified for T4)
 
Hey there,

So like a few here I am a beginner and trying to make this project, thank you DD4WH for all the knowledge and help, I have a question I have the MTP library and I can compile the code and upload it to the teensy, but the MTP_teensy.h is still in black not orange like the others #include and when I connect the teensy to the computer I can’t look at the files on the SD. I feel like this is a lack of knowledge, but I’ll take any help I can get. I haven’t gotten it to work as a whole but I thought I’d start here. Thanks everyone.
 
Same here, the
Code:
#include <MTP_Teensy.h>
is not in orange.
But if you can compile the code, everything is fine with that lib.

Did you set Tools --> USB type --> Serial & MTP Disk (Experimental) ? You have to do that before compiling. However, if not, you should have received an error message.

If you connect the Teensy to the PC, wait for a minute or so. Open the explorer and look for a small sign labeled "Teensy", if you click on that, the drive with the name you assigned ("Audio guest book" or similar) will appear and you can access the files.
 
Same here, the
Code:
#include <MTP_Teensy.h>
is not in orange.
But if you can compile the code, everything is fine with that lib.

Did you set Tools --> USB type --> Serial & MTP Disk (Experimental) ? You have to do that before compiling. However, if not, you should have received an error message.

If you connect the Teensy to the PC, wait for a minute or so. Open the explorer and look for a small sign labeled "Teensy", if you click on that, the drive with the name you assigned ("Audio guest book" or similar) will appear and you can access the files.


Okay I’ll give it a go this afternoon. Thank you so much for the reply and all of your work!! I’ll see how I get on a little later. Thanks again.
 
Hello.
I've followed the instructions in the github page but I'm still getting the no file or directory error. I have tried putting the MTP folder in multiple folders and it's still giving me the same error.

Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 150 MHz, Faster, US English"

Multiple libraries were found for "SD.h"

C:\Users\azure\Documents\Arduino\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:37:111: fatal error: MTP_Teensy.h: No such file or directory

Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

compilation terminated.

Not used: C:\Program Files (x86)\Arduino\libraries\SD

Error compiling for board Teensy 4.0.



EDIT:
Nevermind I put the folder in my teensy libraries folder in program files and it compiled but I'm still having some issues with getting it to work. I'm not sure what I'm doing wrong at this point cause. After powering on the teensy there is a loud beep and nothing else happens. I've waited to see if it was the auto recording but nothing happened when I plug the SD card back into my laptop. Where do I go to see the logs of what happens?

EDIT 2:
Found my problem it's giving me unable to access the SD card. I'm not sure whether it's my SD card or the SD library or something else. The SD.h in the code is bolded, is that normal? I'll have to find a different SD card to test.
 
Last edited:
I got everything to work properly now. Turns out I just needed a better SD card.

Thank you for this project. I'm 3 days from my wedding and I finally finished this phone just in time.
 
Hello,

I'm using what I think is the latest version of DD4WH'S code. I've downloaded and installed the beta version of Teensyduino, and I have set the target path in the preferences to C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries. I have installed the MTP library to that path as well. I notice the MTP library folder name isn't turning orange in the Arduino IDE, which suggests that the IDE isn't recognizing it as a library.

I'm now getting this error message and the code is not compiling:

Code:
Arduino: 1.8.19 (Windows 10), TD: 1.57-beta1, Board: "Teensy LC, MTP Disk (Experimental), 48 MHz, Smallest Code, US English"





















C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp: In member function 'void MTP_class::loop()':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:246:26: error: 'usb_mtp_status' was not declared in this scope

       if (return_code && usb_mtp_status == 0x01) {

                          ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:278:7: error: 'usb_mtp_status' was not declared in this scope

   if (usb_mtp_status != 0x01) {

       ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp: In member function 'uint32_t MTP_class::GetObject(MTP_class::MTPContainer&)':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:578:9: error: 'usb_mtp_status' was not declared in this scope

     if (usb_mtp_status != 0x01) {

         ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp: In member function 'uint32_t MTP_class::GetPartialObject(MTP_class::MTPContainer&)':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:618:9: error: 'usb_mtp_status' was not declared in this scope

     if (usb_mtp_status != 0x01) {

         ^

Multiple libraries were found for "MTP_Teensy.h"

 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main

 Not used: C:\Program Files (x86)\Arduino\libraries\MTP_Teensy-main

Multiple libraries were found for "SD.h"

 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

 Not used: C:\Program Files (x86)\Arduino\libraries\SD

Error compiling for board Teensy LC.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The source code is:
Code:
/**
 * Audio Guestbook, Copyright (c) 2022 Playful Technology
 * 
 * Tested using a Teensy 4.0 with Teensy Audio Shield, although should work 
 * with minor modifications on other similar hardware
 * 
 * When handset is lifted, a pre-recorded greeting message is played, followed by a tone.
 * Then, recording starts, and continues until the handset is replaced.
 * Playback button allows all messages currently saved on SD card through earpiece 
 * 
 * follow the detailed instructions here:
 * https://github.com/DD4WH/audio-guestbook/blob/main/README.md
 * 
 * 
 *   the sketch only works with the latest Teensyduino 1.57 version, so please update your Arduino IDE AND your Teensyduino to Arduino version 1.8.19 and the latest Teensyduino version 1.57
 *   download the following library, unzip it and put it into your local Arduino folder (on my computer, the local Arduino folder is: "C:/Users/DD4WH/Documents/Arduino/libraries/"): https://github.com/KurtE/MTP_Teensy
 *   compile with option: "Serial + MTP Disk (Experimental)"" and with option "CPU speed: 150MHz" (this can save about 70% of battery power)
 *
 * Modifications by Frank DD4WH, August 2022
 * - now uses a Teensy 4.1 with built-in SD card (faster via SDIO), if you want to use a Teensy 4.0, uncomment in the USER CONFIGURATION below
 * - Files are saved on SD card as 44.1kHz, 16-bit mono WAV audio files 
 * - if you plug in the telephones´ USB cable into your computer, the telephone is mounted as a drive and you can acess the recordings 
 * - if there is no "greeting.wav" message on the SD card, the telephone automatically plays an invitation to record this message and then you can record the greeting message 
 * - if you want to record the greeting message again, just delete it from the telephone and lift the handheld again to record the greeting message  
 * --> if your handheld contact switch opens on lifting, simply uncomment in the USER CONFIGURATION below, everything else is done by the software
 * 
 * GNU GPL v3.0 license
 * 
 */

#include <Bounce.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <TimeLib.h>
#include <MTP_Teensy.h>  // this library has to be downloaded separately (https://github.com/KurtE/MTP_Teensy)
// unzip the downloaded file and its content into your local Arduino folder (on my computer, the local Arduino folder is: "C:/Users/DD4WH/Documents/Arduino/libraries/")

/***************************************************************************************************************************************************/
/**USER CONFIGURATION ******************************************************************************************************************************/
/**COMMENT / UNCOMMENT ACCORDING TO YOUR HARDWARE **************************************************************************************************/
/***************************************************************************************************************************************************/

// comment this out, if your handheld OPENS the contact on lift
// use a digital voltmeter to find out
#define HANDHELD_CLOSES_ON_LIFT

// comment this out, if you want to record your greeting message with an external recorder
// leave as-is if you want to have the telephone automatically switch to recording the greeting message, in case there is no "greeting.wav" on the SD card 
#define AUTO_GREETING_MESSAGE

// comment out, if you use a Teensy 4.0 (and thus the SD card slot on the audio board)
// if you leave this as-is, you have to use the built-in SD card slot on the Teensy 4.1, NOT the SD card slot on the audio board 
// I have commmented this out.
//#define TEENSY_LC

/***************************************************************************************************************************************************/
/**END OF USER CONFIGURATION ***********************************************************************************************************************/
/***************************************************************************************************************************************************/
/***************************************************************************************************************************************************/

// Define pins used by Teensy Audio Shield
#ifdef TEENSY_LC
#define SDCARD_CS_PIN BUILTIN_SDCARD
#else
#define SDCARD_CS_PIN    10
#endif
#define SDCARD_MOSI_PIN  7
#define SDCARD_SCK_PIN   14
// And those used for inputs
// You can choose the pins you use here:
#define HOOK_PIN 40
#define PLAYBACK_BUTTON_PIN 41
//#define HOOK_PIN 0              // this is the default
//#define PLAYBACK_BUTTON_PIN 1   // this is the default


// GLOBALS
// Audio initialisation code can be generated using the GUI interface at https://www.pjrc.com/teensy/gui/
// Inputs
AudioSynthWaveform          waveform1; // To create the "beep" sfx
AudioInputI2S               i2s2; // I2S input from microphone on audio shield
AudioPlaySdWav              playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file
AudioRecordQueue            queue1; // Creating an audio buffer in memory before saving to SD
AudioMixer4                 mixer; // Allows merging several inputs to same output
AudioOutputI2S              i2s1; // I2S interface to Speaker/Line Out on Audio shield
AudioConnection patchCord1(waveform1, 0, mixer, 0); // wave to mixer 
AudioConnection patchCord3(playWav1, 0, mixer, 1); // wav file playback mixer
AudioConnection patchCord4(mixer, 0, i2s1, 0); // mixer output to speaker (L)
AudioConnection patchCord6(mixer, 0, i2s1, 1); // mixer output to speaker (R)
AudioConnection patchCord5(i2s2, 0, queue1, 0); // mic input to queue (L)
AudioControlSGTL5000      sgtl5000_1;

// Filename to save audio recording on SD card
char filename[15];
// The file object itself
File frec;

// Use long 40ms debounce time on both switches
Bounce buttonRecord = Bounce(HOOK_PIN, 40);
Bounce buttonPlay = Bounce(PLAYBACK_BUTTON_PIN, 40);

// Keep track of current state of the device
enum Mode {Initialising, Ready, Prompting, Recording, Playing, Recording_Greeting};
Mode mode = Mode::Initialising;

float beep_volume = 0.04f; // not too loud :-)

// variables for writing to WAV file
unsigned long ChunkSize = 0L;
unsigned long Subchunk1Size = 16;
unsigned int AudioFormat = 1;
unsigned int numChannels = 1;
unsigned long sampleRate = 44100;
unsigned int bitsPerSample = 16;
unsigned long byteRate = sampleRate*numChannels*(bitsPerSample/8);// samplerate x channels x (bitspersample / 8)
unsigned int blockAlign = numChannels*bitsPerSample/8;
unsigned long Subchunk2Size = 0L;
unsigned long recByteSaved = 0L;
unsigned long NumSamples = 0L;
byte byte1, byte2, byte3, byte4;


void setup() {

  Serial.begin(9600);
  while (!Serial && millis() < 5000) {
    // wait for serial port to connect.
  }
  Serial.println("Serial set up correctly");
  print_mode();
  // Configure the input pins
  pinMode(HOOK_PIN, INPUT_PULLUP);
  pinMode(PLAYBACK_BUTTON_PIN, INPUT_PULLUP);

  // Audio connections require memory, and the record queue
  // uses this memory to buffer incoming audio.
  AudioMemory(60);

  // Enable the audio shield, select input, and enable output
  sgtl5000_1.enable();
  // Define which input on the audio shield to use (AUDIO_INPUT_LINEIN / AUDIO_INPUT_MIC)
  sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
  sgtl5000_1.adcHighPassFilterDisable(); //
  sgtl5000_1.volume(0.85);

  mixer.gain(0, 1.0f);
  mixer.gain(1, 1.0f);

  // Play a beep to indicate system is online
  waveform1.begin(beep_volume, 440, WAVEFORM_SINE);
  wait(1000);
  waveform1.amplitude(0);
  delay(1000);

  // Initialize the SD card
#ifndef TEENSY_LC   // assumes that you are using the SD card slot of the AUDIO BOARD
  SPI.setMOSI(SDCARD_MOSI_PIN);
  SPI.setSCK(SDCARD_SCK_PIN);
#endif  
  if (!(SD.begin(SDCARD_CS_PIN))) 
  {
    // stop here if no SD card, but print a message
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }
    else Serial.println("SD card correctly initialized");

  // mandatory to begin the MTP session.
    MTP.begin();

  // Add SD Card
    MTP.addFilesystem(SD, "Gruenkohls Audio guestbook"); // choose a nice name for the SD card volume to appear in your file explorer
    Serial.println("Added SD card via MTP");
    
    // Value in dB
//  sgtl5000_1.micGain(15);
  sgtl5000_1.micGain(8); // much lower gain is required for the AOM5024 electret capsule

  // Synchronise the Time object used in the program code with the RTC time provider.
  // See https://github.com/PaulStoffregen/Time
  setSyncProvider(getTeensy3Time);
  
  // Define a callback that will assign the correct datetime for any file system operations
  // (i.e. saving a new audio recording onto the SD card)
  FsDateTime::setCallback(dateTime);

  mode = Mode::Ready; print_mode();
}

void loop() { //1
  // First, read the buttons
  buttonRecord.update();
  buttonPlay.update();

  switch(mode)
  { //2
    case Mode::Ready:
      // Falling edge occurs when the handset is lifted --> 611 telephone
#if defined(HANDHELD_CLOSES_ON_LIFT)
      if (buttonRecord.fallingEdge()) 
#else
      if (buttonRecord.risingEdge()) 
#endif
      {
        Serial.println("Handset lifted");
        mode = Mode::Prompting; print_mode();
      } //3
      else if(buttonPlay.fallingEdge()) 
      { //4
        //playAllRecordings();
        playLastRecording();
      } //4
      break;

    case Mode::Prompting:
      // Wait a second for users to put the handset to their ear
      wait(1000);

#if defined(AUTO_GREETING_MESSAGE)

    if (!SD.exists("greeting.wav")) 
    { //5
      mode = Mode::Recording_Greeting;
      break;
    } //5
#endif
     
      // Play the greeting inviting them to record their message
      playWav1.play("greeting.wav");    
      // Wait until the  message has finished playing
//      while (playWav1.isPlaying()) {
      while (!playWav1.isStopped()) 
      { //6
        // Check whether the handset is replaced
        buttonRecord.update();
        buttonPlay.update();
        // Handset is replaced
#if defined(HANDHELD_CLOSES_ON_LIFT)
      if (buttonRecord.risingEdge()) 
#else
      if (buttonRecord.fallingEdge())
#endif
        {
          playWav1.stop();
          mode = Mode::Ready; print_mode();
          return;
        } //7
        if(buttonPlay.fallingEdge()) 
        { //8
          playWav1.stop();
          //playAllRecordings();
          playLastRecording();
          return;
        } //8
        
      }  // 
      
      // Debug message
      Serial.println("Starting Recording");
      // Play the tone sound effect
      waveform1.begin(beep_volume, 440, WAVEFORM_SINE);
      wait(1250);
      waveform1.amplitude(0);
      // Start the recording function
      startRecording();
      break;

    case Mode::Recording:
      // Handset is replaced
#if defined(HANDHELD_CLOSES_ON_LIFT)
      if (buttonRecord.risingEdge()) 
#else
      if (buttonRecord.fallingEdge())
#endif
      { //9  
      // Debug log
        Serial.println("Stopping Recording");
        // Stop recording
        stopRecording();
        // Play audio tone to confirm recording has ended
        end_Beep();
      } //9
      else 
      { //10
        continueRecording();
      } // 10
      break;

    case Mode::Playing: // to make compiler happy
      break;  

    case Mode::Initialising: // to make compiler happy
      break;  

    case Mode::Recording_Greeting: // to make compiler happy
      startRecordingGreeting();
      mode = Mode::Recording;
      break;  
      } // 2 end switch   
  MTP.loop();  //This is mandatory to be placed in the loop code.
} // 1 end loop

void startRecordingGreeting() {
    if (SD.exists("greeting.wav")) {
      return;
    }
    // play message "Please record Greeting message now !" 
    playWav1.play("invitation_greeting.wav");
    while (!playWav1.isStopped()) { // this works for playWav
      buttonPlay.update();
      buttonRecord.update();
      // Button is pressed again
#if defined(HANDHELD_CLOSES_ON_LIFT)
      if(buttonPlay.fallingEdge() || buttonRecord.risingEdge())  
#else
      if(buttonPlay.fallingEdge() || buttonRecord.fallingEdge())  
#endif
      { 
        playWav1.stop();
        mode = Mode::Ready; print_mode();
        return;
      }   
    }
    // play beep
    two_tone_Beep();
  frec = SD.open("greeting.wav", FILE_WRITE);
  Serial.println("Opened Greeting file !");
  if(frec) {
    Serial.print("Recording to greeting.wav");
    queue1.begin();
    mode = Mode::Recording; print_mode();
    recByteSaved = 0L;
  }
  else {
    Serial.println("Couldn't open file to record!");
  }
}

void startRecording() {
  // Find the first available file number
//  for (uint8_t i=0; i<9999; i++) { // BUGFIX uint8_t overflows if it reaches 255  
  for (uint16_t i=0; i<9999; i++) {   
    // Format the counter as a five-digit number with leading zeroes, followed by file extension
    snprintf(filename, 11, " %05d.wav", i);
    // Create if does not exist, do not open existing, write, sync after write
    if (!SD.exists(filename)) {
      break;
    }
  }
  frec = SD.open(filename, FILE_WRITE);
  Serial.println("Opened file !");
  if(frec) {
    Serial.print("Recording to ");
    Serial.println(filename);
    queue1.begin();
    mode = Mode::Recording; print_mode();
    recByteSaved = 0L;
  }
  else {
    Serial.println("Couldn't open file to record!");
  }
}

void continueRecording() {
  // Check if there is data in the queue
  if (queue1.available() >= 2) {
    byte buffer[512];
    // Fetch 2 blocks from the audio library and copy
    // into a 512 byte buffer.  The Arduino SD library
    // is most efficient when full 512 byte sector size
    // writes are used.
    memcpy(buffer, queue1.readBuffer(), 256);
    queue1.freeBuffer();
    memcpy(buffer+256, queue1.readBuffer(), 256);
    queue1.freeBuffer();
    // Write all 512 bytes to the SD card
    frec.write(buffer, 512);
    recByteSaved += 512;
  }
}

void stopRecording() {
  // Stop adding any new data to the queue
  queue1.end();
  // Flush all existing remaining data from the queue
  while (queue1.available() > 0) {
    // Save to open file
    frec.write((byte*)queue1.readBuffer(), 256);
    queue1.freeBuffer();
    recByteSaved += 256;
  }
  writeOutHeader();
  // Close the file
  frec.close();
  Serial.println("Closed file");
  mode = Mode::Ready; print_mode();
}


void playAllRecordings() {
  // Recording files are saved in the root directory
  File dir = SD.open("/");
  
  while (true) {
    File entry =  dir.openNextFile();
    if (strstr(entry.name(), "greeting"))
    {
       entry =  dir.openNextFile();
    }
    if (!entry) {
      // no more files
      entry.close();
      end_Beep();
      break;
    }
    //int8_t len = strlen(entry.name()) - 4;
//    if (strstr(strlwr(entry.name() + (len - 4)), ".raw")) {
//    if (strstr(strlwr(entry.name() + (len - 4)), ".wav")) {
    // the lines above throw a warning, so I replace them with this (which is also easier to read):
    if (strstr(entry.name(), ".wav") || strstr(entry.name(), ".WAV")) {
      Serial.print("Now playing ");
      Serial.println(entry.name());
      // Play a short beep before each message
      waveform1.amplitude(beep_volume);
      wait(750);
      waveform1.amplitude(0);
      // Play the file
      playWav1.play(entry.name());
      mode = Mode::Playing; print_mode();
    }
    entry.close();

//    while (playWav1.isPlaying()) { // strangely enough, this works for playRaw, but it does not work properly for playWav
    while (!playWav1.isStopped()) { // this works for playWav
      buttonPlay.update();
      buttonRecord.update();
      // Button is pressed again
#if defined(HANDHELD_CLOSES_ON_LIFT)
      if(buttonPlay.fallingEdge() || buttonRecord.risingEdge())  
#else
      if(buttonPlay.fallingEdge() || buttonRecord.fallingEdge())  
#endif
      { 
        playWav1.stop();
        mode = Mode::Ready; print_mode();
        return;
      }   
    }
  }
  // All files have been played
  mode = Mode::Ready; print_mode();
}

void playLastRecording() { // 1
  // Find the first available file number
  uint16_t idx = 0; 
  for (uint16_t i=0; i<9999; i++) { // 2
    // Format the counter as a five-digit number with leading zeroes, followed by file extension
    snprintf(filename, 11, " %05d.wav", i);
    // check, if file with index i exists
    if (!SD.exists(filename)) { // 3
     idx = i - 1;
     break;
      } // 3
  } // 2
      // now play file with index idx == last recorded file
      snprintf(filename, 11, " %05d.wav", idx);
      Serial.println(filename);
      playWav1.play(filename);
      mode = Mode::Playing; print_mode();
      while (!playWav1.isStopped()) 
      { // 5 // this works for playWav
          buttonPlay.update();
          buttonRecord.update();
          // Button is pressed again
    #if defined(HANDHELD_CLOSES_ON_LIFT)
          if(buttonPlay.fallingEdge() || buttonRecord.risingEdge())  
    #else
          if(buttonPlay.fallingEdge() || buttonRecord.fallingEdge()) 
    #endif
          {
            playWav1.stop();
            mode = Mode::Ready; print_mode();
            return;
          }   //4
      } // 5 end while
      // file has been played
  mode = Mode::Ready; print_mode();  
  end_Beep();
} // 1 end playLastRecording


// Retrieve the current time from Teensy built-in RTC
time_t getTeensy3Time(){
  return Teensy3Clock.get();
}

// Callback to assign timestamps for file system operations
void dateTime(uint16_t* date, uint16_t* time, uint8_t* ms10) {

  // Return date using FS_DATE macro to format fields.
  *date = FS_DATE(year(), month(), day());

  // Return time using FS_TIME macro to format fields.
  *time = FS_TIME(hour(), minute(), second());

  // Return low time bits in units of 10 ms.
  *ms10 = second() & 1 ? 100 : 0;
}

// Non-blocking delay, which pauses execution of main program logic,
// but while still listening for input 
void wait(unsigned int milliseconds) {
  elapsedMillis msec=0;

  while (msec <= milliseconds) {
    buttonRecord.update();
    buttonPlay.update();
    if (buttonRecord.fallingEdge()) Serial.println("Button (pin 0) Press");
    if (buttonPlay.fallingEdge()) Serial.println("Button (pin 1) Press");
    if (buttonRecord.risingEdge()) Serial.println("Button (pin 0) Release");
    if (buttonPlay.risingEdge()) Serial.println("Button (pin 1) Release");
  }
}


void writeOutHeader() { // update WAV header with final filesize/datasize

//  NumSamples = (recByteSaved*8)/bitsPerSample/numChannels;
//  Subchunk2Size = NumSamples*numChannels*bitsPerSample/8; // number of samples x number of channels x number of bytes per sample
  Subchunk2Size = recByteSaved;
  ChunkSize = Subchunk2Size + 36;
  frec.seek(0);
  frec.write("RIFF");
  byte1 = ChunkSize & 0xff;
  byte2 = (ChunkSize >> 8) & 0xff;
  byte3 = (ChunkSize >> 16) & 0xff;
  byte4 = (ChunkSize >> 24) & 0xff;  
  frec.write(byte1);  frec.write(byte2);  frec.write(byte3);  frec.write(byte4);
  frec.write("WAVE");
  frec.write("fmt ");
  byte1 = Subchunk1Size & 0xff;
  byte2 = (Subchunk1Size >> 8) & 0xff;
  byte3 = (Subchunk1Size >> 16) & 0xff;
  byte4 = (Subchunk1Size >> 24) & 0xff;  
  frec.write(byte1);  frec.write(byte2);  frec.write(byte3);  frec.write(byte4);
  byte1 = AudioFormat & 0xff;
  byte2 = (AudioFormat >> 8) & 0xff;
  frec.write(byte1);  frec.write(byte2); 
  byte1 = numChannels & 0xff;
  byte2 = (numChannels >> 8) & 0xff;
  frec.write(byte1);  frec.write(byte2); 
  byte1 = sampleRate & 0xff;
  byte2 = (sampleRate >> 8) & 0xff;
  byte3 = (sampleRate >> 16) & 0xff;
  byte4 = (sampleRate >> 24) & 0xff;  
  frec.write(byte1);  frec.write(byte2);  frec.write(byte3);  frec.write(byte4);
  byte1 = byteRate & 0xff;
  byte2 = (byteRate >> 8) & 0xff;
  byte3 = (byteRate >> 16) & 0xff;
  byte4 = (byteRate >> 24) & 0xff;  
  frec.write(byte1);  frec.write(byte2);  frec.write(byte3);  frec.write(byte4);
  byte1 = blockAlign & 0xff;
  byte2 = (blockAlign >> 8) & 0xff;
  frec.write(byte1);  frec.write(byte2); 
  byte1 = bitsPerSample & 0xff;
  byte2 = (bitsPerSample >> 8) & 0xff;
  frec.write(byte1);  frec.write(byte2); 
  frec.write("data");
  byte1 = Subchunk2Size & 0xff;
  byte2 = (Subchunk2Size >> 8) & 0xff;
  byte3 = (Subchunk2Size >> 16) & 0xff;
  byte4 = (Subchunk2Size >> 24) & 0xff;  
  frec.write(byte1);  frec.write(byte2);  frec.write(byte3);  frec.write(byte4);
  frec.close();
  Serial.println("header written"); 
  Serial.print("Subchunk2: "); 
  Serial.println(Subchunk2Size); 
}

void end_Beep(void) {
        waveform1.frequency(523.25);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
        wait(250);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
        wait(250);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
        wait(250);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
}

void two_tone_Beep(void) {
        waveform1.frequency(523.25);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
        waveform1.frequency(375.0);
        wait(250);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
        waveform1.frequency(523.25);
        wait(250);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
        waveform1.frequency(375.0);
        wait(250);
        waveform1.amplitude(beep_volume);
        wait(250);
        waveform1.amplitude(0);
}

void print_mode(void) { // only for debugging
  Serial.print("Mode switched to: ");
  // Initialising, Ready, Prompting, Recording, Playing
  if(mode == Mode::Ready)           Serial.println(" Ready");
  else if(mode == Mode::Prompting)  Serial.println(" Prompting");
  else if(mode == Mode::Recording)  Serial.println(" Recording");
  else if(mode == Mode::Playing)    Serial.println(" Playing");
  else if(mode == Mode::Initialising)  Serial.println(" Initialising");
  else if(mode == Mode::Recording_Greeting)  Serial.println(" Recording Greeting");
  else Serial.println(" Undefined");
}

Do you think is an error with the MTP library?
 
The code you use, is not the code from my github. There are several #ifdef for Teensy LC.
I have only tried T4 and I doubt the code will run on Teensy LC
 
The code you use, is not the code from my github. There are several #ifdef for Teensy LC.
I have only tried T4 and I doubt the code will run on Teensy LC

Oh yeah, I changed the model to Teensy LC because that's what I bought. I actually have no idea if the LC is incompatible because I'm a newbie. Are there any fundamental differences I should be aware of?
 
Hi, I'm new here, and new to all of this. And first of all, I really appreciate the open source code for this as well as this community that is willing to help people out!

I built one of these yesterday and I am having good success - the greeting is working, the recording is working, and so on (I decided to not worry about the playback button, but may wire it in later on).

The only think I have not been able to get to happen is plugging the usb cord to a computer and being able to see the files on the computer. I have it set to "Serial + MTP (experimental)". I am using a mac. Is this just not possible on a mac? Would love to not have to open the phone anytime I want to access the files! I am using the code from github, and have installed the MTP-Teensy.h library in the /Applications/Teensyduino.app/Contents/Java/libraries/MTP_Teensy

Any help will be appreciated! I am not getting any errors when I compile. Don't know what's going on. Thanks in advance!
 
Hi, I'm new here, and new to all of this. And first of all, I really appreciate the open source code for this as well as this community that is willing to help people out!

I built one of these yesterday and I am having good success - the greeting is working, the recording is working, and so on (I decided to not worry about the playback button, but may wire it in later on).

The only think I have not been able to get to happen is plugging the usb cord to a computer and being able to see the files on the computer. I have it set to "Serial + MTP (experimental)". I am using a mac. Is this just not possible on a mac? Would love to not have to open the phone anytime I want to access the files! I am using the code from github, and have installed the MTP-Teensy.h library in the /Applications/Teensyduino.app/Contents/Java/libraries/MTP_Teensy

Any help will be appreciated! I am not getting any errors when I compile. Don't know what's going on. Thanks in advance!

I believe that @KurtE mentioned here: https://forum.pjrc.com/threads/6813...ng-MTP-and-MSC?p=293743&viewfull=1#post293743, that MACs don't natively support MTP. He had to download the free version of something called OpenMTP. I personally dont use MACs so cant be of much further help but maybe someone else will jump in.
 
Back
Top