Merge branch display into release

This commit is contained in:
Anina Morgner 2024-06-12 21:36:56 +02:00
commit 56ec73f76e
28 changed files with 172291 additions and 12 deletions

View File

@ -0,0 +1,8 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
]
}

View File

@ -0,0 +1,48 @@
#include "Dezibot.h"
Dezibot dezibot = Dezibot();
const int centeredThreshold = 50 ;
void setup() {
// put your setup code here, to run once:
dezibot.begin();
Serial.begin(115200);
}
void loop() {
int32_t leftValue = (int32_t)dezibot.lightDetection.getAverageValue(IR_LEFT, 20, 1);
int32_t rightValue = (int32_t)dezibot.lightDetection.getAverageValue(IR_RIGHT, 20, 1);
switch(dezibot.lightDetection.getBrightest(IR)){
case IR_FRONT:
//correct Stearing to be centered
if( abs(leftValue-rightValue)
< centeredThreshold){
dezibot.motion.move();
}else{
if (leftValue > rightValue){
dezibot.motion.rotateAntiClockwise();
} else{
dezibot.motion.rotateClockwise();
}
}
dezibot.multiColorLight.setTopLeds(BLUE);
break;
case IR_LEFT:
dezibot.motion.rotateAntiClockwise();
dezibot.multiColorLight.setTopLeds(RED);
break;
case IR_RIGHT:
dezibot.motion.rotateClockwise();
dezibot.multiColorLight.setTopLeds(GREEN);
break;
case IR_BACK:
if(leftValue > rightValue){
dezibot.motion.rotateAntiClockwise();
} else {
dezibot.motion.rotateClockwise();
}
dezibot.multiColorLight.setTopLeds(YELLOW);
break;
}
//delay(100);
}

View File

@ -0,0 +1,156 @@
#include <Dezibot.h>
#include <arduinoFFT.h>
#include <rom/ets_sys.h>
const uint16_t samples = 256; //This value MUST ALWAYS be a power of 2
const int centeredThreshold = 50 ;
//const float signalFrequency = 1000;
const float samplingFrequency = 4000;
float vReal[4][samples];
float vImag[4][samples];
#define SCL_INDEX 0x00
#define SCL_TIME 0x01
#define SCL_FREQUENCY 0x02
#define SCL_PLOT 0x03
ArduinoFFT<float> FFT = ArduinoFFT<float>(vReal[0], vImag[0], samples, samplingFrequency); /* Create FFT object */
Dezibot dezibot = Dezibot();
void setup() {
dezibot.begin();
Serial.begin(115200);
//dezibot.infraredLight.front.turnOn();
//dezibot.infraredLight.bottom.turnOn();
}
void loop() {
portDISABLE_INTERRUPTS();
for(int i = 0; i < samples; i++){
vReal[0][i] = dezibot.lightDetection.getValue(IR_FRONT);
vImag[0][i] = 0.0;
vReal[1][i] = dezibot.lightDetection.getValue(IR_LEFT);
vImag[1][i] = 0.0;
vReal[2][i] = dezibot.lightDetection.getValue(IR_RIGHT);
vImag[2][i] = 0.0;
vReal[3][i] = dezibot.lightDetection.getValue(IR_BACK);
vImag[3][i] = 0.0;
ets_delay_us(125);
}
portENABLE_INTERRUPTS();
//PrintVector(vReal, (samples>>1), 0);
//PrintVector(vReal, (samples>>1), 0);
float frequency[4];
float magnitude[4];
for(int index = 0; index <4; index++){
FFT.setArrays(vReal[index], vImag[index]);
FFT.windowing(FFTWindow::Rectangle, FFTDirection::Forward); /* Weigh data */
FFT.compute(FFTDirection::Forward); /* Compute FFT */
FFT.complexToMagnitude(); /* Compute magnitudes */
FFT.majorPeak(&frequency[index],&magnitude[index]);
if(abs(frequency[index]-1147)>10){
magnitude[index] = 0;
}
Serial.print(index);
Serial.print(":");
Serial.print(frequency[index]);
Serial.print(",");
Serial.print(index+4);
Serial.print(":");
Serial.print(magnitude[index]);
if(index < 3){
Serial.print(",");
}
Serial.println();
}
//================================================
float leftValue = magnitude[1];
float rightValue = magnitude[2];
switch(brightest(magnitude)){
case IR_FRONT:
//correct Stearing to be centered
if( abs(leftValue-rightValue)
< centeredThreshold){
dezibot.motion.move();
}else{
if (leftValue > rightValue){
dezibot.motion.rotateAntiClockwise();
} else{
dezibot.motion.rotateClockwise();
}
}
dezibot.multiColorLight.setTopLeds(BLUE);
break;
case IR_LEFT:
dezibot.motion.rotateAntiClockwise();
dezibot.multiColorLight.setTopLeds(RED);
break;
case IR_RIGHT:
dezibot.motion.rotateClockwise();
dezibot.multiColorLight.setTopLeds(GREEN);
break;
case IR_BACK:
if(leftValue > rightValue){
dezibot.motion.rotateAntiClockwise();
} else {
dezibot.motion.rotateClockwise();
}
dezibot.multiColorLight.setTopLeds(YELLOW);
break;
}
}
photoTransistors brightest(float *magnitudes){
int pos;
float maxMagnitude = 0;
for(int index = 0; index <4; index++){
if (magnitudes[index] > maxMagnitude){
pos = index;
maxMagnitude = magnitudes[index];
}
}
switch (pos) {
case 0:
return IR_FRONT;
case 1:
return IR_LEFT;
case 2:
return IR_RIGHT;
case 3:
return IR_BACK;
}
}
void PrintVector(float *vData, uint16_t bufferSize, uint8_t scaleType)
{
for (uint16_t i = 0; i < bufferSize; i++)
{
float abscissa;
/* Print abscissa value */
switch (scaleType)
{
case SCL_INDEX:
abscissa = (i * 1.0);
break;
case SCL_TIME:
abscissa = ((i * 1.0) / samplingFrequency);
break;
case SCL_FREQUENCY:
abscissa = ((i * 1.0 * samplingFrequency) / samples);
break;
}
Serial.print(abscissa, 6);
if(scaleType==SCL_FREQUENCY)
Serial.print("Hz");
Serial.print(" ");
Serial.println(vData[i], 4);
}
Serial.println();
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,35 @@
#include "Dezibot.h"
Dezibot dezibot = Dezibot();
void setup() {
// put your setup code here, to run once:
dezibot.begin();
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print("Front:");
Serial.print(dezibot.lightDetection.getAverageValue(IR_FRONT,20,1));
Serial.print(",Left:");
Serial.print(dezibot.lightDetection.getAverageValue(IR_LEFT,20,1));
Serial.print(",Right:");
Serial.print(dezibot.lightDetection.getAverageValue(IR_RIGHT,20,1));
Serial.print(",Back:");
Serial.println(dezibot.lightDetection.getAverageValue(IR_BACK,20,1));
switch(dezibot.lightDetection.getBrightest(IR)){
case IR_FRONT:
dezibot.multiColorLight.setTopLeds(BLUE);
break;
case IR_LEFT:
dezibot.multiColorLight.setTopLeds(RED);
break;
case IR_RIGHT:
dezibot.multiColorLight.setTopLeds(GREEN);
break;
case IR_BACK:
dezibot.multiColorLight.setTopLeds(YELLOW);
break;
}
//delay(100);
}

View File

@ -0,0 +1,393 @@
/**************************************************************************
This is an example for our Monochrome OLEDs based on SSD1306 drivers
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/category/63_98
This example is for a 128x32 pixel display using I2C to communicate
3 pins are required to interface (two I2C and one reset).
Adafruit invests time and resources providing this open
source code, please support Adafruit and open-source
hardware by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries,
with contributions from the open source community.
BSD license, check license.txt for more information
All text above, and the splash screen below must be
included in any redistribution.
**************************************************************************/
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
#define LOGO_HEIGHT 64
#define LOGO_WIDTH 128
const unsigned char logo_bmp [] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xF0, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xF0, 0x1F,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, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF1,
0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD
};
void setup() {
Wire.begin(1,2);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop() {
display.invertDisplay(true);
drawlogo();
delay(3000);
drawbanner();
delay(3000);
jiaText();
}
void jiaText(void) {
display.invertDisplay(false);
display.clearDisplay();
display.setCursor(0, 0);
display.setTextColor(WHITE);
display.setTextSize(2); // Draw 2X-scale text
display.println("Hallo \nJunior-\nIngenieur-\nAkademie!");
display.display(); // Show initial text
delay(3000);
display.stopscroll();
}
void drawlogo(void) {
display.clearDisplay();
display.drawBitmap(
(display.width() - LOGO_WIDTH ) / 2,
(display.height() - LOGO_HEIGHT) / 2,
logo_bmp, LOGO_WIDTH, LOGO_HEIGHT, 1);
display.display();
}
void drawbanner(void) {
display.clearDisplay();
display.drawBitmap(
(display.width() - LOGO_WIDTH ) / 2,
(display.height() - LOGO_HEIGHT) / 2,
Banner, LOGO_WIDTH, LOGO_HEIGHT, 1);
display.display();
}
void drawicon1(void){
display.clearDisplay();
display.drawBitmap(
(display.width() - ICON_WIDTH) / 2,
(display.height() - ICON_HEIGHT) /2,
icon_1, ICON_WIDTH, ICON_HEIGHT, 1);
display.display();
}
void drawicon2(void){
display.clearDisplay();
display.drawBitmap(
(display.width() - ICON_WIDTH) / 2,
(display.height() - ICON_HEIGHT) /2,
icon_2, ICON_WIDTH, ICON_HEIGHT, 1);
display.display();
}
void drawicon3(void){
display.clearDisplay();
display.drawBitmap(
(display.width() - ICON_WIDTH) / 2,
(display.height() - ICON_HEIGHT) /2,
icon_3, ICON_WIDTH, ICON_HEIGHT, 1);
display.display();
}
void drawicon4(void){
display.clearDisplay();
display.drawBitmap(
(display.width() - ICON_WIDTH) / 2,
(display.height() - ICON_HEIGHT) /2,
icon_4, ICON_WIDTH, ICON_HEIGHT, 1);
display.display();
}

View File

@ -0,0 +1,17 @@
#include "Dezibot.h"
Dezibot dezibot = Dezibot();
void setup() {
// put your setup code here, to run once:
dezibot.begin();
}
void loop() {
// put your main code here, to run repeatedly:
dezibot.display.print("Hello from\nDezibot!");
delay(5000);
dezibot.display.clear();
dezibot.display.print("Bye!");
delay(5000);
dezibot.display.clear();
}

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,167 @@
#include <Dezibot.h> #include <Dezibot.h>
#include <arduinoFFT.h>
#include <rom/ets_sys.h>
const uint16_t samples = 256; //This value MUST ALWAYS be a power of 2
const int centeredThreshold = 50 ;
//const float signalFrequency = 1000;
const float samplingFrequency = 4000;
float vReal[4][samples];
float vImag[4][samples];
#define SCL_INDEX 0x00
#define SCL_TIME 0x01
#define SCL_FREQUENCY 0x02
#define SCL_PLOT 0x03
ArduinoFFT<float> FFT = ArduinoFFT<float>(vReal[0], vImag[0], samples, samplingFrequency); /* Create FFT object */
Dezibot dezibot = Dezibot(); Dezibot dezibot = Dezibot();
<<<<<<< HEAD
=======
>>>>>>> remotes/origin/feature/#9-display
void setup() { void setup() {
dezibot.begin(); dezibot.begin();
Serial.begin(115200);
//dezibot.infraredLight.front.turnOn(); //dezibot.infraredLight.front.turnOn();
//dezibot.infraredLight.bottom.turnOn(); //dezibot.infraredLight.bottom.turnOn();
} }
void loop() { void loop() {
<<<<<<< HEAD
dezibot.infraredLight.bottom.turnOn(); dezibot.infraredLight.bottom.turnOn();
delay(1000); delay(1000);
dezibot.infraredLight.bottom.turnOff(); dezibot.infraredLight.bottom.turnOff();
delay(1000); delay(1000);
=======
portDISABLE_INTERRUPTS();
for(int i = 0; i < samples; i++){
vReal[0][i] = dezibot.lightDetection.getValue(IR_FRONT);
vImag[0][i] = 0.0;
vReal[1][i] = dezibot.lightDetection.getValue(IR_LEFT);
vImag[1][i] = 0.0;
vReal[2][i] = dezibot.lightDetection.getValue(IR_RIGHT);
vImag[2][i] = 0.0;
vReal[3][i] = dezibot.lightDetection.getValue(IR_BACK);
vImag[3][i] = 0.0;
ets_delay_us(125);
}
portENABLE_INTERRUPTS();
//PrintVector(vReal, (samples>>1), 0);
//PrintVector(vReal, (samples>>1), 0);
float frequency[4];
float magnitude[4];
for(int index = 0; index <4; index++){
FFT.setArrays(vReal[index], vImag[index]);
FFT.windowing(FFTWindow::Rectangle, FFTDirection::Forward); /* Weigh data */
FFT.compute(FFTDirection::Forward); /* Compute FFT */
FFT.complexToMagnitude(); /* Compute magnitudes */
FFT.majorPeak(&frequency[index],&magnitude[index]);
if(abs(frequency[index]-1147)>10){
magnitude[index] = 0;
}
Serial.print(index);
Serial.print(":");
Serial.print(frequency[index]);
Serial.print(",");
Serial.print(index+4);
Serial.print(":");
Serial.print(magnitude[index]);
if(index < 3){
Serial.print(",");
}
Serial.println();
}
//================================================
float leftValue = magnitude[1];
float rightValue = magnitude[2];
switch(brightest(magnitude)){
case IR_FRONT:
//correct Stearing to be centered
if( abs(leftValue-rightValue)
< centeredThreshold){
dezibot.motion.move();
}else{
if (leftValue > rightValue){
dezibot.motion.rotateAntiClockwise();
} else{
dezibot.motion.rotateClockwise();
}
}
dezibot.multiColorLight.setTopLeds(BLUE);
break;
case IR_LEFT:
dezibot.motion.rotateAntiClockwise();
dezibot.multiColorLight.setTopLeds(RED);
break;
case IR_RIGHT:
dezibot.motion.rotateClockwise();
dezibot.multiColorLight.setTopLeds(GREEN);
break;
case IR_BACK:
if(leftValue > rightValue){
dezibot.motion.rotateAntiClockwise();
} else {
dezibot.motion.rotateClockwise();
}
dezibot.multiColorLight.setTopLeds(YELLOW);
break;
}
}
photoTransistors brightest(float *magnitudes){
int pos;
float maxMagnitude = 0;
for(int index = 0; index <4; index++){
if (magnitudes[index] > maxMagnitude){
pos = index;
maxMagnitude = magnitudes[index];
}
}
switch (pos) {
case 0:
return IR_FRONT;
case 1:
return IR_LEFT;
case 2:
return IR_RIGHT;
case 3:
return IR_BACK;
}
}
void PrintVector(float *vData, uint16_t bufferSize, uint8_t scaleType)
{
for (uint16_t i = 0; i < bufferSize; i++)
{
float abscissa;
/* Print abscissa value */
switch (scaleType)
{
case SCL_INDEX:
abscissa = (i * 1.0);
break;
case SCL_TIME:
abscissa = ((i * 1.0) / samplingFrequency);
break;
case SCL_FREQUENCY:
abscissa = ((i * 1.0 * samplingFrequency) / samples);
break;
}
Serial.print(abscissa, 6);
if(scaleType==SCL_FREQUENCY)
Serial.print("Hz");
Serial.print(" ");
Serial.println(vData[i], 4);
}
Serial.println();
>>>>>>> remotes/origin/feature/#9-display
} }

View File

@ -2,6 +2,10 @@
Dezibot dezibot = Dezibot(); Dezibot dezibot = Dezibot();
void setup() { void setup() {
dezibot.begin(); dezibot.begin();
<<<<<<< HEAD:example/motion_indicating/motion_indicating.ino
=======
Serial.begin(115200);
>>>>>>> remotes/origin/feature/#9-display:example/motion/motion.ino
} }
void loop() { void loop() {
dezibot.motion.move(1000); dezibot.motion.move(1000);

View File

@ -3,7 +3,11 @@
// //
#define SDA_PIN 1
#define SCL_PIN 2
#include "Dezibot.h" #include "Dezibot.h"
<<<<<<< HEAD
#include <SPI.h> #include <SPI.h>
#include <Adafruit_NeoPixel.h> #include <Adafruit_NeoPixel.h>
@ -14,10 +18,27 @@
#define GPIO_LED 48 #define GPIO_LED 48
void Dezibot::begin(void) { void Dezibot::begin(void) {
=======
#include <Wire.h>
Dezibot::Dezibot():multiColorLight(){};
void Dezibot::begin(void) {
Wire.begin(SDA_PIN,SCL_PIN);
infraredLight.begin();
lightDetection.begin();
>>>>>>> remotes/origin/feature/#9-display
motion.begin(); motion.begin();
lightDetection.begin(); lightDetection.begin();
colorDetection.begin(); colorDetection.begin();
multiColorLight.begin(); multiColorLight.begin();
<<<<<<< HEAD
motionDetection.begin(); motionDetection.begin();
infraredLight.begin(); infraredLight.begin();
} }
=======
display.begin();
};
>>>>>>> remotes/origin/feature/#9-display

View File

@ -17,6 +17,7 @@
#include "multiColorLight/MultiColorLight.h" #include "multiColorLight/MultiColorLight.h"
#include "motionDetection/MotionDetection.h" #include "motionDetection/MotionDetection.h"
#include "infraredLight/InfraredLight.h" #include "infraredLight/InfraredLight.h"
#include "display/Display.h"
class Dezibot { class Dezibot {
@ -29,6 +30,7 @@ public:
MultiColorLight multiColorLight; MultiColorLight multiColorLight;
MotionDetection motionDetection; MotionDetection motionDetection;
InfraredLight infraredLight; InfraredLight infraredLight;
Display display;
void begin(void); void begin(void);
/* /*
Display display Display display

147
src/display/CharTable.h Normal file
View File

@ -0,0 +1,147 @@
/**
* @file CharTable.h
* @author Hans Haupt (hans.haupt@dezibot.de)
* @brief LookUpTable for 8x8 Pixel Characters for an SSD1306 Display
* @version 0.1
* @date 2024-05-24
*
* @copyright Copyright (c) 2024
*
*/
/**
* @brief First index specifies the index, where index equals the ascii encoding
* unprintable characters are encode as all zero
* the first byte in an entry is the cmd_byte for SSD1306 and therefore not printed
* Encoding is colum wise, so first byte is the first column of the char and so on
*
*/
const char font8x8_colwise[128][9] = {{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+0()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+1()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+2()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+3()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+4()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+5()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+6()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+7()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+8()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+9()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+a()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+b()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+c()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+d()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+e()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+f()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+10()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+11()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+12()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+13()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+14()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+15()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+16()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+17()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+18()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+19()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+1a()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+1b()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+1c()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+1d()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+1e()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+1f()
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // U+20( )
{ 0x40,0x00,0x00,0x06,0x5f,0x5f,0x06,0x00,0x00}, // U+21(!)
{ 0x40,0x00,0x03,0x03,0x00,0x03,0x03,0x00,0x00}, // U+22(")
{ 0x40,0x14,0x7f,0x7f,0x14,0x7f,0x7f,0x14,0x00}, // U+23(#)
{ 0x40,0x24,0x2e,0x6b,0x6b,0x3a,0x12,0x00,0x00}, // U+24($)
{ 0x40,0x46,0x66,0x30,0x18,0x0c,0x66,0x62,0x00}, // U+25(%)
{ 0x40,0x30,0x7a,0x4f,0x5d,0x37,0x7a,0x48,0x00}, // U+26(&)
{ 0x40,0x04,0x07,0x03,0x00,0x00,0x00,0x00,0x00}, // U+27(')
{ 0x40,0x00,0x1c,0x3e,0x63,0x41,0x00,0x00,0x00}, // U+28(()
{ 0x40,0x00,0x41,0x63,0x3e,0x1c,0x00,0x00,0x00}, // U+29())
{ 0x40,0x08,0x2a,0x3e,0x1c,0x1c,0x3e,0x2a,0x08}, // U+2a(*)
{ 0x40,0x08,0x08,0x3e,0x3e,0x08,0x08,0x00,0x00}, // U+2b(+)
{ 0x40,0x00,0x80,0xe0,0x60,0x00,0x00,0x00,0x00}, // U+2c(,)
{ 0x40,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00}, // U+2d(-)
{ 0x40,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x00}, // U+2e(.)
{ 0x40,0x60,0x30,0x18,0x0c,0x06,0x03,0x01,0x00}, // U+2f(/)
{ 0x40,0x3e,0x7f,0x71,0x59,0x4d,0x7f,0x3e,0x00}, // U+30(0)
{ 0x40,0x40,0x42,0x7f,0x7f,0x40,0x40,0x00,0x00}, // U+31(1)
{ 0x40,0x62,0x73,0x59,0x49,0x6f,0x66,0x00,0x00}, // U+32(2)
{ 0x40,0x22,0x63,0x49,0x49,0x7f,0x36,0x00,0x00}, // U+33(3)
{ 0x40,0x18,0x1c,0x16,0x53,0x7f,0x7f,0x50,0x00}, // U+34(4)
{ 0x40,0x27,0x67,0x45,0x45,0x7d,0x39,0x00,0x00}, // U+35(5)
{ 0x40,0x3c,0x7e,0x4b,0x49,0x79,0x30,0x00,0x00}, // U+36(6)
{ 0x40,0x03,0x03,0x71,0x79,0x0f,0x07,0x00,0x00}, // U+37(7)
{ 0x40,0x36,0x7f,0x49,0x49,0x7f,0x36,0x00,0x00}, // U+38(8)
{ 0x40,0x06,0x4f,0x49,0x69,0x3f,0x1e,0x00,0x00}, // U+39(9)
{ 0x40,0x00,0x00,0x66,0x66,0x00,0x00,0x00,0x00}, // U+3a(:)
{ 0x40,0x00,0x80,0xe6,0x66,0x00,0x00,0x00,0x00}, // U+3b(;)
{ 0x40,0x08,0x1c,0x36,0x63,0x41,0x00,0x00,0x00}, // U+3c(<)
{ 0x40,0x24,0x24,0x24,0x24,0x24,0x24,0x00,0x00}, // U+3d(=)
{ 0x40,0x00,0x41,0x63,0x36,0x1c,0x08,0x00,0x00}, // U+3e(>)
{ 0x40,0x02,0x03,0x51,0x59,0x0f,0x06,0x00,0x00}, // U+3f(?)
{ 0x40,0x3e,0x7f,0x41,0x5d,0x5d,0x1f,0x1e,0x00}, // U+40(@)
{ 0x40,0x7c,0x7e,0x13,0x13,0x7e,0x7c,0x00,0x00}, // U+41(A)
{ 0x40,0x41,0x7f,0x7f,0x49,0x49,0x7f,0x36,0x00}, // U+42(B)
{ 0x40,0x1c,0x3e,0x63,0x41,0x41,0x63,0x22,0x00}, // U+43(C)
{ 0x40,0x41,0x7f,0x7f,0x41,0x63,0x3e,0x1c,0x00}, // U+44(D)
{ 0x40,0x41,0x7f,0x7f,0x49,0x5d,0x41,0x63,0x00}, // U+45(E)
{ 0x40,0x41,0x7f,0x7f,0x49,0x1d,0x01,0x03,0x00}, // U+46(F)
{ 0x40,0x1c,0x3e,0x63,0x41,0x51,0x73,0x72,0x00}, // U+47(G)
{ 0x40,0x7f,0x7f,0x08,0x08,0x7f,0x7f,0x00,0x00}, // U+48(H)
{ 0x40,0x00,0x41,0x7f,0x7f,0x41,0x00,0x00,0x00}, // U+49(I)
{ 0x40,0x30,0x70,0x40,0x41,0x7f,0x3f,0x01,0x00}, // U+4a(J)
{ 0x40,0x41,0x7f,0x7f,0x08,0x1c,0x77,0x63,0x00}, // U+4b(K)
{ 0x40,0x41,0x7f,0x7f,0x41,0x40,0x60,0x70,0x00}, // U+4c(L)
{ 0x40,0x7f,0x7f,0x0e,0x1c,0x0e,0x7f,0x7f,0x00}, // U+4d(M)
{ 0x40,0x7f,0x7f,0x06,0x0c,0x18,0x7f,0x7f,0x00}, // U+4e(N)
{ 0x40,0x1c,0x3e,0x63,0x41,0x63,0x3e,0x1c,0x00}, // U+4f(O)
{ 0x40,0x41,0x7f,0x7f,0x49,0x09,0x0f,0x06,0x00}, // U+50(P)
{ 0x40,0x1e,0x3f,0x21,0x71,0x7f,0x5e,0x00,0x00}, // U+51(Q)
{ 0x40,0x41,0x7f,0x7f,0x09,0x19,0x7f,0x66,0x00}, // U+52(R)
{ 0x40,0x26,0x6f,0x4d,0x59,0x73,0x32,0x00,0x00}, // U+53(S)
{ 0x40,0x03,0x41,0x7f,0x7f,0x41,0x03,0x00,0x00}, // U+54(T)
{ 0x40,0x7f,0x7f,0x40,0x40,0x7f,0x7f,0x00,0x00}, // U+55(U)
{ 0x40,0x1f,0x3f,0x60,0x60,0x3f,0x1f,0x00,0x00}, // U+56(V)
{ 0x40,0x7f,0x7f,0x30,0x18,0x30,0x7f,0x7f,0x00}, // U+57(W)
{ 0x40,0x43,0x67,0x3c,0x18,0x3c,0x67,0x43,0x00}, // U+58(X)
{ 0x40,0x07,0x4f,0x78,0x78,0x4f,0x07,0x00,0x00}, // U+59(Y)
{ 0x40,0x47,0x63,0x71,0x59,0x4d,0x67,0x73,0x00}, // U+5a(Z)
{ 0x40,0x00,0x7f,0x7f,0x41,0x41,0x00,0x00,0x00}, // U+5b([)
{ 0x40,0x01,0x03,0x06,0x0c,0x18,0x30,0x60,0x00}, // U+5c(\)
{ 0x40,0x00,0x41,0x41,0x7f,0x7f,0x00,0x00,0x00}, // U+5d(])
{ 0x40,0x08,0x0c,0x06,0x03,0x06,0x0c,0x08,0x00}, // U+5e(^)
{ 0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, // U+5f(_)
{ 0x40,0x00,0x00,0x03,0x07,0x04,0x00,0x00,0x00}, // U+60(`)
{ 0x40,0x20,0x74,0x54,0x54,0x3c,0x78,0x40,0x00}, // U+61(a)
{ 0x40,0x41,0x7f,0x3f,0x48,0x48,0x78,0x30,0x00}, // U+62(b)
{ 0x40,0x38,0x7c,0x44,0x44,0x6c,0x28,0x00,0x00}, // U+63(c)
{ 0x40,0x30,0x78,0x48,0x49,0x3f,0x7f,0x40,0x00}, // U+64(d)
{ 0x40,0x38,0x7c,0x54,0x54,0x5c,0x18,0x00,0x00}, // U+65(e)
{ 0x40,0x48,0x7e,0x7f,0x49,0x03,0x02,0x00,0x00}, // U+66(f)
{ 0x40,0x98,0xbc,0xa4,0xa4,0xf8,0x7c,0x04,0x00}, // U+67(g)
{ 0x40,0x41,0x7f,0x7f,0x08,0x04,0x7c,0x78,0x00}, // U+68(h)
{ 0x40,0x00,0x44,0x7d,0x7d,0x40,0x00,0x00,0x00}, // U+69(i)
{ 0x40,0x60,0xe0,0x80,0x80,0xfd,0x7d,0x00,0x00}, // U+6a(j)
{ 0x40,0x41,0x7f,0x7f,0x10,0x38,0x6c,0x44,0x00}, // U+6b(k)
{ 0x40,0x00,0x41,0x7f,0x7f,0x40,0x00,0x00,0x00}, // U+6c(l)
{ 0x40,0x7c,0x7c,0x18,0x38,0x1c,0x7c,0x78,0x00}, // U+6d(m)
{ 0x40,0x7c,0x7c,0x04,0x04,0x7c,0x78,0x00,0x00}, // U+6e(n)
{ 0x40,0x38,0x7c,0x44,0x44,0x7c,0x38,0x00,0x00}, // U+6f(o)
{ 0x40,0x84,0xfc,0xf8,0xa4,0x24,0x3c,0x18,0x00}, // U+70(p)
{ 0x40,0x18,0x3c,0x24,0xa4,0xf8,0xfc,0x84,0x00}, // U+71(q)
{ 0x40,0x44,0x7c,0x78,0x4c,0x04,0x1c,0x18,0x00}, // U+72(r)
{ 0x40,0x48,0x5c,0x54,0x54,0x74,0x24,0x00,0x00}, // U+73(s)
{ 0x40,0x00,0x04,0x3e,0x7f,0x44,0x24,0x00,0x00}, // U+74(t)
{ 0x40,0x3c,0x7c,0x40,0x40,0x3c,0x7c,0x40,0x00}, // U+75(u)
{ 0x40,0x1c,0x3c,0x60,0x60,0x3c,0x1c,0x00,0x00}, // U+76(v)
{ 0x40,0x3c,0x7c,0x70,0x38,0x70,0x7c,0x3c,0x00}, // U+77(w)
{ 0x40,0x44,0x6c,0x38,0x10,0x38,0x6c,0x44,0x00}, // U+78(x)
{ 0x40,0x9c,0xbc,0xa0,0xa0,0xfc,0x7c,0x00,0x00}, // U+79(y)
{ 0x40,0x4c,0x64,0x74,0x5c,0x4c,0x64,0x00,0x00}, // U+7a(z)
{ 0x40,0x08,0x08,0x3e,0x77,0x41,0x41,0x00,0x00}, // U+7b({)
{ 0x40,0x00,0x00,0x00,0x77,0x77,0x00,0x00,0x00}, // U+7c(|)
{ 0x40,0x41,0x41,0x77,0x3e,0x08,0x08,0x00,0x00}, // U+7d(})
{ 0x40,0x02,0x03,0x01,0x03,0x02,0x03,0x01,0x00}, // U+7e(~)
{ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; // U+7f(°)

138
src/display/Display.cpp Normal file
View File

@ -0,0 +1,138 @@
/**
* @file Display.cpp
* @author Hans Haupt (hans.haupt@dezibot.de)
* @brief Adds the ability to print to the display of the robot.
* @version 0.1
* @date 2024-06-05
*
* @copyright Copyright (c) 2024
*/
#include "Display.h"
#include "CharTable.h"
#include "Wire.h"
void Display::begin(void){
//set Mux Ratio
sendDisplayCMD(muxRatio);
sendDisplayCMD(0x3f);
sendDisplayCMD(setOffset);
sendDisplayCMD(0x00);
sendDisplayCMD(setStartLine);
sendDisplayCMD(stopCompleteOn);
/*which pixels are bright: normal = 1s are bright, inverese= 0s are bright*/
sendDisplayCMD( setNormalMode);
sendDisplayCMD( setOscFreq);
sendDisplayCMD(0x80);
sendDisplayCMD(setChargePump);
sendDisplayCMD(0x14);
sendDisplayCMD(activateDisplay);
this->clear();
return;
};
void Display::sendDisplayCMD(uint8_t cmd){
Wire.beginTransmission(DisplayAdress);
Wire.write(cmd_byte);
Wire.write(cmd);
Wire.endTransmission();
};
void Display::clear(void){
sendDisplayCMD(addressingMode);
sendDisplayCMD(0x00); //horizontal
sendDisplayCMD(colRange);
sendDisplayCMD(0x00);
sendDisplayCMD(0x7f);
sendDisplayCMD(pageRange);
sendDisplayCMD(0x00);
sendDisplayCMD(0x07);
for (int j=0;j<64;j++){
Wire.beginTransmission(DisplayAdress);
Wire.write(data_byte);
for(int i = 0;i<16;i++){
Wire.write(0x00);
}
Wire.endTransmission();
}
this -> charsOnCurrLine = 0;
this -> currLine = 0;
return;
};
void Display::updateLine(uint charAmount)
{
if(charAmount+this->charsOnCurrLine>16)
{
this->currLine = (this->currLine+((charAmount+this->charsOnCurrLine)/16))%8;
this->charsOnCurrLine = (charAmount+this->charsOnCurrLine)%17; //there can be 0-16 chars on one line, so the 17th char is on next line
}
else
{
this->charsOnCurrLine = charAmount+this->charsOnCurrLine;
}
};
void Display::print(char *value){
char *nextchar;
/* write data to the buffer */
while(value && *value != '\0') //check if pointer is still valid and string is not terminated
{
//check if next character is a linebreak
if(*value=='\n')
{
//fill the current line with blanks
while(this->charsOnCurrLine<16)
{
updateLine(1);
Wire.beginTransmission(DisplayAdress);
for(int i = 0;i<9;i++){
Wire.write(font8x8_colwise[0][i]);
}
Wire.endTransmission();
}
//make the linebreak
this->currLine=currLine+1;
this->charsOnCurrLine=0;
}
else
{
updateLine(1);
Wire.beginTransmission(DisplayAdress);
//print the character
for(int i = 0;i<9;i++){
Wire.write(font8x8_colwise[*value][i]);
}
Wire.endTransmission();
}
value++;
}
};
void Display::println(char *value){
this ->print(value);
this->print("\n");
};
void Display::flipOrientation(void){
if(this->orientationFlipped){
sendDisplayCMD(setComDirectionNormal);
sendDisplayCMD(setSegmentMap);
} else{
sendDisplayCMD(setComDirectionFlipped);
sendDisplayCMD(setSegmentReMap);
}
this->orientationFlipped = !this->orientationFlipped;
};
void Display::invertColor(void){
if(this->colorInverted){
sendDisplayCMD(setNormalMode);
} else {
sendDisplayCMD(setInverseMode);
}
this->colorInverted = !this->colorInverted;
};

89
src/display/Display.h Normal file
View File

@ -0,0 +1,89 @@
/**
* @file InfraredLight.h
* @author Hans Haupt (hans.haupt@dezibot.de)
* @brief Adds the ability to print to the display of the robot.
* @version 0.1
* @date 2024-05-24
*
* @copyright Copyright (c) 2024
*
*/
#ifndef Display_h
#define Display_h
#include <stdint.h>
#include <Arduino.h>
#include "DisplayCMDs.h"
class Display{
protected:
//how many chars are on current line
uint8_t charsOnCurrLine = 0;
//on which line are we currently printing
uint8_t currLine = 0;
//flag that marks if the y-orientation is currently flipped
bool orientationFlipped = false;
//flag thats marks if the color is currently inverted
bool colorInverted = false;
/**
* @brief sends the passed cmd to the display, cmd_byte is added as prefix by the function
*
* @param cmd the byte instruction that shold by sent
*/
void sendDisplayCMD(uint8_t cmd);
/**
* @brief should be called whenever characters where printed to the display.
* Updates the data of the class to handle linebreaks correctly
* @param charAmount How many characters where added to the screen
*/
void updateLine(uint charAmount);
public:
/**
* @brief initializes the display datastructures and sents the required cmds to start the display. Should only be called once.
* @warning doesn't initalize the I²C bus itself, therefore wire.begin(1,2) must be called elsewhere, before this method.
*/
void begin(void);
/**
* @brief delets all content from the display, resets the linecounter, new print will start at the top left.
* Orientationflip is not resetted
*/
void clear(void);
/**
* @brief prints the passed string right behind the current displaycontent
* the sequence "\n" can be used to make a linebreak on the display
*
* @param value the string "xyz" that should be printed to the display
*/
void print(char *value);
/**
* @brief same as the print method, but after the string a line break is inserted
*
* @param value the string that should be printed
*/
void println(char *value);
/**
* @brief flips the horizontal orientation of all content on the display
*/
void flipOrientation(void);
/**
* @brief inverts the pixelcolors, so pixels on will be set to off and currently off pixels will be turned off.
* affects already printed content as well as future prints.
*
*/
void invertColor(void);
};
#endif //Display_h

24
src/display/DisplayCMDs.h Normal file
View File

@ -0,0 +1,24 @@
#define cmd_byte 0x80
#define data_byte 0x40
#define muxRatio 0xa8 //needs second argument ranging from 16-63
#define setOffset 0xd3 //needs second argument ranging from 0-63
#define setStartLine 0x40
#define setSegmentMap 0xa0
#define setSegmentReMap 0xa1
#define setComDirectionNormal 0xc0
#define setComDirectionFlipped 0xc8
#define setComHardwareConfig 0xda //needs second arg
#define setContrast 0x81 //needs second arg
#define completeOn 0xa5
#define stopCompleteOn 0xa4
#define setNormalMode 0xa6
#define setInverseMode 0xa7
#define setOscFreq 0xd5 //needs second arg
#define setChargePump 0x8d//needs second arg 0x14 for enable
#define activateDisplay 0xaf
#define disableDisplay 0xae
#define addressingMode 0x20
#define colRange 0x21
#define pageRange 0x22
#define DisplayAdress 0x3C

View File

@ -16,7 +16,7 @@ void InfraredLED::begin(void){
.speed_mode = pwmSpeedMode, .speed_mode = pwmSpeedMode,
.duty_resolution = LEDC_TIMER_10_BIT, .duty_resolution = LEDC_TIMER_10_BIT,
.timer_num = this->timer, .timer_num = this->timer,
.freq_hz = 1, .freq_hz = 800,
.clk_cfg = LEDC_AUTO_CLK .clk_cfg = LEDC_AUTO_CLK
}; };
ledc_timer_config(&pwmTimer); ledc_timer_config(&pwmTimer);
@ -53,7 +53,7 @@ void InfraredLED::setState(bool state){
}; };
void InfraredLED::sendFrequency(uint16_t frequency){ void InfraredLED::sendFrequency(uint16_t frequency){
ledc_set_freq(pwmSpeedMode,timer,frequency); // ledc_set_freq(pwmSpeedMode,timer,frequency);
ledc_set_duty(pwmSpeedMode,channel,512); ledc_set_duty(pwmSpeedMode,channel,512);
ledc_update_duty(pwmSpeedMode,channel); ledc_update_duty(pwmSpeedMode,channel);
}; };

View File

@ -26,7 +26,6 @@ class InfraredLED{
/** /**
* @brief enables selected LED * @brief enables selected LED
* *
* @param led
*/ */
void turnOn(void); void turnOn(void);
/** /**

View File

@ -52,6 +52,7 @@ photoTransistors LightDetection::getBrightest(ptType type){
}; };
uint32_t LightDetection::getAverageValue(photoTransistors sensor, uint32_t measurments, uint32_t timeBetween){ uint32_t LightDetection::getAverageValue(photoTransistors sensor, uint32_t measurments, uint32_t timeBetween){
TickType_t xLastWakeTime = xTaskGetTickCount(); TickType_t xLastWakeTime = xTaskGetTickCount();
TickType_t frequency = timeBetween / portTICK_PERIOD_MS; TickType_t frequency = timeBetween / portTICK_PERIOD_MS;
uint64_t cumulatedResult = 0; uint64_t cumulatedResult = 0;
@ -63,6 +64,7 @@ uint32_t LightDetection::getAverageValue(photoTransistors sensor, uint32_t measu
}; };
void LightDetection::beginInfrared(void){ void LightDetection::beginInfrared(void){
digitalWrite(IR_PT_ENABLE,true);
pinMode(IR_PT_ENABLE, OUTPUT); pinMode(IR_PT_ENABLE, OUTPUT);
pinMode(IR_PT_FRONT_ADC, INPUT); pinMode(IR_PT_FRONT_ADC, INPUT);
pinMode(IR_PT_LEFT_ADC, INPUT); pinMode(IR_PT_LEFT_ADC, INPUT);
@ -71,13 +73,14 @@ void LightDetection::beginInfrared(void){
}; };
void LightDetection::beginDaylight(void){ void LightDetection::beginDaylight(void){
digitalWrite(DL_PT_ENABLE,true);
pinMode(DL_PT_ENABLE, OUTPUT); pinMode(DL_PT_ENABLE, OUTPUT);
pinMode(DL_PT_BOTTOM_ADC, INPUT); pinMode(DL_PT_BOTTOM_ADC, INPUT);
pinMode(DL_PT_FRONT_ADC, INPUT ); pinMode(DL_PT_FRONT_ADC, INPUT );
}; };
uint16_t LightDetection::readIRPT(photoTransistors sensor){ uint16_t LightDetection::readIRPT(photoTransistors sensor){
digitalWrite(IR_PT_ENABLE,HIGH); //digitalWrite(IR_PT_ENABLE,HIGH);
uint16_t result = 0; uint16_t result = 0;
switch (sensor) switch (sensor)
{ {
@ -96,7 +99,7 @@ uint16_t LightDetection::readIRPT(photoTransistors sensor){
default: default:
break; break;
} }
digitalWrite(IR_PT_ENABLE,LOW); //digitalWrite(IR_PT_ENABLE,LOW);
return result; return result;
}; };

View File

@ -93,11 +93,5 @@ protected:
static uint16_t readIRPT(photoTransistors sensor); static uint16_t readIRPT(photoTransistors sensor);
static uint16_t readDLPT(photoTransistors sensor); static uint16_t readDLPT(photoTransistors sensor);
static void averageMeasurmentTask(void * args);
}; };
#endif //LightDetection_h #endif //LightDetection_h