File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def read(sensor, pin):
31
31
# Signal no result could be obtained, but the caller can retry.
32
32
return (None , None )
33
33
elif result == common .DHT_ERROR_GPIO :
34
- raise RuntimeError ('Error accessing GPIO. Make sure program is run as root with sudo! ' )
34
+ raise RuntimeError ('Error accessing GPIO.' )
35
35
elif result != common .DHT_SUCCESS :
36
36
# Some kind of error occured.
37
37
raise RuntimeError ('Error calling DHT test driver read: {0}' .format (result ))
Original file line number Diff line number Diff line change @@ -53,9 +53,9 @@ int pi_2_mmio_init(void) {
53
53
uint32_t gpio_base = peri_base + GPIO_BASE_OFFSET ;
54
54
fclose (fp );
55
55
56
- int fd = open ("/dev/mem " , O_RDWR | O_SYNC );
56
+ int fd = open ("/dev/gpiomem " , O_RDWR | O_SYNC );
57
57
if (fd == -1 ) {
58
- // Error opening /dev/mem. Probably not running as root .
58
+ // Error opening /dev/gpiomem .
59
59
return MMIO_ERROR_DEVMEM ;
60
60
}
61
61
// Map GPIO memory to location in process space.
You can’t perform that action at this time.
0 commit comments