first commit
This commit is contained in:
commit
a5a0434432
1126 changed files with 439481 additions and 0 deletions
26
Software/Ruby/tests/test_write_digital.rb
Executable file
26
Software/Ruby/tests/test_write_digital.rb
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require '../grove_pi'
|
||||
|
||||
firmware_version_bytes = GrovePi.read_firmware_version
|
||||
|
||||
print "Firmware: #{firmware_version_bytes[0]}.\
|
||||
#{firmware_version_bytes[1]}.\
|
||||
#{firmware_version_bytes[2]}
|
||||
Test : Write digital value to port D3
|
||||
========================================
|
||||
|
||||
"
|
||||
|
||||
while true
|
||||
GrovePi.write_digital GrovePi::D3, 1
|
||||
puts '[+] Tick: ON'
|
||||
sleep 1
|
||||
|
||||
GrovePi.write_digital GrovePi::D3, 0
|
||||
puts '[+] Tock: OFF'
|
||||
sleep 1
|
||||
|
||||
puts '[+] End of cycle'
|
||||
puts
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue