Commit fbf11fe8 authored by Michael Vernier's avatar Michael Vernier

Initial commit

parents
{{conductor.TargetName}}
.settings/
*.o
# Makefile for Raspberry Pi 2 applications compiled in Windows
TARGET = {{conductor.TargetName}}
#DEBUG = -g -O0
DEBUG = -O3
CC = arm-linux-gnueabihf-gcc
CXX = arm-linux-gnueabihf-g++
LD = $(CXX)
INCLUDE = -Ig:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/local/include -I.
CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe -std=c++0x
LDFLAGS = -Lg:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/local/lib
LDLIBS = -lbcm2835 -lpthread -lm -ldxl
C_SRC =
CPP_SRC = main.cpp
OBJ = $(C_SRC:.c=.o) $(CPP_SRC:.cpp=.o)
BINS = $(SRC:.c=)
all: $(TARGET)
$(TARGET): $(OBJ)
@echo [link]
$(LD) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)
.c.o:
@echo [CC] $<
$(CC) -c $(CFLAGS) $< -o $@
.cpp.o:
@echo [CXX] $<
$(CXX) -c $(CFLAGS) $< -o $@
clean:
@echo "[Clean]"
@rm -f $(OBJ) *~ core tags $(BINS) $(TARGET)
deploy: $(TARGET)
scp $(TARGET) pi@192.168.0.247:/home/pi/.
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <bcm2835.h>
using namespace std;
// Pin 18, BCM_24
#define PIN RPI_V2_GPIO_P1_18
#define OUTPUT BCM2835_GPIO_FSEL_OUTP
int main( void )
{
if( !bcm2835_init() )
{
return 1;
}
bcm2835_gpio_fsel( PIN, OUTPUT );
while( true )
{
delay( 500 );
bcm2835_gpio_write( PIN, HIGH );
delay( 500 );
bcm2835_gpio_write( PIN, LOW );
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment