Skip to content

Commit 4ea4b0e

Browse files
committed
Added ESP32::Timer sample
1 parent 6448ea2 commit 4ea4b0e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

components/mruby_component/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set(MRUBY_CONFIG ${COMPONENT_DIR}/esp32_build_config.rb)
44

55
idf_component_register(
66
INCLUDE_DIRS mruby/include
7-
REQUIRES esp_wifi esp_hw_support esp_rom mqtt driver
7+
REQUIRES esp_wifi esp_hw_support esp_rom mqtt driver esp_timer
88
)
99

1010
add_custom_command(

main/examples/system_mrb.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@
1111
puts "ESP32 SDK Version: #{ver}"
1212
mem = ESP32::System.available_memory / 1000
1313
puts "Available Memory: #{mem}K"
14+
sec = ESP32::Timer.get_time / 10000000
15+
puts "Uptime: #{sec}s"
1416
puts
1517
puts "Delaying 10 seconds..."
1618
ESP32::System.delay(10 * 1000)
19+
sec = ESP32::Timer.get_time / 10000000
20+
puts "Uptime: #{sec}s"
21+
puts
1722
puts "Deep sleeping for 10 seconds..."
1823
ESP32::System.deep_sleep_for(10 * 1000000)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy