Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User friendliness #548

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

User friendliness #548

wants to merge 1 commit into from

Conversation

Epipeppy
Copy link

@Epipeppy Epipeppy commented Sep 7, 2022

Step 1) Adding control system (pin and if statement).

Step 1) Adding control system (pin and if statement).
@CLAassistant
Copy link

CLAassistant commented Sep 7, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

Memory usage change @ a2ed538

Board flash % RAM for global variables %
arduino:mbed:envie_m4 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:nano33ble 🔺 0 - +128 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed:nanorp2040connect 🔺 0 - +326 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:nicla_sense 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:nicla_vision 🔺 0 - +128 0.0 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board libraries/Scheduler/examples/MultipleBlinks
flash
% libraries/Scheduler/examples/MultipleBlinks
RAM for global variables
% libraries/doom/examples/Doom
flash
% libraries/doom/examples/Doom
RAM for global variables
% libraries/KernelDebug/examples/KernelDebug
flash
% libraries/KernelDebug/examples/KernelDebug
RAM for global variables
% libraries/Portenta_SDCARD/examples/TestSDCARD
flash
% libraries/Portenta_SDCARD/examples/TestSDCARD
RAM for global variables
% libraries/Portenta_SDRAM/examples/SDRAM_operations
flash
% libraries/Portenta_SDRAM/examples/SDRAM_operations
RAM for global variables
% libraries/Portenta_Video/examples/ArduinoLogo
flash
% libraries/Portenta_Video/examples/ArduinoLogo
RAM for global variables
% libraries/RPC/examples/BootM4_from_SDRAM
flash
% libraries/RPC/examples/BootM4_from_SDRAM
RAM for global variables
% libraries/RPC/examples/PortentaX8_EchoServer
flash
% libraries/RPC/examples/PortentaX8_EchoServer
RAM for global variables
% libraries/RPC/examples/RPC_m4
flash
% libraries/RPC/examples/RPC_m4
RAM for global variables
% libraries/RPC/examples/SerialPassthrough_RPC
flash
% libraries/RPC/examples/SerialPassthrough_RPC
RAM for global variables
% libraries/PDM/examples/PDMSerialPlotter
flash
% libraries/PDM/examples/PDMSerialPlotter
RAM for global variables
% libraries/ThreadDebug/examples/ThreadDebug
flash
% libraries/ThreadDebug/examples/ThreadDebug
RAM for global variables
% libraries/USBHID/examples/Keyboard
flash
% libraries/USBHID/examples/Keyboard
RAM for global variables
% libraries/USBHID/examples/Mouse
flash
% libraries/USBHID/examples/Mouse
RAM for global variables
% libraries/USBMSD/examples/Nano33BLE_FlashMassStorage
flash
% libraries/USBMSD/examples/Nano33BLE_FlashMassStorage
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/AP_SimpleWebServer
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/AP_SimpleWebServer
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectNoEncryption
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectNoEncryption
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWEP
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWEP
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA2Enterprise
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA2Enterprise
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworks
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworks
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworksAdvanced
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworksAdvanced
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/SimpleWebServerWiFi
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/SimpleWebServerWiFi
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/Tools/CheckFirmwareVersion
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/Tools/CheckFirmwareVersion
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/Tools/FirmwareUpdater
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/Tools/FirmwareUpdater
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/Tools/SerialNINAPassthrough
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/Tools/SerialNINAPassthrough
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiChatServer
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiChatServer
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiPing
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiPing
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiSSLClient
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiSSLClient
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiStorage
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiStorage
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpNtpClient
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpNtpClient
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpSendReceiveString
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpSendReceiveString
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClient
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClient
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClientRepeating
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClientRepeating
RAM for global variables
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebServer
flash
% /home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebServer
RAM for global variables
% libraries/Nicla_System/examples/Blink_Nicla
flash
% libraries/Nicla_System/examples/Blink_Nicla
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/App
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/App
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/BHYFirmwareUpdate
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/BHYFirmwareUpdate
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/DataHarvester
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/DataHarvester
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/Fail_Safe_flasher
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/Fail_Safe_flasher
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/ReadSensorConfiguration
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/ReadSensorConfiguration
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/ShowSensorList
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/ShowSensorList
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/Standalone
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/Standalone
RAM for global variables
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/StandaloneFlashStorage
flash
% /home/runner/Arduino/libraries/Arduino_BHY2/examples/StandaloneFlashStorage
RAM for global variables
% libraries/Camera/examples/CameraCaptureRawBytes
flash
% libraries/Camera/examples/CameraCaptureRawBytes
RAM for global variables
% libraries/STM32H747_System/examples/QSPIFReadPartitions
flash
% libraries/STM32H747_System/examples/QSPIFReadPartitions
RAM for global variables
% libraries/STM32H747_System/examples/QSPIFormat
flash
% libraries/STM32H747_System/examples/QSPIFormat
RAM for global variables
% libraries/STM32H747_System/examples/STM32H747_getBootloaderInfo
flash
% libraries/STM32H747_System/examples/STM32H747_getBootloaderInfo
RAM for global variables
% libraries/STM32H747_System/examples/STM32H747_manageBootloader
flash
% libraries/STM32H747_System/examples/STM32H747_manageBootloader
RAM for global variables
% libraries/STM32H747_System/examples/WiFiFirmwareUpdater
flash
% libraries/STM32H747_System/examples/WiFiFirmwareUpdater
RAM for global variables
% libraries/USBHOST/examples/KeyboardController
flash
% libraries/USBHOST/examples/KeyboardController
RAM for global variables
% libraries/USBHOST/examples/Shell
flash
% libraries/USBHOST/examples/Shell
RAM for global variables
% libraries/USBMSD/examples/AccessFlashAsUSBDisk
flash
% libraries/USBMSD/examples/AccessFlashAsUSBDisk
RAM for global variables
% libraries/WiFi/examples/WiFiWebClient
flash
% libraries/WiFi/examples/WiFiWebClient
RAM for global variables
%
arduino:mbed:envie_m4 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed:nano33ble 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 128 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed:nanorp2040connect 0 0.0 0 0.0 0 0.0 0 0.0 326 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed:nicla_sense 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed:nicla_vision 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 128 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,libraries/Scheduler/examples/MultipleBlinks<br>flash,%,libraries/Scheduler/examples/MultipleBlinks<br>RAM for global variables,%,libraries/doom/examples/Doom<br>flash,%,libraries/doom/examples/Doom<br>RAM for global variables,%,libraries/KernelDebug/examples/KernelDebug<br>flash,%,libraries/KernelDebug/examples/KernelDebug<br>RAM for global variables,%,libraries/Portenta_SDCARD/examples/TestSDCARD<br>flash,%,libraries/Portenta_SDCARD/examples/TestSDCARD<br>RAM for global variables,%,libraries/Portenta_SDRAM/examples/SDRAM_operations<br>flash,%,libraries/Portenta_SDRAM/examples/SDRAM_operations<br>RAM for global variables,%,libraries/Portenta_Video/examples/ArduinoLogo<br>flash,%,libraries/Portenta_Video/examples/ArduinoLogo<br>RAM for global variables,%,libraries/RPC/examples/BootM4_from_SDRAM<br>flash,%,libraries/RPC/examples/BootM4_from_SDRAM<br>RAM for global variables,%,libraries/RPC/examples/PortentaX8_EchoServer<br>flash,%,libraries/RPC/examples/PortentaX8_EchoServer<br>RAM for global variables,%,libraries/RPC/examples/RPC_m4<br>flash,%,libraries/RPC/examples/RPC_m4<br>RAM for global variables,%,libraries/RPC/examples/SerialPassthrough_RPC<br>flash,%,libraries/RPC/examples/SerialPassthrough_RPC<br>RAM for global variables,%,libraries/PDM/examples/PDMSerialPlotter<br>flash,%,libraries/PDM/examples/PDMSerialPlotter<br>RAM for global variables,%,libraries/ThreadDebug/examples/ThreadDebug<br>flash,%,libraries/ThreadDebug/examples/ThreadDebug<br>RAM for global variables,%,libraries/USBHID/examples/Keyboard<br>flash,%,libraries/USBHID/examples/Keyboard<br>RAM for global variables,%,libraries/USBHID/examples/Mouse<br>flash,%,libraries/USBHID/examples/Mouse<br>RAM for global variables,%,libraries/USBMSD/examples/Nano33BLE_FlashMassStorage<br>flash,%,libraries/USBMSD/examples/Nano33BLE_FlashMassStorage<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/AP_SimpleWebServer<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/AP_SimpleWebServer<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectNoEncryption<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectNoEncryption<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWEP<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWEP<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA2Enterprise<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ConnectWithWPA2Enterprise<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworks<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworks<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworksAdvanced<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/ScanNetworksAdvanced<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/SimpleWebServerWiFi<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/SimpleWebServerWiFi<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/Tools/CheckFirmwareVersion<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/Tools/CheckFirmwareVersion<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/Tools/FirmwareUpdater<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/Tools/FirmwareUpdater<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/Tools/SerialNINAPassthrough<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/Tools/SerialNINAPassthrough<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiChatServer<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiChatServer<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiPing<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiPing<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiSSLClient<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiSSLClient<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiStorage<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiStorage<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpNtpClient<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpNtpClient<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpSendReceiveString<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiUdpSendReceiveString<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClient<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClient<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClientRepeating<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebClientRepeating<br>RAM for global variables,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebServer<br>flash,%,/home/runner/Arduino/libraries/WiFiNINA/examples/WiFiWebServer<br>RAM for global variables,%,libraries/Nicla_System/examples/Blink_Nicla<br>flash,%,libraries/Nicla_System/examples/Blink_Nicla<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/App<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/App<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/BHYFirmwareUpdate<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/BHYFirmwareUpdate<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/DataHarvester<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/DataHarvester<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/Fail_Safe_flasher<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/Fail_Safe_flasher<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/ReadSensorConfiguration<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/ReadSensorConfiguration<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/ShowSensorList<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/ShowSensorList<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/Standalone<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/Standalone<br>RAM for global variables,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/StandaloneFlashStorage<br>flash,%,/home/runner/Arduino/libraries/Arduino_BHY2/examples/StandaloneFlashStorage<br>RAM for global variables,%,libraries/Camera/examples/CameraCaptureRawBytes<br>flash,%,libraries/Camera/examples/CameraCaptureRawBytes<br>RAM for global variables,%,libraries/STM32H747_System/examples/QSPIFReadPartitions<br>flash,%,libraries/STM32H747_System/examples/QSPIFReadPartitions<br>RAM for global variables,%,libraries/STM32H747_System/examples/QSPIFormat<br>flash,%,libraries/STM32H747_System/examples/QSPIFormat<br>RAM for global variables,%,libraries/STM32H747_System/examples/STM32H747_getBootloaderInfo<br>flash,%,libraries/STM32H747_System/examples/STM32H747_getBootloaderInfo<br>RAM for global variables,%,libraries/STM32H747_System/examples/STM32H747_manageBootloader<br>flash,%,libraries/STM32H747_System/examples/STM32H747_manageBootloader<br>RAM for global variables,%,libraries/STM32H747_System/examples/WiFiFirmwareUpdater<br>flash,%,libraries/STM32H747_System/examples/WiFiFirmwareUpdater<br>RAM for global variables,%,libraries/USBHOST/examples/KeyboardController<br>flash,%,libraries/USBHOST/examples/KeyboardController<br>RAM for global variables,%,libraries/USBHOST/examples/Shell<br>flash,%,libraries/USBHOST/examples/Shell<br>RAM for global variables,%,libraries/USBMSD/examples/AccessFlashAsUSBDisk<br>flash,%,libraries/USBMSD/examples/AccessFlashAsUSBDisk<br>RAM for global variables,%,libraries/WiFi/examples/WiFiWebClient<br>flash,%,libraries/WiFi/examples/WiFiWebClient<br>RAM for global variables,%
arduino:mbed:envie_m4,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed:nano33ble,0,0.0,0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0.0,0,0.0,0,0.0,0,0.0,128,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed:nanorp2040connect,0,0.0,0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0.0,0,0.0,,,,,326,0.0,0,0.0,0,0.0,0,0.0,,,,,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed:nicla_sense,0,0.0,0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed:nicla_vision,0,0.0,0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0.0,0,0.0,0,0.0,0,0.0,128,0.01,0,0.0,0,0.0,0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@sebromero
Copy link
Collaborator

Hi @Epipeppy ! Thank you for your contribution. As far as I understand you would like to avoid that the string is printed over and over. What if we just move the code to the setup function instead? That way we can avoid that the people need to wire up any external component to test this.

@Epipeppy
Copy link
Author

Epipeppy commented Apr 7, 2023

Hi @Epipeppy ! Thank you for your contribution. As far as I understand you would like to avoid that the string is printed over and over. What if we just move the code to the setup function instead? That way we can avoid that the people need to wire up any external component to test this.

Hello, and sorry in advance for the upcoming wall of text.

My main issue was that after uploading the sketch, I was no longer able to connect to and reprogram my board without putting it into boot loader mode (double tap reset key); which seemed extreme for a simple example program. Secondary was the fact that the program was sending the keys to my computer repeatedly, which was messing with any program I had open that was focused (i.e. not in the background). A tertiary concern was the fact that the example didn't show how to use the Keyboard library for mbed-OS; for example, the printf() function isn't defined in the Keyboard library but was used. The normal Keyboard library also used functions like press(), release(), and send(); however the functions that are defined in the mbed-OS are (or were at the time) key_code()​​​, and _putc()​​​.

Initially I wrote a fully reworked example to show how to use these, but was told I should post them in small chunks (small changes), rather than 1 big change, so that any issues could be more easily resolved. From some of the other posts or comments I read, this example, when done with other boards, usually has a "button" or something to enable the output; that way the output is only sent when the button is pressed. It seemed like a useful feature, because of my secondary issue, so I incorporated it. If you have an idea for something we could put in the setup loop that would solve this, I say that sounds great!

I'm happy to work more on this if that would be helpful. I remember feeling a bit frustrated at the time, and I wanted (and still want) to help others avoid that.

@Epipeppy
Copy link
Author

Re-reading my reply, I noticed that I probably misunderstood what you said. You said put the print in the setup function (which I called the setup loop for some reason), that way it would only print once and be easily testable. That's a pretty good idea which would solve one of the issues I was listing.

In regards to showing how to use the library, do you think creating a different example sketch would be a better solution than heavily modifying this one?

@alessandromrc
Copy link
Contributor

@Epipeppy Hi, I think you should firstly debounce that GPIO otherwise it would bounce and execute the code inside the if statement randomly. Then the issue with the board not responding on flash might be because it is constantly blocked by the code you wrote inside the loop which will keep the microcontroller always busy and so it won't reply to the serial.

@Epipeppy
Copy link
Author

Epipeppy commented May 3, 2023

Hello @alessandromrc debouncing isn't a bad idea; I personally just connect the GPIO to ground via wire, and leave it unplugged when I'm not testing the condition.

I'm not saying this to be rude, but I'm not sure we're looking at the same code. The code I was commenting on was:

#include "PluggableUSBHID.h"
#include "USBKeyboard.h"

USBKeyboard Keyboard;

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  delay(1000);
  Keyboard.printf("Hello world\n\r");
}

In that code there is no button control, it is simply an infinitely looping command that uses a function printf() which is not defined in the USBKeyboard mbed library anywhere I could find. When I tried using this example on my board, I could no longer reprogram the board without putting it into bootloader mode (or whatever the proper name is for double pressing reset).

While I have a whole re-written example using commands from the USBKeyboard mbed library, I was told I should make suggestions that include small changes. My change was simply to add a way to control whether the example would execute. I was told this was standard in other keyboard/etc. examples from Arduino, and that this was usually done with a button:
if button is pressed then print, else do nothing

@alessandromrc
Copy link
Contributor

alessandromrc commented May 3, 2023

Hi @Epipeppy no worries :) The code I was actually looking was the one you changed in the PR which is this one:

#include "PluggableUSBHID.h"
#include "USBKeyboard.h"

USBKeyboard Keyboard;

// Arbitrary pin.
const int CONTROL_PIN = 2;

void setup() {
  // We will use this to start/end the prints.
  pinMode(CONTROL_PIN, INPUT_PULLUP);
}

void loop() {
  // This will run only if the control pin is connected to ground.
  if( digitalRead(CONTROL_PIN) == LOW){
    delay(1000);
    Keyboard.printf("Hello world\n\r");
  }
}

I was related to the line where you have the if statement that checks if the digitalPin is being pulled down. In any way I might look it in a deeper way using a debugger to see if there's something preventing the reset of the uC.

Edit: I just seen that there might be an error within the Keyboard.printf() as the string contains \n\r instead of \r\n too.

@alessandromrc
Copy link
Contributor

alessandromrc commented May 3, 2023

I now added debouncing to the sketch you made and everything seems to be working correctly and also the board still gets detected without the need of pressing the reset button to get into the bootloader state.

image

#include "PluggableUSBHID.h"
#include "USBKeyboard.h"

USBKeyboard Keyboard;

const int buttonPin = 2;         // the number of the pushbutton pin

int buttonState;             // the current reading from the input pin
int lastButtonState = LOW;   // the previous reading from the input pin

// the following variables are unsigned longs because the time, measured in
// milliseconds, will quickly become a bigger number than can be stored in an int.
unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
unsigned long debounceDelay = 50;    // the debounce time; increase if the output flickers

void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop() {
  // read the state of the button into a local variable:
  int reading = digitalRead(buttonPin);

  // check to see if you just pressed the button
  // (i.e. the input went from HIGH to LOW), and you've waited long enough
  // since the last press to ignore any noise:

  // If the button state changed, due to noise or pressing:
  if (reading != lastButtonState) {
    // reset the debouncing timer
    lastDebounceTime = millis();
  }

  if ((millis() - lastDebounceTime) > debounceDelay) {
    // whatever the reading is at, it's been there for longer than the debounce
    // delay, so take it as the actual current state:

    // if the button state has changed:
    if (reading != buttonState) {
      buttonState = reading;

      // only trigger the keyboard event if the new button state is LOW
      if (buttonState == LOW) {
        Keyboard.printf("Hello world\r\n");
      }
    }
  }

  // save the reading. Next time through the loop, it'll be the lastButtonState:
  lastButtonState = reading;
}

Anyway we should directly add a print with new line as a feature directly built into the library other than always using \r\n as it can be annoying and even support other data-types instead of only const char*.

After updating the library we could add an example for a counter, the hello world and some other stuff like an analogRead so we can let the users see the power of the USBKeyboard library.

@Epipeppy
Copy link
Author

Epipeppy commented May 4, 2023

Ayy, thank you very much! It does work for me as well, wonder if it was one of the updates to the mbed core (or rp 2040 library) that fixed the issue I was having back then. When I ran it just now I did notice that my board disconnects from whatever COM port it was on (I'm on Windows 10 latest update), and is re-detected on a new one. Either way, I'm glad its not preventing the board from being written to now.

If it's of any interest, I made a few modifications to the USBKeyboard library for my own use. Because the old keyboard library used press(), release(), and send(), I adapted the press() and sendPressed() functions to work for this library (added a few other quality of life changes as well). I would post the request on the correct file, but figured I'd ask first, in case you guys/gals have already been working on updating that.

@alessandromrc
Copy link
Contributor

Ayy, thank you very much! It does work for me as well, wonder if it was one of the updates to the mbed core (or rp 2040 library) that fixed the issue I was having back then. When I ran it just now I did notice that my board disconnects from whatever COM port it was on (I'm on Windows 10 latest update), and is re-detected on a new one. Either way, I'm glad its not preventing the board from being written to now.

If it's of any interest, I made a few modifications to the USBKeyboard library for my own use. Because the old keyboard library used press(), release(), and send(), I adapted the press() and sendPressed() functions to work for this library (added a few other quality of life changes as well). I would post the request on the correct file, but figured I'd ask first, in case you guys/gals have already been working on updating that.

I've got literally no time to look into the library so if you want you could post your code too ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants