#!/bin/bash
#Test devmem (Toggle RED LED) in rpi2 by shell script
GPIO_BASE=$((0x3F200000))
LED_GPFSEL=4
LED_GPFBIT=21
LED_GPSET=8
LED_GPCLR=11
LED_GPIO_BIT=3
#addr=$(($GPIO_BASE + $LED_GPFSEL * 4))
#rvalue=$(devmem $(($addr)) 32)
addr=$(($GPIO_BASE + $LED_GPCLR * 4))
devmem $((addr)) 32 $((1 << $LED_GPIO_BIT))
sleep 5
addr=$(($GPIO_BASE + $LED_GPSET * 4))
devmem $((addr)) 32 $((1 << $LED_GPIO_BIT))
沒有留言:
發佈留言