From bfdc2a2f6079c5ee48952b1ac09c1d7a22c0010f Mon Sep 17 00:00:00 2001 From: Wilhelm Westermark Date: Sat, 12 Nov 2016 02:22:52 +0100 Subject: [PATCH] Revert "Added README for AVR" This reverts commit 41c4b0ca407290b81d1c3e60712bd42fdaa24042. --- AVR/README.md | 13 --------- RPi/Makefile | 19 ------------- RPi/README.md | 3 --- RPi/i2c_challenge.c | 65 --------------------------------------------- 4 files changed, 100 deletions(-) delete mode 100644 AVR/README.md delete mode 100644 RPi/Makefile delete mode 100644 RPi/README.md delete mode 100644 RPi/i2c_challenge.c diff --git a/AVR/README.md b/AVR/README.md deleted file mode 100644 index ba97668..0000000 --- a/AVR/README.md +++ /dev/null @@ -1,13 +0,0 @@ -This code is made to run on an atmega328p using the library avr-i2c-slave (https://github.com/thegouger/avr-i2c-slave.git) - -I included my avrdude.conf for easy building. - -On Debian you need: -avrdude -gcc-avr -Probably a lot other stuff I forgot. - -Make sure you have the correct fuses, the correct name for you AVR and then run: -make -sudo make program - diff --git a/RPi/Makefile b/RPi/Makefile deleted file mode 100644 index b462983..0000000 --- a/RPi/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Makefile: -################################################################################# - - -#DEBUG = -g -O0 -DEBUG = -O3 -CC = gcc -INCLUDE = -I/usr/local/include -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe - -LDFLAGS = -L/usr/local/lib -LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm - -# Should not alter anything below this line -############################################################################### - -SRC = i2c_challenge.c \ - diff --git a/RPi/README.md b/RPi/README.md deleted file mode 100644 index ef53d02..0000000 --- a/RPi/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This code needs wiringPi - -Compile it by running make i2c_challenge diff --git a/RPi/i2c_challenge.c b/RPi/i2c_challenge.c deleted file mode 100644 index ea5d48d..0000000 --- a/RPi/i2c_challenge.c +++ /dev/null @@ -1,65 +0,0 @@ -O/* -*i2ctest.c -* Raspberry Pi I2C test using wiringPi library. -* -*Copyright (c) Nahid Alam. -*********************************************************** -*i2ctest is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * i2ctest is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * -*********************************************************** -*/ - -#include -#include -#include - -int main (int argc, char *argv[]) -{ - int fd; - int data; - int send=1; - wiringPiSetup () ; - fd=wiringPiI2CSetup (0x20) ; /*Use i2cdetect command to find your respective device address*/ - if(fd==-1) - { - printf("Can't setup the I2C device\n"); - return -1; - } - else - { - while(data != 6) { - wiringPiI2CWrite(fd, send); - data=wiringPiI2CRead(fd); - if(data==-1) - { - printf("No data\n"); - //return -1; - } - else if(data == send*3) { - printf("Sending challenge"); - wiringPiI2CWrite(fd, 4); - } - else if(data == 6) { - printf("Read proper response \n"); - break; - } - else - { - //print data - printf("Waiting to send challenge"); - } - printf(" data=%d\n", data); - - } - } - return 0; -} -