Skip to content

Commit

Permalink
0.0.2
Browse files Browse the repository at this point in the history
+ remove examples from LCD5110
  • Loading branch information
holzheu authored and holzheu committed Sep 27, 2020
1 parent ec29b1a commit 53fa4ce
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 568 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
This is the repository for the fabwaage-board. The libraries are designed to compile with Arduino IDE 1.8.x

## Installation
1. Copy the URL (https://raw.githubusercontent.com/fablab-bayreuth/FabWaage/master/package.json) to your additional boardmanager-URLs in your arduino IDE preferences (file/preferences)
1. Copy the URL (https://raw.githubusercontent.com/fablab-bayreuth/FabWaage/master/package_fabwaage_index.json) to your additional boardmanager-URLs in your arduino IDE preferences (file/preferences)
2. Install the package via tools/Board/Boardmanager

This library relays on some third party libraries (see below). To ease up installation
these libraries have been included into this repository.

## Boards
Currently two boards (Nokia5110 and 7Segment) are defined. Please make sure that you choose the right board,
escpecially when working with the 7Segment board!
3 changes: 1 addition & 2 deletions boards.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#############################################################
#
# Use this file to replace your boards.txt in order to burn
# bootloaders on the device. Bootloader will always report
# Bootloader will always report
# atmega328p regardless whether ist is a atmega328,
# atmega328p or atmega328pb
#
Expand Down
40 changes: 40 additions & 0 deletions libraries/LCD5110/Boardtest/PreTest/PreTest.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Test to run bevor LCD is soldered to board
* Check pins of LCD and HX711 against GND to
* see if there are solder shortcuts on the chip
*
*/

void setup(void){
Serial.begin(9600);
Serial.println("Starting");
for(uint8_t i=2;i<14;i++){
pinMode(i,INPUT_PULLUP);
Serial.print(i);
Serial.print(" ");
}
for(uint8_t i=0;i<6;i++){
pinMode(A0+i,INPUT_PULLUP);
Serial.print("A");
Serial.print(i);
Serial.print(" ");
}
Serial.println();
}

void loop(void){
for(uint8_t i=2;i<14;i++){
if(i>9) Serial.print(" ");

Serial.print(digitalRead(i));
Serial.print(" ");
}
for(uint8_t i=0;i<6;i++){
Serial.print(" ");
Serial.print(digitalRead(A0+i));
Serial.print(" ");
}
Serial.println();
delay(1000);

}
77 changes: 77 additions & 0 deletions libraries/LCD5110/Boardtest/Test/Test.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#include <HX711Array.h>
#include <NTC.h>
#include <Sleep.h>
uint8_t dout[] = {HX711_DOUT};
uint8_t sck = HX711_SCK;

HX711Array scale;
NTC_HX711 ntc(scale, 2 * 470000.0, 10.0);

#include <LCD5110_Basic.h>
LCD5110 myGLCD(NOKIA_SCLK, NOKIA_DN, NOKIA_DC, NOKIA_RST, NOKIA_CE);

extern uint8_t SmallFont[];

volatile uint8_t on_flag = 0;
volatile uint8_t tar_flag = 0;

volatile uint16_t tics;
ISR(TIMER2_OVF_vect) {
tics++;
}

void isr_int0(void) {
on_flag = 1;
}

void isr_int1(void) {
if (! tar_flag) tar_flag = 1;
}
void setup()
{
Serial.begin(9600);
Sleep.setupTimer2(2); //init timer2 to 1/16 sec
pinMode(NOKIA_VCC, OUTPUT);
pinMode(NOKIA_LED, OUTPUT);
digitalWrite(NOKIA_VCC, HIGH);
Sleep.setupTimer2(2); //init timer2 to 1/16 sec
pinMode(2, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(2), isr_int0, FALLING);
pinMode(3, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(3), isr_int1, FALLING);

myGLCD.InitLCD();
myGLCD.setFont(SmallFont);
myGLCD.print("Starting", LEFT, 8);
scale.begin(dout, 1, sck); //start HX711Array with 1 ADCs
scale.set_no_sleep(1);
scale.power_up();
Serial.println("Setup done");
}

void loop()
{
Serial.println("Loop start");
if (on_flag) {
delay(100);
digitalWrite(NOKIA_LED, ! digitalRead(NOKIA_LED));
on_flag = 0;
}
scale.power_up();
ntc.readResistance();
float temp = ntc.getTemp(0);
scale.power_up();
scale.read_average(1);
long adc = scale.read_average(20);
myGLCD.clrScr();
char text[20];
dtostrf(temp, 4, 2, text); // avr-libc function for floats
myGLCD.print("TEMP:", LEFT, 8);
myGLCD.print(text, RIGHT, 8);
ltoa(temp, text, 10);
myGLCD.print("ADC:", LEFT, 16);
myGLCD.print(text, RIGHT, 16);
delay(500);
Serial.println("loop done");

}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 53fa4ce

Please sign in to comment.