Step 10: Compile and Run ADXL362_RaspPi

terminal code:
gcc -o ADXL362_RaspPi -I ../bcm2835-1.5/src ../bcm2835.c ADXL_RaspPi.c
sudo ./ADXL362_RaspPi

Which I combines into a script called compileADXL362.
Awesome instructable. If your RasPi browser nameserver isn't pulling up domains, try: <br> <br># sudo cat &gt;&gt; /etc/resolv.conf <br>nameserver <br>control-z-key <br> <br>This adds the Google public DNS server. You can add any nameserver you want instead of <br> <br>Others can build on this to do hardware SPI instead of bitbanging, saving digital pins and making things faster, cool :)
<p>Ctrl-Z is ugly... When you give instructions, you try to make it 1d10t-proof:</p><p>grep &quot;^nameserver.*$&quot; /etc/resolv.conf &gt; /dev/null ; if [ &quot;${?}&quot; -ne &quot;0&quot; ] ; then echo -en &quot;\nnameserver\n&quot; &gt;&gt; /etc/resolv.conf ; fi</p><p>That way, you are sure the line is added only once in the file with a simple copy&amp;paste and can be run as many times without crippling your DNS resolver.</p><p> is Google's openDNS but the DHCP from your DSL router should have pointed you to a fast accurate DNS, usually looking like (your router is usually a DNS server too in home installations) ; if your DNS is not set, it's probably you've already been fiddling with static manual IP configuration without being too sure of what you were doing (to say it mildly).</p><p> is convenient, but you should never use it for normal operation.</p>
Thanks so much for the tip! I can use all the advice I can get ;) <br> <br>I'll give it a try, and update the tutorial if is works.
Hi All. <br>Before step 10 i suggest to check if in /etc/modprobe.d/raspi-blacklist.conf you have blacklisted spi... I had. The file should look like this: <br> <br># blacklist spi and i2c by default (many users don't need them) <br>#blacklist spi-bcm2708 <br>#blacklist i2c-bcm2708
or just this. <br> <br>git clone git://github.com/annem/ADXL362_RaspPi
I had to update the following command in order to get this tutorial to work: <br>(1) updated inputs (denoted by -I in command) <br>(2) updated the path from ../bcm2835.c to ../bcm2835-1.5/src/bcm2835.c <br>(3) updated file name from ADXL_RaspPi.c to ADXL362_RaspPi.c <br> <br>gcc -o ADXL362_RaspPi -I ../bcm2835-1.5/src ../bcm2835.c ADXL_RaspPi.c <br> <br> <br>
-Try this to do it from command line: <br> <br>1) create a specific directory: <br>mkdir ADXL362_RaspPi <br>cd ADXL362_RaspPi/ <br> <br>2) install Git if you don't have it: <br>sudo apt-get install git <br> <br>3) create a repository and pull from Github: <br>git init . <br>git add . <br>git pull https://github.com/annem/ADXL362_RaspPi.git
You can avoid the email by using IPv6 Link Local. <br>Your raspberry PI will always have the same IPv6 Link Local address every time it boots and it's determined from it's mac address. <br> <br>For example, if your PI has a MAC address of 23:45:67:89:ab:cd, then it's link local address will be fe80::2145:67ff:fe89:abcd. <br> <br>Converting the MAC to link local is as follows: Take the first three octets of MAC and insert FFFE and then the last 3 octets. (all values in hex). <br>For 11:11:11:22:22:22 this results in 1111:11FF:FE22:2222 <br> <br>Then, invert the 0x02 bit of the first octet: 1311:11ff:fe22:2222. <br> <br>Finally place fe80:: in front fe80::1311:11ff:fe22:2222 <br> <br>Now, to communicate with that, you will need to specify the interface ID of the outbound interface on your machine. On rational systems, this is the name of the interface, such as &quot;eth0&quot; on Linux or &quot;en0&quot; on Mac, &quot;fxp0&quot; on BSD, etc. On windows boxes, it's unfortunately a number which has little rime or reason to it, but you should be able to get the correct number from ipconfig /all. <br>
I'll have to tinker with that... thanks! Not familiar with IPv6, yet. Thanks for the tip!

About This Instructable




More by engineerbynight:*Preliminary* SPI on the Pi: Communicating with a SPI 3-axis accelerometer using a Raspberry Pi 
Add instructable to: