Fórum témák
- • Audiofil, High End Audio
- • Műhelyünk felszerelése, szerszámai
- • Mosógép vezérlők és általános problémáik
- • CNC építése házi alkatrészekből az alapoktól
- • Rádió tuner hiba
- • Érdekességek
- • Videoton EA 6383 s (tuning)
- • Videoton RT7300S
- • Altium Designer
- • Kombikazán működési hiba
- • Muzeális készülékek-alkatrészek restaurálása
- • Kapcsolási rajzot keresek
- • Felajánlás, azaz ingyen elvihető
- • Kamerás megfigyelőrendszer
- • Klíma szervizelés, javítás
- • Akkumulátor töltő
- • Skoda Octavia elektromos probléma
- • Hegesztő inverter javítás
- • TV hiba, mi a megoldás?
- • V-FET és SIT erősítő kapcsolások
- • GSM adatátvitel
- • Aszinkron motorok tekercselése
- • Műveleti erősítő
- • Energomat mosógép
- • Villanyszerelés
- • Bluetooth kérdések
- • Alternativ HE találkozó(k)
- • Mosogatógép hiba
- • Vezeték nélküli csengő más célra
- • EL84 kimenő trafó
- • Magnetométer építése
- • Elektromágneses terek kockázatértékelése
- • MyElecParts alkatrész kereső és készlet nyilvántartó
- • Rádió áthangolása, OIRT - CCIR konverter
- • Porszívó javítás
- • Kapcsolóüzemű tápegység
- • Vicces - mókás történetek
- • Riasztószerelés tapasztalatok, ötletek (kizárólag haladóknak)
- • Erősítő mindig és mindig
- • Kávéfőzőgép hiba
- • Vag-com-hex interfész (kábel hibák)
- • Hangsugárzó építés, javítás - miértek, hogyanok
- • Mágnes
- • Szintetizátor javítás
- • Házilag építhető fémkereső
- • Villanypásztor
- • Takarítógép problémák
- • Autóelektronika
- • Kapcsolóüzemű táp 230V-ról
- • LED-es kivezérlésjelzők
- • Tranzisztorok helyettesítése
- • Adatlapot keresek
- • Elfogadnám, ha ingyen elvihető
- • VU meter probléma
- • Vásárlás, hol kapható?
» Több friss téma
|
A klónok CH340 Soros-USB illesztőjének drivere ( Letöltés)
Megoldódott, rossz helyre írtam a tft.reset();
tft.begin(0x9341);
sorokat.
Egyébként ebből indultam el: // IMPORTANT: Adafruit_TFTLCD LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
// SEE RELEVANT COMMENTS IN Adafruit_TFTLCD.h FOR SETUP.
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library
// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
// When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
// For the Arduino Uno, Duemilanove, Diecimila, etc.:
// D0 connects to digital pin 8 (Notice these are
// D1 connects to digital pin 9 NOT in order!)
// D2 connects to digital pin 2
// D3 connects to digital pin 3
// D4 connects to digital pin 4
// D5 connects to digital pin 5
// D6 connects to digital pin 6
// D7 connects to digital pin 7
// For the Arduino Mega, use digital pins 22 through 29
// (on the 2-row header at the end of the board).
// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// If using the shield, all control and data lines are fixed, and
// a simpler declaration can optionally be used:
// Adafruit_TFTLCD tft;
void setup(void) {
Serial.begin(9600);
Serial.println(F("TFT LCD test"));
#ifdef USE_ADAFRUIT_SHIELD_PINOUT
Serial.println(F("Using Adafruit 2.8\" TFT Arduino Shield Pinout"));
#else
Serial.println(F("Using Adafruit 2.8\" TFT Breakout Board Pinout"));
#endif
Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height());
tft.reset();
uint16_t identifier = tft.readID();
identifier=0x9341;
if(identifier == 0x9325) {
Serial.println(F("Found ILI9325 LCD driver"));
} else if(identifier == 0x9328) {
Serial.println(F("Found ILI9328 LCD driver"));
} else if(identifier == 0x7575) {
Serial.println(F("Found HX8347G LCD driver"));
} else if(identifier == 0x9341) {
Serial.println(F("Found ILI9341 LCD driver"));
} else if(identifier == 0x8357) {
Serial.println(F("Found HX8357D LCD driver"));
} else {
Serial.print(F("Unknown LCD driver chip: "));
Serial.println(identifier, HEX);
Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
Serial.println(F(" #define USE_ADAFRUIT_SHIELD_PINOUT"));
Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
Serial.println(F("If using the breakout board, it should NOT be #defined!"));
Serial.println(F("Also if using the breakout, double-check that all wiring"));
Serial.println(F("matches the tutorial."));
return;
}
tft.begin(identifier);
Serial.println(F("Benchmark Time (microseconds)"));
Serial.print(F("Screen fill "));
Serial.println(testFillScreen());
delay(500);
Serial.print(F("Text "));
Serial.println(testText());
delay(3000);
Serial.print(F("Lines "));
Serial.println(testLines(CYAN));
delay(500);
Serial.print(F("Horiz/Vert Lines "));
Serial.println(testFastLines(RED, BLUE));
delay(500);
Serial.print(F("Rectangles (outline) "));
Serial.println(testRects(GREEN));
delay(500);
Serial.print(F("Rectangles (filled) "));
Serial.println(testFilledRects(YELLOW, MAGENTA));
delay(500);
Serial.print(F("Circles (filled) "));
Serial.println(testFilledCircles(10, MAGENTA));
Serial.print(F("Circles (outline) "));
Serial.println(testCircles(10, WHITE));
delay(500);
Serial.print(F("Triangles (outline) "));
Serial.println(testTriangles());
delay(500);
Serial.print(F("Triangles (filled) "));
Serial.println(testFilledTriangles());
delay(500);
Serial.print(F("Rounded rects (outline) "));
Serial.println(testRoundRects());
delay(500);
Serial.print(F("Rounded rects (filled) "));
Serial.println(testFilledRoundRects());
delay(500);
Serial.println(F("Done!"));
}
void loop(void) {
for(uint8_t rotation=0; rotation<4; rotation++) {
tft.setRotation(rotation);
testText();
delay(2000);
}
}
unsigned long testFillScreen() {
unsigned long start = micros();
tft.fillScreen(BLACK);
tft.fillScreen(RED);
tft.fillScreen(GREEN);
tft.fillScreen(BLUE);
tft.fillScreen(BLACK);
return micros() - start;
}
unsigned long testText() {
tft.fillScreen(BLACK);
unsigned long start = micros();
tft.setCursor(0, 0);
tft.setTextColor(WHITE); tft.setTextSize(1);
tft.println("Hello World!");
tft.setTextColor(YELLOW); tft.setTextSize(2);
tft.println(1234.56);
tft.setTextColor(RED); tft.setTextSize(3);
tft.println(0xDEADBEEF, HEX);
tft.println();
tft.setTextColor(GREEN);
tft.setTextSize(5);
tft.println("Groop");
tft.setTextSize(2);
tft.println("I implore thee,");
tft.setTextSize(1);
tft.println("my foonting turlingdromes.");
tft.println("And hooptiously drangle me");
tft.println("with crinkly bindlewurdles,");
tft.println("Or I will rend thee");
tft.println("in the gobberwarts");
tft.println("with my blurglecruncheon,");
tft.println("see if I don't!");
return micros() - start;
}
unsigned long testLines(uint16_t color) {
unsigned long start, t;
int x1, y1, x2, y2,
w = tft.width(),
h = tft.height();
tft.fillScreen(BLACK);
x1 = y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = w - 1;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
t = micros() - start; // fillScreen doesn't count against timing
tft.fillScreen(BLACK);
x1 = w - 1;
y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = 0;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
t += micros() - start;
tft.fillScreen(BLACK);
x1 = 0;
y1 = h - 1;
y2 = 0;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = w - 1;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
t += micros() - start;
tft.fillScreen(BLACK);
x1 = w - 1;
y1 = h - 1;
y2 = 0;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = 0;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
return micros() - start;
}
unsigned long testFastLines(uint16_t color1, uint16_t color2) {
unsigned long start;
int x, y, w = tft.width(), h = tft.height();
tft.fillScreen(BLACK);
start = micros();
for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);
for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);
return micros() - start;
}
unsigned long testRects(uint16_t color) {
unsigned long start;
int n, i, i2,
cx = tft.width() / 2,
cy = tft.height() / 2;
tft.fillScreen(BLACK);
n = min(tft.width(), tft.height());
start = micros();
for(i=2; i<n; i+=6) {
i2 = i / 2;
tft.drawRect(cx-i2, cy-i2, i, i, color);
}
return micros() - start;
}
unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
unsigned long start, t = 0;
int n, i, i2,
cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(BLACK);
n = min(tft.width(), tft.height());
for(i=n; i>0; i-=6) {
i2 = i / 2;
start = micros();
tft.fillRect(cx-i2, cy-i2, i, i, color1);
t += micros() - start;
// Outlines are not included in timing results
tft.drawRect(cx-i2, cy-i2, i, i, color2);
}
return t;
}
unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
unsigned long start;
int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;
tft.fillScreen(BLACK);
start = micros();
for(x=radius; x<w; x+=r2) {
for(y=radius; y<h; y+=r2) {
tft.fillCircle(x, y, radius, color);
}
}
return micros() - start;
}
unsigned long testCircles(uint8_t radius, uint16_t color) {
unsigned long start;
int x, y, r2 = radius * 2,
w = tft.width() + radius,
h = tft.height() + radius;
// Screen is not cleared for this one -- this is
// intentional and does not affect the reported time.
start = micros();
for(x=0; x<w; x+=r2) {
for(y=0; y<h; y+=r2) {
tft.drawCircle(x, y, radius, color);
}
}
return micros() - start;
}
unsigned long testTriangles() {
unsigned long start;
int n, i, cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(BLACK);
n = min(cx, cy);
start = micros();
for(i=0; i<n; i+=5) {
tft.drawTriangle(
cx , cy - i, // peak
cx - i, cy + i, // bottom left
cx + i, cy + i, // bottom right
tft.color565(0, 0, i));
}
return micros() - start;
}
unsigned long testFilledTriangles() {
unsigned long start, t = 0;
int i, cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(BLACK);
start = micros();
for(i=min(cx,cy); i>10; i-=5) {
start = micros();
tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
tft.color565(0, i, i));
t += micros() - start;
tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
tft.color565(i, i, 0));
}
return t;
}
unsigned long testRoundRects() {
unsigned long start;
int w, i, i2,
cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(BLACK);
w = min(tft.width(), tft.height());
start = micros();
for(i=0; i<w; i+=6) {
i2 = i / 2;
tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 0, 0));
}
return micros() - start;
}
unsigned long testFilledRoundRects() {
unsigned long start;
int i, i2,
cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(BLACK);
start = micros();
for(i=min(tft.width(), tft.height()); i>20; i-=6) {
i2 = i / 2;
tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));
}
return micros() - start;
}
Örülök neki hogy megy
Na most a videón látható hiba jön elő hogy a második sort ha kikapcsolom valamiért vissza kapcsol. Szerintetek miért lehet ez? Videó
Olyan kérdésem lenne hogy ilyen menürendszert hogyan lehetne csinálni kijelzőre? Ugye bár if-el ha úgy vizsgálom a panelt hiába törlöm ki az oldalt akkor is azt érzékeli ami az "előző" oldalt van. Hogyan lehetne ezt megoldani?
Tudna valaki segíteni, aki ért arduino programozásához? Aki tudna, és akar is segiteni, legyen szives irjon pm-et. Nagyon hálás lennék az biztos.
(#) |
ALI hozzászólása |
Okt 25, 2015 |
 |
/ |
 |
|
Sziasztok. Az mért van, hogy a temp magasabb vagy alacsonyabb mint a tempMin, tempMax
akkor az LCD-re 0 ír? if((temp >= tempMin) && (temp <= tempMax)) {
fanSpeed = map(temp, tempMin, tempMax, 32, 255);
fanLCD = map(temp, tempMin, tempMax, 10, 100);
analogWrite(fan, fanSpeed);
A map csinál érdekes dolgokat, utána tudsz nézni, hogy pontosan mit is. Helyettesítsd be az értékeket, és megtudod.
Egyébként módosítani kellene a map függvényt, hogy minimum ellenőrizze, hogy a bemenő adat a határokon belül van-e. A hozzászólás módosítva: Okt 25, 2015
Sziasztok
Egy kis induló segítség kéne van egy arduino nanom és most kezdtem vele ismerkedni de a következőt szeretném vele megvalósítani.
Egy ventilátor vezérlést ami úgy néz ki hogy van 2.db ventilátor 2.db nyomógomb ha az egyik nyomógombot megnyomom akkor a hozzá tartózó ventilátor megy a programba beállított ideig majd megáll ,a másik nyomógomb ugyan ezzel a szisztémával működjön,de most jön a csavar a dologban a ventilátorok maguktól is kapcsoljanak be x-óránként egy bizonyos meghatározott ideig.
Az időzítésnek pontosnak kellene lennie.
A dolog nem lesz megépítve csak tanulás véget találtam ki,mert már egyszer ezt én megépítettem élőbe avr-rel és azóta is remekül működnek,most csak az arduino programozása miatt érdekelne hogy hogy nézne ki egy ilyen program.
Az induló segítséget előre is köszönöm.
Az Arduinoban is egy AVR ketyeg, azt tudod?
Meg lehet más módszerrel is csinálni ezt a szabályzást?
Nem adod meg mi történjen, ha temp < tempMin vagy ha temp > tempMax.
Ezt most nem értem mit akarsz mondani.
Szia
Igen tudom csak a program nyelvet akartam jobban érteni egy példán keresztül ezért írtam.
Üdv
60 nap alatt arduinó tanfolyam .
Feliratkozol és meg kapod a napi / heti tanfolyami anyagot ...
Persze ASM , C elő ismeretekkel könnyebben értelmezheted a dolgokat.
Tavir-60nap
Sziasztok!
2 arduino nano-t szeretnék soros kommunikációval összekötni.
Az egyik végezné a méréseket és végrehajtaná a feladatokat (ez a rész már működik) és küldené a mért értékeket a másik nano-nak, ami egy kijelzőt hajtva megjelenítené. 5 méterre lenne a két eszköz egymástól. A soros adatátvitelre van valakinek példája, amiből elindulhatnék?
Köszi.
Célszerűbb lenne inkább két mini Pro kártyát összekötni (azokban nem zavarkodik ott fölöslegesen az USB-UART protokol konverter), amelyekben szabad az RX/TX kivezetés.
A soros átvitelre példaprogramokat a fejlesztői környezettel együtt települő mintapéldák "04. Communication" fejezetében találsz. Nyilván a vétel lesz az izgalmasabb feladat...
Értem, köszi!
Akkor ez jó lenne nekem?
Ha jól értem, akkor a csomagban benne van az Usb-Soros illesztő is a programozáshoz?
Ebben biztosan benne van az illesztő. Csak sajnos jövőre jönne meg. A hozzászólás módosítva: Okt 25, 2015
Nem hátrány a soros illesztő, le is lehet kötni, mindkettővel tökéletesen megoldható egy probléma. Hogy benne-e van-e az USB-soros illesztő, az le van írva az oldalon, ahol linkelted...
Csak akkor van benne az USB-soros illesztő, ha a lap alján kiválasztod opcióként (+3300 Ft-ért).
Sziasztok
Egy fordulatszammerot szeretnek megszerkeszteni hall erzekelovel, kb. ugy 1000 fordulat/perc-ig el kellene hogy merjen (kb. 18 fordulat/mp jelentene).
Az a kerdesem lenne honnan alljak neki a progi megirasanak. Milyen modon kellene megoldani az erzekelo kiolvasast adva a kb. 18 Hz maxim jel aradat.
Szivesen fogadok akarmilyen otletet. Koszonom. A hozzászólás módosítva: Okt 27, 2015
Én megszakítással és microseconds()-al próbálnám. Az időből számítanám a fordulatszámot.
Ahogy szamolom az minim 55 milliszekundum (1000/18) lenne, ez igy ok lenne ? A hozzászólás módosítva: Okt 27, 2015
Szerintem igen, az 55555 usec.
Célszerű lenne megmérni több fordulat idejét, azt kiszámolni, (esetleg átlagolni,) kijelezni, aztán kezdeni az elején.
Üdv!
Esetleg ha softwareserial-lal oldanám meg az adás-vételt? Akkor nincs ott a zavaró usb-soros illesztő....
Adatküldéshez jó és egyszerű megoldás a softwareserial, de a vételhez jobb a hardveres támogatás. Persze, ha az egyik eszközöd nem csinál semmi mást, csak várja, hogy mikor jön az adat, s utána kap egy szusszanásnyi időt, hogy azt feldolgozza, akkor a vétel is megoldható szoftveresen.
(#) |
saua hozzászólása |
Okt 27, 2015 |
 |
/ |
 |
|
Sziasztok,
Nyomógombbal és telefonról is lehet kapcsolgatni a LED –et, a telefon 100 miliszekundumonként lekérdezi a LED állapotát (küldi a 3-as karaktert és visszakapja az 1 vagy 0 karaktert). A telefonos applikáció AppInvetorral készült, azzal elboldogulok, hogy több lekérdező kódot küldjön és megjelenítse a választ, de hogyan lehetne 4 LED-re, 4 gombra bővíteniaz alábbi kódot ?
/*
LED attached from pin 12 to ground
pushbutton attached to pin 5 from +5V
10K resistor attached to pin 5 from ground
*/
#include <SoftwareSerial.h>
int bluetoothTx = 2; // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3; // RX-I pin of bluetooth mate, Arduino D3
int led = 12;
int button = 5;
int dataFromBt;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// változókat hozunk létre:
int ledState = LOW; // kimeneti pin aktuális állapota
int buttonState; // bemeneti pin aktuális állapota
int lastButtonState = LOW; // bemeneti pin előző értéke
long lastDebounceTime = 0;
long debounceDelay = 50;
void setup()
{
Serial.begin(9600); // Begin the serial monitor at 9600bps
bluetooth.begin(115200); // The Bluetooth Mate defaults to 115200bps
bluetooth.print("$"); // Print three times individually
bluetooth.print("$");
bluetooth.print("$"); // Enter command mode
delay(100); // Short delay, wait for the Mate to send back CMD
bluetooth.println("U,9600,N"); // Temporarily Change the baudrate to 9600, no parity
// 115200 can be too fast at times for NewSoftSerial to relay the data reliably
bluetooth.begin(9600); // Start bluetooth serial at 9600
pinMode(led, OUTPUT);
pinMode(button, INPUT);
digitalWrite(led, ledState);
}
void loop()
{
if(bluetooth.available()) // If the bluetooth sent any characters
{
dataFromBt = bluetooth.read();
if(dataFromBt == '1'){
digitalWrite(led, HIGH);
ledState = HIGH;
}
if(dataFromBt == '0'){
digitalWrite(led, LOW);
ledState = LOW;
}
if(dataFromBt == '3'){
bluetooth.print(ledState);
}
}
int reading = digitalRead(button);
if (reading != lastButtonState) {
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
if (reading != buttonState) {
buttonState = reading;
if (buttonState == HIGH) {
ledState = !ledState;
digitalWrite(led, ledState);
}
}
}
lastButtonState = reading;
}
Megpróbálom azt a párosítást is.
Viszont csak egy sort jelenít meg az LCD.
Ez a küldő:
void setup(){
Serial.begin(9600);
}
void loop() {
Serial.print("k");
Serial.print(analogRead(0));
Serial.print(" ");
Serial.print("pA");
Serial.print(analogRead(1));
Serial.print(" ");
Serial.print("pT");
Serial.print(analogRead(2));
delay(1000);
}
És ez a vevő:
#include "LiquidCrystal.h";
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup(){
lcd.begin(16,2);
Serial.begin(9600);
}
void loop() {
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.begin(16,2);
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}
Azt szeretném, hogy ha mind a két sorba tudnék írni.
|
|