RobotikaWall

Add message

http://touchterrain.geol.iastate.edu/main?trlat=51.1315674594233&trlon=18.575412282226544&bllat=48.506173736051814&bllon=11.89435149121092&scale=1.00&DEM_name=JAXA/ALOS/AW3D30/V2_2&tilewidth=100&printres=0.4&ntilesx=1&ntilesy=1&DEMresolution=1923.2&basethick=2&zscale=50&fileformat=STLb&maptype=roadmap&gamma=1&transp=20&hsazi=315&hselev=45&map_lat=49.88272336878949&map_lon=14.949444274659553&map_zoom=7

https://vemaps.com/czech-republic/cz-01

https://www.fablabuniversity.cz/geograficke-mapy/

https://www.dvedeti.cz/data/product/1024_1024/11861_kasperini_balkenwaage_little_market_a.jpg

CAD

https://bit.ly/cad-laser

https://drive.google.com/drive/folders/1UFMB3KF1HN9RfBB-cDqGFmip7AdfXqTZ?usp=sharing

https://studycadcam.blogspot.com/

Stahujte odtud
https://drive.google.com/drive/folders/1b824k2FHAK7rBoqVf4eBXHkt4QAlolkf?usp=sharing

https://images.slideplayer.cz/11/3288696/slides/slide_15.jpg

https://images-na.ssl-images-amazon.com/images/I/91BLCCISDTL._SY355_.jpg

https://media.wired.com/photos/5a21eee60cb42c3d9653d08c/master/pass/r2d2-FA.jpg

https://accounts.autodesk.com/register?viewmode=iframe&lang=en&uitype=education&realm=www.autodesk.com&ctx=dotcom&AuthKey=c655d9bc-89dc-4db3-bf9a-ea46bd8c116e&ReturnUrl=%2Fauthorize%3Fviewmode%3Diframe%26lang%3Den%26uitype%3Deducation%26realm%3Dwww.autodesk.com%26ctx%3Ddotcom%26AuthKey%3Dc655d9bc-89dc-4db3-bf9a-ea46bd8c116e

https://makecode.microbit.org/_DvTVM5bH0iuz

https://makecode.microbit.org/_fLV7X241UF5a

https://photos.app.goo.gl/DdZRETngNwC1CFbL8

https://github.com/RoboticsBrno/RoboticsBeginners2017-2018/tree/master/2018-03-20_lcd_i2c_display

https://github.com/marcoschwartz/LiquidCrystal_I2C

https://examples.blynk.cc/?board=ESP32&shield=ESP32%20WiFi&example=GettingStarted%2FBlynkBlink

https://thingspeak.com/

https://github.com/RoboticsBrno/RoboticsBeginners2017-2018/

DHT11 knihovna:
https://github.com/adafruit/DHT-sensor-library

Posli te mi vas email na muj email:
paral@robotikabrno.cz

Předmět: [Robotika Začátečníci 2017] VASE JMENO - VAS EMIAL

To samé dejte do předmětu zprávy.

Arduino - Serial:
https://www.arduino.cc/reference/en/language/functions/communication/serial/

https://github.com/RoboticsBrno/RoboticsBeginners2017-2018/

https://github.com/RoboticsBrno/RoboticsBeginners2017-2018/blob/master/2017-11-07_test-board/src/main.cpp

#include "LearningKit.h"
#include <SPIFFS.h>

#include <DHT.h>
DHT dht( DHT_PIN, DHT11 );

#include "Servo.h"
Servo servo1;

#define I2C_SDA 27
#define I2C_SCL 14

// Uncomment your type of LCD convertor
//#define LCD_I2C_ADDR 0x27 // chip PCF8574T
#define LCD_I2C_ADDR 0x3f // chip PCF8574AT
#define LCD_WIDTH 20
#define LCD_HEIGHT 4
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_WIDTH, LCD_HEIGHT);
int hour, min, sec;

void incrementClockSec()
{
    sec = sec + 1;
    if(sec == 60) {
        //min = min + 1;
        min += 1;
        sec = 0;
    }
    if(min == 60) {
        //hour = hour + 1;
        hour++;
        min = 0;
    }
    if(hour == 24) {
        hour = 0;
    }
}

void setup()
{
    setupLeds();
    setupRgbLed();
    setupButtons();

    Serial.begin(115200);
    Serial.println("Logging - start");
    SPIFFS.begin();

    dht.begin();
    servo1.attach(S1);

    Wire.begin(I2C_SDA, I2C_SCL);
    lcd.begin(LCD_WIDTH, LCD_HEIGHT);
    lcd.backlight();

    lcd.print("ahoj");

    hour = 9;
    min = 25;
    sec = 50;

    File file = SPIFFS.open("/log.txt", FILE_APPEND);
    if (!file) {
        Serial.println("Failed to open file for appending");
        return;
    }

    int state = true;

    while(digitalRead(SW1) == true) {
        int timeMs = millis();
        int photoVal = analogRead(PHOTO);
        int dhtTemp = dht.readTemperature();
        int dhtHum = dht.readHumidity();

        file.print( timeMs );
        file.print( "; " );  
        file.print( photoVal );
        file.print( "; " );
        file.print( dhtTemp );
        file.print( "; " );
        file.print( dhtHum );
        file.print( "\n" );
        Serial.printf("%i; %i; %i; %i\n", timeMs, photoVal, dhtTemp, dhtHum);
        int servoPos = map(int(dht.readTemperature()), 0, 40, 0, 180);
        servo1.write(servoPos);
        
        lcd.setCursor(1, 1);
        lcd.printf("%iC  %i", dhtTemp, dhtHum);
        lcd.print("%");

        lcd.setCursor(0, 0);
        lcd.printf("Time: %2i:%02i:%02i", hour, min, sec);
        
        incrementClockSec();
        delay(1000);
        
        if(state == true) 
            state = false;
        else 
            state = true;

        digitalWrite(L_R, state);
    }
    file.close();

    digitalWrite(L_R, LOW);
    digitalWrite(L_G, HIGH);

    Serial.println("Logging - stop");

    file = SPIFFS.open("/log.txt");
    if (!file) {
        Serial.println("Failed to open file for reading");
        return;
    }
    
    Serial.println("Logging - read");
    while (file.available())
    {
        Serial.write(file.read());
    }
    file.close();
}

void loop()
{
}

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

lib_deps = 
    1745
    DHT sensor library
    https://github.com/copercini/arduino-esp32-SPIFFS
    ServoESP32
    https://github.com/marcoschwartz/LiquidCrystal_I2C.git

monitor_baud = 115200

upload_speed = 921600

#include "LearningKit.h"
#include <SPIFFS.h>

#include <DHT.h>
DHT dht( DHT_PIN, DHT11 );

#include "Servo.h"
Servo servo1;

#define I2C_SDA 27
#define I2C_SCL 14

// Uncomment your type of LCD convertor
//#define LCD_I2C_ADDR 0x27 // chip PCF8574T
#define LCD_I2C_ADDR 0x3f // chip PCF8574AT
#define LCD_WIDTH 20
#define LCD_HEIGHT 4
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_WIDTH, LCD_HEIGHT);
int hour, min, sec;

void incrementClockSec()
{
    sec = sec + 1;
    delay(1000);
    if(sec == 60) {
        //min = min + 1;
        min += 1;
        sec = 0;
    }
    if(min == 60) {
        //hour = hour + 1;
        hour++;
        min = 0;
    }
    if(hour == 24) {
        hour = 0;
    }
}

void setup()
{
    setupLeds();
    setupRgbLed();
    setupButtons();

    Serial.begin(115200);
    Serial.println("Logging - start");
    SPIFFS.begin();

    dht.begin();
    servo1.attach(S1);

    Wire.begin(I2C_SDA, I2C_SCL);
    lcd.begin(LCD_WIDTH, LCD_HEIGHT);
    lcd.backlight();

    lcd.print("ahoj");

    hour = 9;
    min = 25;
    sec = 50;

    File file = SPIFFS.open("/log.txt", FILE_APPEND);
    if (!file) {
        Serial.println("Failed to open file for appending");
        return;
    }

    while(digitalRead(SW1) == true) {
        int timeMs = millis();
        int photoVal = analogRead(PHOTO);
        int dhtTemp = dht.readTemperature();
        int dhtHum = dht.readHumidity();

        file.print( timeMs );
        file.print( "; " );  
        file.print( photoVal );
        file.print( "; " );
        file.print( dhtTemp );
        file.print( "; " );
        file.print( dhtHum );
        file.print( "\n" );
        Serial.printf("%i; %i; %i; %i\n", timeMs, photoVal, dhtTemp, dhtHum);
        int servoPos = map(int(dht.readTemperature()), 0, 40, 0, 180);
        servo1.write(servoPos);
        
        lcd.setCursor(1, 1);
        lcd.printf("%iC  %i", dhtTemp, dhtHum);
        lcd.print("%");

        lcd.setCursor(0, 0);
        lcd.printf("Time: %2i:%02i:%02i", hour, min, sec);
        
        incrementClockSec();
        delay(1000);
    }
    file.close();

    Serial.println("Logging - stop");

    file = SPIFFS.open("/log.txt");
    if (!file) {
        Serial.println("Failed to open file for reading");
        return;
    }
    
    Serial.println("Logging - read");
    while (file.available())
    {
        Serial.write(file.read());
    }
    file.close();
}

void loop()
{
}

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

monitor_baud = 115200
upload_speed = 921600

lib_deps = 
    1745
    ServoESP32

// source: http://platformio.org/lib/show/1739/ServoESP32
#include "LearningKit.h"
#include <Servo.h>

static const int servoPin = S1;
static const int potentiometerPin = 32;

Servo servo1;

void setup() {
    Serial.begin(115200);
    servo1.attach(servoPin);
}

void loop() {
    int servoPosition = map(analogRead(potentiometerPin), 0, 4096, 0, 180);
    servo1.write(servoPosition);
    Serial.println(servoPosition);
    delay(20);
}

#define I2C_SDA 23
#define I2C_SCL 22

#define LCD_I2C_ADDR 0x3f
#define LCD_WIDTH 20
#define LCD_HEIGHT 4

#include <Arduino.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_WIDTH, LCD_HEIGHT);

void setup() {
    Serial.begin(115200);
    Serial.println("\n\n\nI2C LCD display test");

    Wire.begin(I2C_SDA, I2C_SCL);

    lcd.begin(LCD_WIDTH, LCD_HEIGHT);
    lcd.backlight();

    lcd.print("ahoj");
    Serial.print("ahoj\n");
}

int receiveCh;

void loop() {
    if (Serial.available()) {
        receiveCh = Serial.read();
        lcd.write(receiveCh);
        Serial.write(receiveCh);
    }
}

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

monitor_baud = 115200

upload_speed = 921600

build_flags = -D CORE_INT_EVERY_PIN

lib_deps = 
    https://github.com/marcoschwartz/LiquidCrystal_I2C.git


#include "LearningKit.h"
#include <SPIFFS.h>

void setup()
{
    setupButtons();

    Serial.begin(115200);
    Serial.println("Logging - start");
    SPIFFS.begin();

    File file = SPIFFS.open("/log.txt", FILE_WRITE);
    if (!file)
    {
        Serial.println("Failed to open file for appending");
        return;
    }

    while(digitalRead(SW1) == true) {
        file.println(analogRead(PHOTO));
        Serial.printf("data: %i\n", analogRead(PHOTO));
        delay(100);
    }
    file.close();

    Serial.println("Logging - stop");

    file = SPIFFS.open("/log.txt");
    if (!file) {
        Serial.println("Failed to open file for reading");
        return;
    }
    
    Serial.println("Logging - read");
    while (file.available())
    {
        Serial.write(file.read());
    }
    file.close();
}

void loop()
{
}


#include "LearningKit.h"

#include <DHT.h>

DHT dht( DHT_PIN, DHT11 );

void setup() {
    Serial.begin(115200);
    dht.begin();
}

void loop() {

    Serial.print( "Temperature: " );
    Serial.print( dht.readTemperature() );
    Serial.print( "°C, humidity: " );
    Serial.print( dht.readHumidity() );
    Serial.println( " %\n" );
    delay( 200 );
}


#include "LearningKit.h"

void setup() {
    Serial.begin(115200);
    setupRgbLed();
    setupLeds();
    setupButtons();

    ledcSetup(1, 1000, 10); // ledcSetup(channel, freq, resolution)
    // resolution = 10 => 2^10 => 1024
    ledcAttachPin(L_RGB_R, 1);
}

int state = 1; // 1 = up, -1 = down
//bool state = 1; // 1 = up, 0 = down
int light = 0;

void loop() {
    light += state;

    //for(/*inicializace/*; /*podmínka*/; /*aktualizace řídící proměnné */)
    for(int i = 0; i < 1023; i++) {
        ledcWrite(1, i);
        delay(1);
    }

    ledcWrite(1, light); // ledcWrite(channel, value)
    // value => resolution = 1024 => value = 0 - 1023
    delay(1);
}


#include "LearningKit.h"

void setup() {
    Serial.begin(115200);
    setupRgbLed();
    setupLeds();
    setupButtons();

    ledcSetup(1, 1000, 10); // ledcSetup(channel, freq, resolution)
    // resolution = 10 => 2^10 => 1024
    ledcAttachPin(L_G, 1);
}

int state = 1; // 1 = up, -1 = down
//bool state = 1; // 1 = up, 0 = down
int light = 0;

void loop() {
    light += state;

    if(light == 0) {
        state = +1;
    }
    if(light == 1023) {
        state = -1;
    }

    ledcWrite(1, light); // ledcWrite(channel, value)
    // value => resolution = 1024 => value = 0 - 1023
    delay(1);
}




#include "LearningKit.h"

int hour, min, sec;
bool alarm = false;

void setup() {
    Serial.begin(115200);
    setupLeds();
    setupRgbLed();
    setupButtons();

    hour = 17;
    min = 29;
    sec = 50;
}

void loop() {
    sec = sec + 1;
    delay(1000);
    if(sec == 60) {
        //min = min + 1;
        min += 1;
        sec = 0;
    }
    if(min == 60) {
        //hour = hour + 1;
        hour++;
        min = 0;
    }
    if(hour == 24) {
        hour = 0;
    }

    if(digitalRead(SW1) == false) {
        alarm = false;
    }

    if((hour == 17) && (min == 30) && (sec == 0)) {
        alarm = true;
    }

    if(alarm == true) {
        digitalWrite(L_R, HIGH);
    } else {
        digitalWrite(L_R, LOW);
    }
    
    Serial.printf("%2i:%02i:%02i\n", hour, min, sec);
}


#include "LearningKit.h"

int hour, min, sec;

void setup() {
    Serial.begin(115200);
    setupLeds();
    setupRgbLed();

    hour = 17;
    min = 29;
    sec = 0;
}

void loop() {
    sec = sec + 1;
    delay(1000);
    if(sec == 60) {
        //min = min + 1;
        min += 1;
        sec = 0;
    }
    if(min == 60) {
        //hour = hour + 1;
        hour++;
        min = 0;
    }
    if(hour == 24) {
        hour = 0;
    }

    // Serial.print(hour);
    // Serial.print(":");
    // Serial.print(min);
    // Serial.print(":");
    // Serial.println(sec);
    Serial.printf("%2i:%02i:%02i\n", hour, min, sec);

    if((hour == 17) && (min == 30)) {
        digitalWrite(L_R, HIGH);
    } else {
        digitalWrite(L_R, LOW);
    }
}

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

lib_deps = 
    1745
    https://github.com/copercini/arduino-esp32-SPIFFS.git
    
monitor_baud = 115200

#include <SPIFFS.h>

void setup()
{
  Serial.begin(115200);
  SPIFFS.begin();
  File file = SPIFFS.open("/log.txt", FILE_WRITE);
  file.println(42);
  file.close();

  file = SPIFFS.open("/log.txt");
  while (file.available()) {
    Serial.write(file.read());
  }
  file.close();
}

void loop() {

}

https://github.com/copercini/arduino-esp32-SPIFFS

https://gist.github.com/JarekParal/ec3a86dca12cf6eee2f95f8b9763e2af

https://gist.github.com/JarekParal/15ad77cb5fc39729b4d7aa6bcb946020

Tohle je úžasná poznámkovací stěna!