flux capasitor

algemene C code
Berichten: 13
Geregistreerd: 17 Jul 2013, 23:06

flux capasitor

Berichtdoor compukit » 12 Jul 2021, 22:47

goedemorgen/midag/avond/nacht.
ik ben met een projeckt bezich en ik kom der niet echt uit waarom het niet wilt werken.
ik ben aant proberen om de flux capasitor naar te maken alleen lukt het me niet om het programa werkend te krijgen.
is der meschiens iemand die me kan en wilt helpen ?.
ik zal hier onder zeten wat ik in elkaar heb geduwt van verschilende programas.
meschiens dat iemand me er me kan en wil helpen.
alvast enorm bedankt.


#include <SoftwareSerial.h>
#include <TinyGPS++.h>


/*
FLUC CAPACITOR
For: Daniel Hendrikson
This code written by Peter Kowald, South Australia.
And merge and debug by Christophe cukkuhbs, Brussel belgie.
Designed for Ardiuno Nano

Version 1.0.b0 27th May 2021 - Simple Test that the LEDS are Working
Version 1.0.b2 28th May 2021 - Flux capacitor Sequence and stop start operation added (using pin 3 on > running, off = stop)
Version 1.0.b3 10 juni 2021 - flux capacitor murge program and reacts on speed from gps.
*/
//OPEN-SMART Store: dx.com
// https://open-smart.pt.aliexpress.com/store/1199788

//--------------------------------------
//NOTE: you should upload the code first and then connect to GPS module
//Wiring guide
//GT-U7 GPS ---- Arduino UNO R3 / OPEN-SMART UNO
// VCC ---- 5V
// GND ---- GND
// RXD ---- NOT CONNECT
// TXD ---- RX (D0)
// PPS ---- NOT CONNECT
//--------------------------------------

#define GPRMC_TERM "$GPRMC," //Defines the instruction to be parsed, and it contains positioning and time information
//static const int RXPin = 2, TXPin = 3;
// static const uint32_t GPSBaud = 9600;
//SoftwareSerial serial_connection(2, 3); //RX=pin 2, TX=pin 3

TinyGPSPlus gps;
char nmeaSentence[68];
String latitude;
String longitude;
String lndSpeed;
String gpsTime; //time of prime meridian
String beiJingTime; //time of BeiJing of China
const byte pino_LED_1 = 11;
const byte pino_LED_2 = 10;
const byte pino_LED_3 = 9;
const byte pino_LED_4 = 8;
const byte pino_LED_5 = 7;
const byte pino_LED_6 = 6;
const byte pino_LED_7 = 5;
const byte pino_LED_8 = 4;
const uint8_t SOFT_SERIAL_RX_PIN = 2; // UNO must use this pin 2 & pin 3
const uint8_t SOFT_SERIAL_TX_PIN = 3;
int DELAYFLUX = 0;
const byte NUM_LEDS = 8;
const byte LED_pattern = B00111;
//SoftwareSerial GPS_serial(SOFT_SERIAL_RX_PIN, SOFT_SERIAL_TX_PIN); // RX, TX
struct
{
uint16_t controlBits = 0;
byte stateBits = 0; // this will control the state of the led
const byte pin[NUM_LEDS] = {pino_LED_1, pino_LED_2, pino_LED_3, pino_LED_4, pino_LED_5, pino_LED_6, pino_LED_7, pino_LED_8};
} led;
struct
{
uint32_t ms;
} timing;
SoftwareSerial GPS_serial(SOFT_SERIAL_RX_PIN, SOFT_SERIAL_TX_PIN); // RX, TX
struct
{
uint32_t speed = DELAYFLUX; // speed of flux capacitor running
byte start_speed = 0;

} flux_capacitor;


void setup()
{
Serial.begin(9600);
GPS_serial.begin(9600);
// int lndSpeed = FLUX();
// Set the Leds off and delar as ourputs //
for (byte i = 0; i < NUM_LEDS; i++)
{
digitalWrite(led.pin[i], LOW); pinMode(led.pin[i], OUTPUT);
}
digitalWrite(LED_BUILTIN, LOW); pinMode(LED_BUILTIN, OUTPUT);
// Kick things off
LED_Flux_Capacitor_Sequence_init();
timing.ms = millis();
GPS_serial.begin(9600);
}

void loop() //
{
int KMH;
String KMHS;
String DELAYFLUXS;
if (GPS_serial.available())
{
GPS_read();
}

// For one second we parse GPS data and report some key values
// for (unsigned long start = millis(); millis() - start < 1000;) //Keep searching GPS information in one second
{
while (Serial.available()) //The serial port gets the data and starts parsing
{
char c = Serial.read();

switch (c)
{
case '$': //$ is the beginning of a frame of data
Serial.readBytesUntil('*', nmeaSentence, 67);
//Serial.println(nmeaSentence);
//latitude = parseGprmcLat(nmeaSentence);
//longitude = parseGprmcLon(nmeaSentence);
lndSpeed = parseGprmcSpeed(nmeaSentence);
gpsTime = parseGprmcTime(nmeaSentence);
KMH = lndSpeed.toFloat() * 1.852;
KMHS = (String)KMH;
DELAYFLUX = 809 - ( 800 * KMH / 140 );
DELAYFLUXS = (String)DELAYFLUX;
//if (latitude > "") //If it is not null, print out the value
//{
// Serial.println("------------------------------------");
// Serial.println("latitude: " + latitude);
//}

//if (longitude > "") //If it is not null, print out the value
//{
// Serial.println("longitude: " + longitude);
//}
Serial.println("Speed (knots) voor reset: " + lndSpeed);
// if (lndSpeed > "0") //If it is not null, print out the value
if (lndSpeed == "") {
return loop();
}// test of het nu wel werkt

{
Serial.println("Speed (knots): " + lndSpeed);
Serial.println("KMHS waarde: " + KMHS); Serial.println("DELAYFLUXS waarde: " + DELAYFLUXS);
}

if (gpsTime > "") //If it is not null, print out the value
{
// Serial.println("gpsTime: " + gpsTime);
beiJingTime = getBeiJingTime(gpsTime); //Calculate Beijing time
// Serial.println("beiJingTime: " + beiJingTime);
}
}
// to change the speed of the flux capacitor change this...
flux_capacitor.speed = DELAYFLUX;
// to change when the flux capacitor stops and startschange this
flux_capacitor.start_speed = 0;


if (millis() - timing.ms >= flux_capacitor.speed)
{
timing.ms = millis(); // reset the timer
static bool flux_capacitor_running = false;

// if (flux_capacitor_running || KMH >= flux_capacitor.start_speed)
{
LED_Flux_Capacitor_Sequence();
flux_capacitor_running = LED_Driver(); // returns true if any leds are lit
static bool led;
led ^= true;
digitalWrite(LED_BUILTIN, led);
}
}
}
}
}

String getBeiJingTime(String s)
{
int hour = s.substring(0, 2).toInt();
int minute = s.substring(2, 4).toInt();
int second = s.substring(4, 6).toInt();

hour += 8;

if (hour > 24)
hour -= 24;
s = String(hour) + String(minute) + String(second);
return s;
}

//Parse GPRMC NMEA sentence data from String
//String must be GPRMC or no data will be parsed
//Return Latitude
String parseGprmcLat(String s)
{
int pLoc = 0; //paramater location pointer
int lEndLoc = 0; //lat parameter end location
int dEndLoc = 0; //direction parameter end location
String lat;
/*make sure that we are parsing the GPRMC string.
Found that setting s.substring(0,5) == "GPRMC" caused a FALSE.
There seemed to be a 0x0D and 0x00 character at the end. */
if (s.substring(0, 4) == "GPRM")
{
//Serial.println(s);
for (int i = 0; i < 5; i++)
{
if (i < 3)
{
pLoc = s.indexOf(',', pLoc + 1);
//*Serial.print("i < 3, pLoc: ");
// Serial.print(pLoc);
// Serial.print(", ");
// Serial.println(i);*/
}
if (i == 3)
{
lEndLoc = s.indexOf(',', pLoc + 1);
lat = s.substring(pLoc + 1, lEndLoc);
//*Serial.print("i = 3, pLoc: ");
// Serial.println(pLoc);
// Serial.print("lEndLoc: ");
// Serial.println(lEndLoc);*/
}
else
{
dEndLoc = s.indexOf(',', lEndLoc + 1);
lat = lat + " " + s.substring(lEndLoc + 1, dEndLoc);
//*Serial.print("i = 4, lEndLoc: ");
// Serial.println(lEndLoc);
// Serial.print("dEndLoc: ");
// Serial.println(dEndLoc);*/
}
}
return lat;
}
//}
//}
}

//Parse GPRMC NMEA sentence data from String
//String must be GPRMC or no data will be parsed
//Return Longitude
String parseGprmcLon(String s)
{
int pLoc = 0; //paramater location pointer
int lEndLoc = 0; //lat parameter end location
int dEndLoc = 0; //direction parameter end location
String lon;

/*make sure that we are parsing the GPRMC string.
Found that setting s.substring(0,5) == "GPRMC" caused a FALSE.
There seemed to be a 0x0D and 0x00 character at the end. */
if (s.substring(0, 4) == "GPRM")
{
//Serial.println(s);
for (int i = 0; i < 7; i++)
{
if (i < 5)
{
pLoc = s.indexOf(',', pLoc + 1);
//*Serial.print("i < 3, pLoc: ");
// Serial.print(pLoc);
// Serial.print(", ");
// Serial.println(i);*/
}
if (i == 5)
{
lEndLoc = s.indexOf(',', pLoc + 1);
lon = s.substring(pLoc + 1, lEndLoc);
//*Serial.print("i = 3, pLoc: ");
// Serial.println(pLoc);
// Serial.print("lEndLoc: ");
// Serial.println(lEndLoc);*/
}
else
{
dEndLoc = s.indexOf(',', lEndLoc + 1);
lon = lon + " " + s.substring(lEndLoc + 1, dEndLoc);
//*Serial.print("i = 4, lEndLoc: ");
// Serial.println(lEndLoc);
// Serial.print("dEndLoc: ");
// Serial.println(dEndLoc);*/
}
}
return lon;
}
}

//Parse GPRMC NMEA sentence data from String
//String must be GPRMC or no data will be parsed
//Return Longitude
String parseGprmcSpeed(String s)
{
int pLoc = 0; //paramater location pointer
int lEndLoc = 0; //lat parameter end location
int dEndLoc = 0; //direction parameter end location
String lndSpeed;

/*make sure that we are parsing the GPRMC string.
Found that setting s.substring(0,5) == "GPRMC" caused a FALSE.
There seemed to be a 0x0D and 0x00 character at the end. */
if (s.substring(0, 4) == "GPRM")
{
//Serial.println(s);
for (int i = 0; i < 8; i++)
{
if (i < 7)
{
pLoc = s.indexOf(',', pLoc + 1);
//*Serial.print("i < 8, pLoc: ");
// Serial.print(pLoc);
// Serial.print(", ");
// Serial.println(i);*/
}
else
{
lEndLoc = s.indexOf(',', pLoc + 1);
lndSpeed = s.substring(pLoc + 1, lEndLoc);
//*Serial.print("i = 8, pLoc: ");
// Serial.println(pLoc);
// Serial.print("lEndLoc: ");
// Serial.println(lEndLoc);*/
}
}
return lndSpeed;
}
}


//Parse GPRMC NMEA sentence data from String
//String must be GPRMC or no data will be parsed
//Return Longitude
String parseGprmcTime(String s)
{
int pLoc = 0; //paramater location pointer
int lEndLoc = 0; //lat parameter end location
int dEndLoc = 0; //direction parameter end location
String gpsTime;

/*make sure that we are parsing the GPRMC string.
Found that setting s.substring(0,5) == "GPRMC" caused a FALSE.
There seemed to be a 0x0D and 0x00 character at the end. */
if (s.substring(0, 4) == "GPRM")
{
//Serial.println(s);
for (int i = 0; i < 2; i++)
{
if (i < 1)
{
pLoc = s.indexOf(',', pLoc + 1);
//*Serial.print("i < 8, pLoc: ");
// Serial.print(pLoc);
// Serial.print(", ");
// Serial.println(i);*/
}
else
{
lEndLoc = s.indexOf(',', pLoc + 1);
gpsTime = s.substring(pLoc + 1, lEndLoc);
//*Serial.print("i = 8, pLoc: ");
// Serial.println(pLoc);
// Serial.print("lEndLoc: ");
// Serial.println(lEndLoc);*/
}
}
return gpsTime;
}
}

// Turn char[] array into String object
String charToString(char *c)
{

String val = "";

for (int i = 0; i <= sizeof(c); i++)
{
val = val + c[i];
}

return val;
}
void LED_Flux_Capacitor_Sequence_init()
{
led.controlBits = (uint16_t) LED_pattern << 8;
}

void LED_Flux_Capacitor_Sequence()
{
led.controlBits = led.controlBits << 1;
bitWrite(led.controlBits, 0, bitRead(led.controlBits, 12));
}

inline bool LED_Driver()
{
// turn on off //
for (byte i = 0; i < NUM_LEDS; i++)
{
if (bitRead(led.controlBits, i) != bitRead(led.stateBits, i))
{
bitWrite(led.stateBits, i, bitRead(led.controlBits, i));
digitalWrite(led.pin[i], bitRead(led.stateBits, i));
}
}
return byte(led.controlBits) & 255; // return true if any leds are on
}
void GPS_read()
{
const byte BUFFER_SIZE = 120;
static char buffer[BUFFER_SIZE];
static byte buffer_Index;
static byte field_Index;
static byte field_Pointer[20];

byte ch = GPS_serial.read();

if (ch == '$')
{
byte ChChecksum = 0;
byte RxChecksum = 0;
bool IncludeInChecksum = true;;
byte checksumBufferIndex = 0;
buffer_Index = 0;
field_Index = 0;
field_Pointer[0] = 0;
do
{
if (GPS_serial.available() == 0)
{
delay(3);
}
ch = GPS_serial.read();
Serial.write(ch);
if (ch == '*')
{
IncludeInChecksum = false;
checksumBufferIndex = buffer_Index + 1;
}
else if (IncludeInChecksum)
{
ChChecksum ^= ch;
}
if (ch == ',')
{
ch = '\0';
field_Pointer[++field_Index] = buffer_Index + 1;
}
buffer[buffer_Index++] = ch;

} while (ch != '\n' && buffer_Index < BUFFER_SIZE);

RxChecksum = 16 * HexChDec(buffer[checksumBufferIndex]) + HexChDec(buffer[checksumBufferIndex + 1]);
if (RxChecksum == ChChecksum)
{
if (buffer[2] == 'R' && buffer[3] == 'M' && buffer[4] == 'C')
{
static bool led;
led ^= true;
digitalWrite(LED_BUILTIN, led);
Process_RMC(buffer, field_Pointer);
}
//else
// {
// Serial.println("NOT RMC");
// }
return; // R E T U R N R E T U R N R E T U R N R E T U R N R E T U R N R E T U R N
}
}
}
void Process_RMC(char *data, byte *fields)// storing the data does not nessaraly mean fully conver the values into meaninfull values - further processing may be required
{
//GNRMC, 133155.50, A, 3454.48755, S, 13841.24001, E, 0.133, ,080519, , ,A*77
// 1 2 3 4 5 6 7 8 9 10 11 12 13
//GNRMC, 111103.50, A, 3454.48635, S, 13841.24421, E, 0.015, , 150519, , , D *79
//GNRMC, 111621.00, A, 3454.48755, S, 13841.24446, E, 4.381, 119.88, 150519, , , A *65
// ID , UTC , S, Lat Lon SOG COG DATE MV MV , Mode

// NMEA RMC = recommended minimum data for gps
//Parameter Value Unit Description
//1. UTC hhmmss.sss Universal time coordinated
//2. Status A=Valid, V=Invalid
//3. Lat ddmm.mmmm Latitude
//4. Northing Indicator N=North, S=South
//5. Lon dddmm.mmmm Longitude
//6. Easting Indicator E=East, W=West
//7. SOG knots Speed Over Ground
//8. COG (true) ° Course Over Ground (true)
//9. Date ddmmyy Universal time coordinated
//10. Magnetic Variation ° Magnetic Variation
//11. Magnetic Variation E=East,W=West
//12. Mode Indicator A=Autonomous, D=Differential, R=Fixed RTK, F=Float RTK, E=Dead Reckoning, N=None
//13. Navigational Status S=Safe C=Caution U=Unsafe V=Not valid ?????????? This does nt seem to be arriving


// GPS.speed = (uint8_t)(atof(data + fields[7]) * 1.15); // Knots (admiralty) to MPH 1.15
//Serial.print("Speed in MPH = "); Serial.println(GPS.speed);

}


byte HexChDec(byte HexCh)
{
if (HexCh >= '0' && HexCh <= '9')
{
return HexCh - '0';
}
else if (HexCh >= 'A' && HexCh <= 'F')
{
return HexCh - 'A' + 10;
}
}
leef nu het kan want voor je het weet is het te laat :)

Advertisement

Berichten: 4064
Geregistreerd: 16 Okt 2013, 14:31
Woonplaats: s hertogenbosch

Re: flux capasitor

Berichtdoor shooter » 13 Jul 2021, 12:03

allereerst het probleem beter beschrijven, ipv 3 bladen met een niet zelfgemaakt programma .
wat is een flux capasitor? hoe werkt het en laat eens wat video zien of wat je al gemaakt hebt.
paul deelen
shooter@home.nl

Berichten: 180
Geregistreerd: 26 Aug 2015, 11:57

Re: flux capasitor

Berichtdoor Frits1956 » 13 Jul 2021, 18:53

Deze regel is zeer belangrijk anders zou dit niet specifiek vermeld zijn.
//NOTE: you should upload the code first and then connect to GPS module
Ik ga ervan uit dat er wat mis gaat als de module is aangesloten voor het uploaden.

Verder heb je een procedure Process_RMC en deze kan je helemaal verwijderen omdat er alleen comment regels in staan......

Berichten: 287
Geregistreerd: 15 Apr 2021, 20:05

Re: flux capasitor

Berichtdoor ctunes » 13 Jul 2021, 22:31


Berichten: 13
Geregistreerd: 17 Jul 2013, 23:06

Re: flux capasitor

Berichtdoor compukit » 14 Jul 2021, 12:37

shooter schreef:allereerst het probleem beter beschrijven, ipv 3 bladen met een niet zelfgemaakt programma .
wat is een flux capasitor? hoe werkt het en laat eens wat video zien of wat je al gemaakt hebt.


probleem is dat de led niks doen terwijl dat wel zou moeten en wat het moet doen wel het zou het zelfde moeten doen als de flux capasitor in back to the futher.
leef nu het kan want voor je het weet is het te laat :)

Berichten: 13
Geregistreerd: 17 Jul 2013, 23:06

Re: flux capasitor

Berichtdoor compukit » 14 Jul 2021, 12:41

Frits1956 schreef:Deze regel is zeer belangrijk anders zou dit niet specifiek vermeld zijn.
//NOTE: you should upload the code first and then connect to GPS module
Ik ga ervan uit dat er wat mis gaat als de module is aangesloten voor het uploaden.

Verder heb je een procedure Process_RMC en deze kan je helemaal verwijderen omdat er alleen comment regels in staan......


wel ik heb daarom de pinne om gezet naar pin 2 en 3 zodat die kan worden geupload zonder los te halen en omdat ik vermoed dat hoe ik ze op pin 0 en 1 had dat dat ook niet werkden.
het rare is dat ook al heb ik de iprint lijnen op non actief gezet (en weet dat ik alle regels waar // voor staat er uit kan halen) ik ze er nog in heb staan om te kijken of er iets verandert als ik ze weer actief maak.
het rare is dat ook al staan de iprint regels op non actief ze om een of andere reden toch werken dus in prinsiep werkt het programa zo alsof ik er totaal niks aan veranderd heb.
en aan gezien ik niet echt verstand heb van programeren snap ik ook niet waarom het programa doet wat het nu doet en niet doet wat het moet doen.
leef nu het kan want voor je het weet is het te laat :)

Berichten: 4064
Geregistreerd: 16 Okt 2013, 14:31
Woonplaats: s hertogenbosch

Re: flux capasitor

Berichtdoor shooter » 14 Jul 2021, 17:55

doe je wel een geslaagde upload? want als dat niet verandet dan wertk het oude programma en dan kom je helemaal niet vooruit.
paul deelen
shooter@home.nl

Berichten: 13
Geregistreerd: 17 Jul 2013, 23:06

Re: flux capasitor

Berichtdoor compukit » 14 Jul 2021, 23:34

shooter schreef:doe je wel een geslaagde upload? want als dat niet verandet dan wertk het oude programma en dan kom je helemaal niet vooruit.

wel dat is het hem net hiuj upload hem zonder problemen.
hoe ik hem op pin 0 en 1 had moest ik hem los treken (heb toen een tijdje een schakelaar er tussen gezet die ik wel eens vergat om te zeten en dan duurden het lang en kreeg ik een foutmelding).
maar ik krijg geen foutmelding dus ga er van uit dat die het goed upload.
ik kan eens proberen de gps los te halen het programa te uploaden en te kijken of het dan wel werkt.
leef nu het kan want voor je het weet is het te laat :)

Berichten: 13
Geregistreerd: 17 Jul 2013, 23:06

Re: flux capasitor

Berichtdoor compukit » 14 Jul 2021, 23:47

shooter schreef:doe je wel een geslaagde upload? want als dat niet verandet dan wertk het oude programma en dan kom je helemaal niet vooruit.

het rare vindt ik dat als ik met serial monitor kijk dat ik dit krijg.
23:39:00.221 -> GPVTG,,,,,,,,,N*30
23:39:00.254 -> GPGGA,213903.00,,,,,0,00,99.99,,,,,,*6C
23:39:00.287 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:00.321 -> GPGSV,1,1,03,06,,,07,20,,,30,23,,,27*7E
23:39:00.388 -> GPGLL,,,,,213903.00,V,N*40
23:39:01.190 -> GPRMC,213904.00,V,,,,,,,140721,,,N*71
23:39:01.223 -> GPVTG,,,,,,,,,N*30
23:39:01.258 -> GPGGA,213904.00,,,,,0,00,99.99,,,,,,*6B
23:39:01.292 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:01.325 -> GPGSV,1,1,01,20,,,30*79
23:39:01.358 -> GPGLL,,,,,213904.00,V,N*47
23:39:02.165 -> GPRMC,213905.00,V,,,,,,,140721,,,N*70
23:39:02.231 -> GPVTG,,,,,,,,,N*30
23:39:02.231 -> GPGGA,213905.00,,,,,0,00,99.99,,,,,,*6A
23:39:02.299 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:02.332 -> GPGSV,1,1,01,20,,,30*79
23:39:02.365 -> GPGLL,,,,,213905.00,V,N*46
23:39:03.165 -> GPRMC,213906.00,V,,,,,,,140721,,,N*73
23:39:03.232 -> GPVTG,,,,,,,,,N*30
23:39:03.232 -> GPGGA,213906.00,,,,,0,00,99.99,,,,,,*69
23:39:03.299 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:03.333 -> GPGSV,1,1,02,20,,,29,22,,,08*7A
23:39:03.366 -> GPGLL,,,,,213906.00,V,N*45
23:39:04.166 -> GPRMC,213907.00,V,,,,,,,140721,,,N*72
23:39:04.233 -> GPVTG,,,,,,,,,N*30
23:39:04.267 -> GPGGA,213907.00,,,,,0,00,99.99,,,,,,*68
23:39:04.301 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:04.335 -> GPGSV,1,1,01,20,,,30*79
23:39:04.369 -> GPGLL,,,,,213907.00,V,N*44
23:39:05.340 -> GPRMC,213908.00,V,,,,,,,140721,,,N*7D
23:39:05.406 -> GPVTG,,,,,,,,,N*30
23:39:05.406 -> GPGGA,213908.00,,,,,0,00,99.99,,,,,,*67
23:39:05.473 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:05.506 -> GPGSV,1,1,01,20,,,29*71
23:39:05.539 -> GPGLL,,,,,213908.00,V,N*4B
23:39:06.208 -> GPRMC,213909.00,V,,,,,,,140721,,,N*7C
23:39:06.208 -> GPVTG,,,,,,,,,N*30
23:39:06.241 -> GPGGA,213909.00,,,,,0,00,99.99,,,,,,*66
23:39:06.274 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:06.340 -> GPGSV,1,1,01,20,,,30*79
23:39:06.373 -> GPGLL,,,,,213909.00,V,N*4A
23:39:07.179 -> GPRMC,213910.00,V,,,,,,,140721,,,N*74
23:39:07.212 -> GPVTG,,,,,,,,,N*30
23:39:07.246 -> GPGGA,213910.00,,,,,0,00,99.99,,,,,,*6E
23:39:07.280 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:07.347 -> GPGSV,1,1,02,20,,,30,24,,,08*74
23:39:07.380 -> GPGLL,,,,,213910.00,V,N*42
23:39:08.182 -> GPRMC,213911.00,V,,,,,,,140721,,,N*75
23:39:08.215 -> GPVTG,,,,,,,,,N*30
23:39:08.249 -> GPGGA,213911.00,,,,,0,00,99.99,,,,,,*6F
23:39:08.284 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:08.318 -> GPGSV,1,1,01,20,,,30*79
23:39:08.351 -> GPGLL,,,,,213911.00,V,N*43
23:39:09.190 -> GPRMC,213912.00,V,,,,,,,140721,,,N*76
23:39:09.223 -> GPVTG,,,,,,,,,N*30
23:39:09.257 -> GPGGA,213912.00,,,,,0,00,99.99,,,,,,*6C
23:39:09.291 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:09.324 -> GPGSV,1,1,02,20,,,30,22,,,19*72
23:39:09.357 -> GPGLL,,,,,213912.00,V,N*40
23:39:10.193 -> GPRMC,213913.00,V,,,,,,,140721,,,N*77
23:39:10.227 -> GPVTG,,,,,,,,,N*30
23:39:10.260 -> GPGGA,213913.00,,,,,0,00,99.99,,,,,,*6D
23:39:10.294 -> GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
23:39:10.327 -> GPGSV,1,1,03,20,,,30,22,,,17,28,,,27*72
23:39:10.393 -> GPGLL,,,,,213913.00,V,N*41
terwijl dat volgens mij niet in programa staat en ik eigen waardes heb aan gegeven die die zou moeten weer geven die ik hier niet terug zie.
23:43:25.207 -> GPRMC,214326.00,A,5051.37906,N,00539.83482,E,0.448,,140721,,,A*79
23:43:25.273 -> GPVTG,,T,,M,0.448,N,0.830,K,A*20
23:43:25.307 -> GPGGA,214326.00,5051.37906,N,00539.83482,E,1,05,4.76,76.2,M,46.4,M,,*69
23:43:25.409 -> GPGSA,A,3,05,20,13,14,15,,,,,,,,5.17,4.76,2.02*00
23:43:25.443 -> GPGSV,2,1,07,05,58,281,39,13,46,281,40,14,28,150,35,15,16,286,34*7E
23:43:25.510 -> GPGSV,2,2,07,18,12,329,17,20,57,212,37,28,17,160,39*4E
23:43:25.578 -> GPGLL,5051.37906,N,00539.83482,E,214326.00,A,A*69
23:43:26.213 -> GPRMC,214327.00,A,5051.37931,N,00539.83505,E,0.322,,140721,,,A*79
23:43:26.281 -> GPVTG,,T,,M,0.322,N,0.596,K,A*2A
23:43:26.315 -> GPGGA,214327.00,5051.37931,N,00539.83505,E,1,05,4.76,75.9,M,46.4,M,,*6A
23:43:26.382 -> GPGSA,A,3,05,20,13,14,15,,,,,,,,5.17,4.76,2.02*00
23:43:26.450 -> GPGSV,2,1,07,05,58,281,39,13,46,281,40,14,28,150,36,15,16,286,34*7D
23:43:26.516 -> GPGSV,2,2,07,18,12,329,18,20,57,212,38,28,17,160,39*4E
23:43:26.583 -> GPGLL,5051.37931,N,00539.83505,E,214327.00,A,A*62
23:43:27.220 -> GPRMC,214328.00,A,5051.37950,N,00539.83520,E,0.484,,140721,,,A*7D
23:43:27.288 -> GPVTG,,T,,M,0.484,N,0.897,K,A*2D
23:43:27.321 -> GPGGA,214328.00,5051.37950,N,00539.83520,E,1,05,4.76,75.6,M,46.4,M,,*6A
23:43:27.388 -> GPGSA,A,3,05,20,13,14,15,,,,,,,,5.17,4.76,2.02*00
23:43:27.455 -> GPGSV,2,1,07,05,58,281,39,13,46,281,40,14,28,150,36,15,16,286,34*7D
23:43:27.522 -> GPGSV,2,2,07,18,12,329,18,20,57,212,38,28,17,160,39*4E
23:43:27.589 -> GPGLL,5051.37950,N,00539.83520,E,214328.00,A,A*6D
23:43:28.193 -> GPRMC,214329.00,A,5051.37976,N,00539.83553,E,0.326,,140721,,,A*73
23:43:28.259 -> GPVTG,,T,,M,0.326,N,0.603,K,A*21
dit is met gps lock.
terwijl als ik het goed heb dit is uitgeschakeld in programa en zou die moeten weer geven wat de snelhied is en de vertragins snelhied als ik het goed heb.
afgezien dat de leds niet heel langzaam kniperen (omdat ik op een punt sta).
dus ik snap het allemaal ff niet wat er mis is of wat er niet klopt want volgens mij zou het gewoon klopen en moeten werken (maar ja ik kan dan ook niet echt veel van het programeren van een ardruino).
leef nu het kan want voor je het weet is het te laat :)

Berichten: 180
Geregistreerd: 26 Aug 2015, 11:57

Re: flux capasitor

Berichtdoor Frits1956 » 15 Jul 2021, 00:05

Je kan niet zomaar andere pinnen gebruiken. Er zijn pinnen die specifieke functies hebben zoals Rx en Tx

lees deze tekst maar eens
Serial ports
The Arduino Uno WiFi Rev. 2 has 3 hardware serial ports. Serial is connected to the USB interface, Serial1 is connected to Pin 0 (RX) and 1 (TX), Serial 2 is connected to the u-blox NINA-W13 module. This allows the usage of pins 0 and 1 without issues: on the original Arduino UNO, the usage of Pins 0 and 1 disrupts the sketch upload.

dit vind je in https://www.arduino.cc/en/Guide/ArduinoUnoWiFiRev2

Volgende

Terug naar C code

Wie is er online?

Gebruikers in dit forum: Geen geregistreerde gebruikers en 7 gasten