You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

45 regels
1.2 KiB

  1. #!/bin/bash
  2. #
  3. # test.sh:
  4. # Simple test: Assumes LEDs on Pins 0-7 and lights them
  5. # in-turn.
  6. #################################################################################
  7. # This file is part of wiringPi:
  8. # Wiring Compatable library for the Raspberry Pi
  9. #
  10. # wiringPi is free software: you can redistribute it and/or modify
  11. # it under the terms of the GNU Lesser General Public License as published by
  12. # the Free Software Foundation, either version 3 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # wiringPi is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU Lesser General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU Lesser General Public License
  21. # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
  22. #################################################################################
  23. # Simple test - assumes LEDs on Pins 0-7.
  24. for i in `seq 0 7`;
  25. do
  26. gpio mode $i out
  27. done
  28. while true;
  29. do
  30. for i in `seq 0 7`;
  31. do
  32. gpio write $i 1
  33. sleep 0.1
  34. done
  35. for i in `seq 0 7`;
  36. do
  37. gpio write $i 0
  38. sleep 0.1
  39. done
  40. done