Ersatz Fahrrad Computer durch Uno

Ganz lieben Dank für den Code und die Mühe die Du dir gemacht hast.

Der Code funktioniert. Erstmal nur am Schreibtisch getestet. Ich muß erst mal sehen wie ich das am Moped anbauen kann.

Die Idee mit den Großen Zahlen ist nicht schlecht. Ich hab das hier mit mal ausprobiert: http://forum.arduino.cc/index.php/topic,8790.0.html und die entsprechenden Codeteile in das Programm kopiert. Nur wenn ich dann die Anzeige in groß haben will, dann gibt es eine Fehlermeldung beim compilieren: Invalid conversion from "char*" to "byte"

//Anzahl Spalten des Display (16)
#define LCD_WIDTH 16

//Anzahl Zeilen des Display (2)
#define LCD_HEIGHT 2

// Pin für Reed-Kontakt, Digital-2 für Interrupt 0
#define REEDPIN 2

// Hardware-Interrupt für den Reed-Pin
#define REEDINTERRUPT 0

// Radumfang in mm
#define RADUMFANG 1540


#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

// build 2-line digit font data array
// Digits are 3 characters wide.
byte bignums[10][2][3] = {
// Define which characters to use for each number. 255 is a solid block; 254 is a space  
// The format is { {TopLeft, TopMiddle, TopRight}, {BottomLeft, BottomMiddle, BottomRight} }
 { {255, 0, 255}, {255, 1, 255} },        // data to display "0"
 { {0, 255, 254}, {1, 255, 1} },          // data to display "1"
 { {2, 2, 255}, {255, 1, 1} },            // data to display "2"
 { {0, 2, 255}, {1, 1, 255} },            // data to display "3"
 { {255, 1, 255}, {254, 254, 255} },      // data to display "4"
 { {255, 2, 2}, {1, 1, 255} },            // data to display "5"
 { {255, 2, 2}, {255, 1, 255} },          // data to display "6"
 { {0, 0, 255}, {254, 255, 254} },        // data to display "7"
 { {255, 2, 255}, {255, 1, 255} },        // data to display "8"
 { {255, 2, 255}, {254, 254, 255} }       // data to display "9"
};

void setup(){
  
  // turn on DigitalPin 13 LED to signal that the custom characters have been loaded into the LCD  
  pinMode(13, OUTPUT);
  loadchars();
  digitalWrite(13, HIGH);
  
  lcd.begin(LCD_WIDTH, LCD_HEIGHT);
  pinMode(REEDPIN, INPUT_PULLUP); // Reedkontakt direkt und ohne Widerstand angeschlossen  
  attachInterrupt(REEDINTERRUPT, reedISR, FALLING);
}

volatile byte reedCountSum;
volatile long reedMillisSum;

unsigned long lastReedMillis;

void reedISR()
{
  if (millis()-lastReedMillis>=25)  // 25ms entspricht max. 40 Radumdrehungen pro Sekunde
  {
    reedCountSum++;                 // eine Radumdrehung zählen
    reedMillisSum+=millis()-lastReedMillis;   // Zeit addieren
    lastReedMillis=millis();       // Zeit merken
  }
}

unsigned long gesamtUmdrehungen;

void tachoAnzeige()
{
  byte umdrehungen;
  unsigned long zeit;
  float kph, kilometer;
  char buffer[10];
  noInterrupts();            // Interrupts sperren
    umdrehungen=reedCountSum;// Zählvariable umkopieren
    reedCountSum=0;          // Zählvariable auf 0 zurücksetzen
    zeit=reedMillisSum;      // Zeitzähler umkopieren
    reedMillisSum=0;         // Zeitzähler auf 0 zurücksetzen
  interrupts();              // Interrupts wieder zulassen
  gesamtUmdrehungen+= umdrehungen; // Aufsummieren aller Radumdrehungen
  kilometer=(float)gesamtUmdrehungen*(float)RADUMFANG/1000000.0; // Fahrtkilometerzähler
  if (umdrehungen>0)
    kph=float(RADUMFANG)*(float)umdrehungen/(float)zeit*3.6;
  else
    kph=0.0;  
  lcd.setCursor(0, 0);
  dtostrf(kilometer,9,3,buffer);
  lcd.print(buffer);
  lcd.print(" km");
  lcd.setCursor(0, 1);
  lcd.print("KM/H ");
  dtostrf(kph,5,1,buffer);
  printbigchar(buffer); //Zeile mit der Fehlermeldung
}


unsigned long letzteSekunde=0;
void loop()
{
  unsigned long dieseSekunde=millis()/1000;
  // Tachoanzeige wird genau einmal pro Sekunde aktualisiert
  if (letzteSekunde != dieseSekunde)
  {
    tachoAnzeige();
    letzteSekunde=dieseSekunde;
  }
}
void loadchars() {                        // This subroutine programs the custom character data into the LCD
  lcd.command(64);
// Custom character 0
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  
// Custom character 1
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  
// Custom character 2
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  lcd.write(byte(B11111));
  
// Custom character 3
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B01110));
  lcd.write(byte(B01110));
  lcd.write(byte(B01110));
  
// Custom character 4
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B01110));
  lcd.write(byte(B01110));
  lcd.write(byte(B01110));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  
// Custom character 5
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  
// Custom character 6
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  
// Custom character 7
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
  lcd.write(byte(B00000));
 
  lcd.home();
}
 void printbigchar(byte digit, byte col) { // This subroutine prints the big font characters on the LCD screen
 if (digit > 9) return;                   // anything above 9 gets rejected
 for (int i = 0; i < 2; i++) {            // count i from 0 to 1
   lcd.setCursor(col*4 , i);              // set LCD cursor at correct point
   for (int j = 0; j < 3; j++) {          // count j from 0 to 2
     lcd.write(bignums[digit][i][j]);     // write proper block to LCD from array
   }
   lcd.write(254);                        // write an empty space
 }
 
 lcd.setCursor(col + 4, 0);               // move the cursor to the top line, col + 4
}

Ich habe drangeschrieben welche Zeile gemeint ist.

Micky