Showing posts with label Hello World. Show all posts
Showing posts with label Hello World. Show all posts

Tuesday, March 10, 2015

GPU demo program, run on Raspberry Pi 2

Raspbian (http://www.raspberrypi.org/downloads/) come with a number of demo program for the GPU, Broadcom VideoCore, in /opt/vc/src/hello_pi.


/opt/vc/src/hello_pi/README
Building on Pi
++++++++++++++

To build the test apps on the pi, first build the libs:
make -C libs/ilclient
make -C libs/vgfont

then by entering each test app directory and run make. E.g.
  cd hello_world
  make
  ./hello_world.bin

Running ./rebuild.sh will rebuild the all libs and and apps.


Building on a different PC
++++++++++++++++++++++++++

If you want to build the samples on a different machine (cross-compile) then set:
SDKSTAGE=<path/to/firmware-directory> and CC=<path/to/cross-compiler>
before running make.

To build all the demo program, switch to the folder /opt/vc/src/hello_pi, enter command:
$ ./rebuild.sh

Press Ctrl+C to exit running demo program.

Monday, November 11, 2013

Programming Hello World with Java on Raspberry Pi

To start program on Raspberry Pi using Java programming, what you need are JDK for Raspberry Pi and a simple text editor such as the build-in LeafPad.

Edit the code with LeafPad, with name of helloPi.java:
class helloPi
{
 public static void main(String srgs[])
 {
  
  System.out.println("Hello Raspberry Pi");
 }
}


Then compile an run it with the command:
$ javac helloPi.java
$ java helloPi