Close

software - Part 4

A project log for Car of the future!

An ongoing project to add entertainment, bells, whistles and quality of life improvements to the car.

jdubjDub 12/18/2014 at 04:420 Comments

Turning the monitor on

This was an easy one too, made a file called startup.sh in /storage with the following content

#!/bin/sh

cleanup()
{
    echo ${RPI_SCREEN} > /sys/class/gpio/unexport
    echo ${RPI_STATUS} > /sys/class/gpio/unexport
}

RPI_STATUS=27
RPI_SCREEN=22

echo ${RPI_SCREEN} > /sys/class/gpio/export
echo ${RPI_STATUS} > /sys/class/gpio/export
echo "in"  > /sys/class/gpio/gpio${RPI_STATUS}/direction
echo "out" > /sys/class/gpio/gpio${RPI_SCREEN}/direction
echo "1" > /sys/class/gpio/gpio${RPI_SCREEN}/value
sleep 3
echo "in"  > /sys/class/gpio/gpio${RPI_SCREEN}/direction

trap 'cleanup; exit' SIGHUP SIGINT SIGTERM SIGQUIT

cleanup
Right now I am not doing anything with the screen status pin, I will probably change that later

and in autostart.sh add:

/storage/startup.sh &

Discussions