Permalink
Browse files

updating chp 5 code

  • Loading branch information...
derekmolloy committed May 14, 2018
1 parent 3484531 commit e08bd1ca6aa1f5deb0476c48b4e7fbf14fba387c
View
@@ -31,8 +31,9 @@ elif [ "$1" == "flash" ]; then
echo "Flashing the LED"
removeTrigger
echo "timer" >> "$LED3_PATH/trigger"
echo "50" >> "$LED3_PATH/delay_on"
echo "50" >> "$LED3_PATH/delay_off"
sleep 1
echo "100" >> "$LED3_PATH/delay_off"
echo "100" >> "$LED3_PATH/delay_on"
elif [ "$1" == "status" ]; then
cat "$LED3_PATH/trigger";
fi
View
BIN +2.36 KB (120%) chp05/makeLED/makeLED
Binary file not shown.
View
BIN +1.77 KB (130%) chp05/makeLED/makeLEDC
Binary file not shown.
View
BIN +4.18 KB (130%) chp05/makeLEDOOP/makeLEDs 100644 → 100755
Binary file not shown.
View
BIN +1.92 KB (110%) chp05/makeLEDmulti/makeLEDmulti
Binary file not shown.
View
View
BIN +3.21 KB (160%) chp05/overview/helloworldc
Binary file not shown.
View
BIN +2.43 KB (140%) chp05/overview/helloworldcpp
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,13 @@
#include<stdio.h>
int main(){
int y = 1000, z;
int *p = &y;
printf("The pointer p has the value %d and address: %p\n", *p, p);
// Let z = 1000 + 5 and the increment p and y to 1001 -- wrong!!!
z = *p++ + 5;
printf("The pointer p has the value %d and address: %p\n", *p, p);
printf("The variable z has the value %d\n", z);
return 0;
}
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
BIN +3.29 KB (170%) chp05/overview/shortc
Binary file not shown.
View
BIN +3.19 KB (160%) chp05/overview/shortcpp
Binary file not shown.
View
BIN +8.89 KB chp05/overview/version
Binary file not shown.
@@ -0,0 +1,6 @@
#include <iostream>
int main( int argc, char** argv )
{
std::cout << __cplusplus << std::endl;
return 0;
}
View
Binary file not shown.
View
Binary file not shown.
View
BIN +0 Bytes (100%) chp05/performance/nbody.ghc_run
Binary file not shown.
View
BIN +0 Bytes (100%) chp05/performance/nbodyp.ghc_run
Binary file not shown.
File renamed without changes.
@@ -0,0 +1,15 @@
#!/bin/bash
# A small Bash script to restore the user LEDS to their default
# settings. Written by Derek Molloy (derekmolloy.ie) for the
# book Exploring BeagleBone.
LED_PATH=/sys/class/leds/beaglebone:green:usr
echo "Restoring the LED default states:"
echo "heartbeat" >> $LED_PATH"0/trigger"
echo "mmc0" >> $LED_PATH"1/trigger"
echo "none" >> $LED_PATH"2/trigger"
echo "0" >> $LED_PATH"2/brightness"
echo "none" >> $LED_PATH"3/trigger"
echo "0" >> $LED_PATH"3/brightness"
echo "End of the LED Bash Script"

0 comments on commit e08bd1c

Please sign in to comment.