Update
BIN
AO3400A.pdf
Normal file
BIN
ATtiny13A-Data-Sheet-DS40002307A.pdf
Normal file
BIN
ATtiny1614-16-17-DataSheet-DS40002204A.pdf
Normal file
BIN
CDM_Rail_Guide_MM.pdf
Normal file
2
Crane/Crane.kicad_pcb
Normal file
@@ -0,0 +1,2 @@
|
||||
(kicad_pcb (version 20240108) (generator "pcbnew") (generator_version "8.0")
|
||||
)
|
||||
32
Crane/Crane.kicad_pro
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"board": {
|
||||
"design_settings": {
|
||||
"defaults": {},
|
||||
"diff_pair_dimensions": [],
|
||||
"drc_exclusions": [],
|
||||
"rules": {},
|
||||
"track_widths": [],
|
||||
"via_dimensions": []
|
||||
}
|
||||
},
|
||||
"boards": [],
|
||||
"libraries": {
|
||||
"pinned_footprint_libs": [],
|
||||
"pinned_symbol_libs": []
|
||||
},
|
||||
"meta": {
|
||||
"filename": "kicad.kicad_pro",
|
||||
"version": 1
|
||||
},
|
||||
"net_settings": {
|
||||
"classes": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
}
|
||||
},
|
||||
"pcbnew": {
|
||||
"page_layout_descr_file": ""
|
||||
},
|
||||
"sheets": [],
|
||||
"text_variables": {}
|
||||
}
|
||||
5
Crane/Crane.kicad_sch
Normal file
@@ -0,0 +1,5 @@
|
||||
(kicad_sch (version 20231120) (generator "eeschema") (generator_version "8.0")
|
||||
(paper "A4")
|
||||
(lib_symbols)
|
||||
(symbol_instances)
|
||||
)
|
||||
88
Crane/Marklin_AC_Motor.kicad_sym
Normal file
@@ -0,0 +1,88 @@
|
||||
(kicad_symbol_lib (version 20220914) (generator kicad_symbol_editor)
|
||||
(symbol "Marklin_AC_Motor" (in_bom yes) (on_board yes)
|
||||
(property "Reference" "M" (at 0 5.08 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Value" "Marklin_AC_Motor" (at 0 -5.08 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Description" "Märklin AC Motor with center tap" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_keywords" "motor AC marklin train" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "Marklin_AC_Motor_0_1"
|
||||
(circle (center 0 0) (radius 3.81)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(arc (start -2.54 0) (mid -1.7678 1.7678) (end 0 2.54)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(arc (start 0 -2.54) (mid 1.7678 -1.7678) (end 2.54 0)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(arc (start 0 2.54) (mid 1.7678 1.7678) (end 2.54 0)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(arc (start 2.54 0) (mid 1.7678 -1.7678) (end 0 -2.54)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy -3.81 0)
|
||||
(xy -2.54 0)
|
||||
)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0 3.81)
|
||||
(xy 0 2.54)
|
||||
)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 2.54 0)
|
||||
(xy 3.81 0)
|
||||
)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(text "M" (at 0 0 0)
|
||||
(effects (font (size 2.54 2.54) bold))
|
||||
)
|
||||
(text "AC" (at 0 -1.27 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
)
|
||||
(symbol "Marklin_AC_Motor_1_1"
|
||||
(pin passive line (at -6.35 0 0) (length 2.54)
|
||||
(name "L1" (effects (font (size 1.27 1.27))))
|
||||
(number "1" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
(pin passive line (at 0 6.35 270) (length 2.54)
|
||||
(name "CT" (effects (font (size 1.27 1.27))))
|
||||
(number "2" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
(pin passive line (at 6.35 0 180) (length 2.54)
|
||||
(name "L2" (effects (font (size 1.27 1.27))))
|
||||
(number "3" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
BIN
DccLoco_1.0.zip
Normal file
376
DirectMFX.ino
Normal file
@@ -0,0 +1,376 @@
|
||||
// 31 mars 2022 : Demo code for 2 MFX locs, 1 Turn (Adr=5) & S88 (16 inputs)
|
||||
// MFX est une marque déposée par Märklin
|
||||
// Ce code minimaliste a besoin de la Gleisbox pour lire l'UID présent dans chaque locomotive
|
||||
// voir procédure dans §4.1 de http://gelit.ch/Train/Raildue_F.pdf
|
||||
|
||||
#include <DueTimer.h>
|
||||
|
||||
// Pin D0-D1 used by USB
|
||||
const int Pin2_L293 = 2; // voir §10 de http://gelit.ch/Train/DirectMM2.pdf
|
||||
const int Pin7_L293 = 3;
|
||||
const int PowerPin = 8; // pin 1 L293 (enable H-Bridge)
|
||||
|
||||
const int CLOCK = 10; // S88 voir §5.3 de http://gelit.ch/Train/Raildue_F.pdf
|
||||
const int DATA = 11;
|
||||
const int RESET = 12;
|
||||
const int LOAD = 13;
|
||||
|
||||
const int Red_Led = 9; // Power Status
|
||||
|
||||
const int S88_Nb = 16; // 1 module Littfinski RM-88-N-Opto
|
||||
|
||||
const byte LoMax = 2; // Taille du tableau des locomotives
|
||||
|
||||
const byte Rob = 1; // Robel 39548
|
||||
const byte BLS = 2; // BLS 29486
|
||||
|
||||
// Toutes ces variables sont globales et présentes en PERMANENCE en RAM
|
||||
volatile byte B[100]; // MFX Buffer (type BYTE to store Length)
|
||||
volatile bool Busy; // many MFX Writers (Zentrale, Periodic, getSID, Speed, ...) --> only 1 at the same time (Busy=0 by Interrupt)
|
||||
volatile int Ti; // MM2_Bit
|
||||
volatile uint16_t crc; // Krauss p13
|
||||
volatile bool F; // MFX First bit always 1
|
||||
volatile byte I; // Interrupt buffer index B[I]);
|
||||
volatile bool Le; // MFX Level (polarité)
|
||||
volatile byte Len; // MFX Frame Length
|
||||
volatile byte LoA; // only 1 Loc is active for Speed & Direction
|
||||
volatile byte LoR; // Refresh
|
||||
volatile byte N; // MFX Interrupt
|
||||
volatile byte NSync; // 3 caract de synchro MFX au min
|
||||
volatile bool P[S88_Nb+10]; // S88 Physical Register
|
||||
volatile byte Pa[18+4]; // MM2 Packet for Turn
|
||||
volatile bool Power;
|
||||
volatile byte S; // State in loop
|
||||
volatile int SM; // MFX State Machine
|
||||
volatile byte StufN; // Stuffing bit
|
||||
volatile bool ToSend;
|
||||
volatile bool Trace; // Debug
|
||||
volatile bool TuCmd; // Turn Cmd
|
||||
volatile bool TurnVal; // Turn Value
|
||||
volatile byte TurnAdr; // Turn Adress
|
||||
volatile unsigned long TZ,TP,T_S88,Time;
|
||||
volatile byte Za; // Zahler in Zentrale Frame
|
||||
|
||||
struct LoS {
|
||||
bool Dir; // Direction
|
||||
byte Vit; // Speed
|
||||
bool Light;
|
||||
byte UID0;
|
||||
byte UID1;
|
||||
byte UID2;
|
||||
byte UID3;
|
||||
};
|
||||
volatile struct LoS Lo[LoMax+2];
|
||||
|
||||
void setup() {
|
||||
byte a;
|
||||
|
||||
Trace=0; // debug
|
||||
Serial.begin(115200); Serial.println("DirectMFX");
|
||||
|
||||
pinMode(PowerPin,OUTPUT); digitalWrite(PowerPin,0); Power=0;
|
||||
pinMode(Red_Led,OUTPUT); digitalWrite(Red_Led,0);
|
||||
pinMode(Pin2_L293,OUTPUT); pinMode(Pin7_L293,OUTPUT);
|
||||
digitalWrite(Pin2_L293,0); digitalWrite(Pin7_L293,1);
|
||||
|
||||
Lo[Rob].UID0=0x73; Lo[Rob].UID1=0xfb; Lo[Rob].UID2=0x17; Lo[Rob].UID3=0x40; //
|
||||
Lo[BLS].UID0=0xF9; Lo[BLS].UID1=0xF2; Lo[BLS].UID2=0x3A; Lo[BLS].UID3=0xC1;
|
||||
|
||||
LoA=1; Serial.println("Robel is active");
|
||||
TurnAdr=5; TurnVal=0;
|
||||
|
||||
pinMode(DATA, INPUT); pinMode(CLOCK, OUTPUT); pinMode(LOAD, OUTPUT); pinMode(RESET, OUTPUT);
|
||||
|
||||
Timer3.attachInterrupt(T); Timer3.start(50); // interrupt every 50 us (micro seconde)
|
||||
|
||||
Busy=0;
|
||||
S=1; SM=1; N=0; NSync=0; ToSend=0; StufN=0; TuCmd=0;
|
||||
Le=1; // §2.2.9 Pause mit neg Potential
|
||||
Serial.println("PowerOFF - Enter to PowerON");
|
||||
}
|
||||
|
||||
void Speed(byte Loc, byte Value) { // §3.1.2 Fahren mit 8 steps
|
||||
byte a,b;
|
||||
if (Trace) {Serial.print("Speed-"); Serial.print(Loc); Serial.print("-"); Serial.println(Value);}
|
||||
do {} while (Busy); Busy=1;
|
||||
Len=0;
|
||||
Adr(Loc);
|
||||
B[10]=0; B[11]=0; B[12]=0; Len=Len+3;
|
||||
if (Lo[Loc].Dir) {B[13]=1;} else {B[13]=0;} Len=Len+1; // Direction
|
||||
b=2; for (a=0; a<3; a++) {B[a+14]=bitRead(Value,b); b--;} Len=Len+3;
|
||||
B[0]=Len; // Length in FIRST BYTE
|
||||
CRC(); ToSend=1;
|
||||
}
|
||||
|
||||
void Adr(byte Loc) { // set SID
|
||||
byte a,b;
|
||||
B[1]=1; B[2]=0; // always 7 bit adr (B[0] used for LENGTH)
|
||||
b=6; for (a=0; a<8; a++) {B[a+3]=bitRead(Loc,b); b--;}
|
||||
Len=2+7;
|
||||
}
|
||||
|
||||
void Func(byte Loc, byte Fu, bool Value) { // §3.1.6 Einzel Funktion
|
||||
byte a,b;
|
||||
if (Trace) {Serial.print("Func-"); Serial.print(Loc); Serial.print("-"); Serial.print(Fu); Serial.print("-"); Serial.println(Value);}
|
||||
do {} while (Busy); Busy=1;
|
||||
Len=0;
|
||||
Adr(Loc);
|
||||
B[10]=1; B[11]=0; B[12]=0; Len=Len+3;
|
||||
b=6; for (a=0; a<8; a++) {B[a+13]=bitRead(Fu,b); b--;} Len=Len+7;
|
||||
B[20]=0; B[21]=Value; Len=Len+2;
|
||||
B[0]=Len; // Length in FIRST BYTE
|
||||
CRC(); ToSend=1;
|
||||
}
|
||||
|
||||
void Periodic(byte Loc) { // like MS2
|
||||
byte a,b;
|
||||
if (Trace) {Serial.print("Periodic-"); Serial.println(Loc);}
|
||||
do {} while (Busy); Busy=1;
|
||||
Len=0;
|
||||
Adr(Loc);
|
||||
B[10]=0; B[11]=0; B[12]=1; Len=Len+3; // Fahren
|
||||
if (Lo[Loc].Dir) {B[13]=1;} else {B[13]=0;} Len=Len+1;
|
||||
b=2; for (a=0; a<3; a++) {B[a+14]=bitRead(Lo[Loc].Vit,b); b--;} Len=Len+3;
|
||||
|
||||
B[17]=0; B[18]=0; B[19]=0; B[20]=0; Len=Len+4; // only MSB
|
||||
B[21]=0; B[22]=1; B[23]=1; B[24]=1; Len=Len+4; // §3.1.5 F15-F0
|
||||
B[25]=0; B[26]=0; B[27]=0; B[28]=0; B[29]=0; B[30]=0; B[31]=0; B[32]=0; Len=Len+8;
|
||||
B[33]=0; B[34]=0; B[35]=0; B[36]=0; B[37]=0; B[38]=0; B[39]=0; B[40]=Lo[Loc].Light; Len=Len+8;
|
||||
B[0]=Len; // Length in FIRST BYTE
|
||||
CRC(); ToSend=1;
|
||||
}
|
||||
|
||||
void Adr0() {B[1]=1; B[2]=0; B[3]=0; B[4]=0; B[5]=0; B[6]=0; B[7]=0; B[8]=0; B[9]=0; Len=2+7;} // always 7 bit adr (B[0] used for LENGTH)
|
||||
|
||||
void getSID(byte Loc) { // fixed SID from UID
|
||||
byte a,b;
|
||||
if (Trace) {Serial.print("getSID-"); Serial.println(Loc);}
|
||||
do {} while (Busy); Busy=1;
|
||||
Len=0;
|
||||
Adr0();
|
||||
B[10]=1; B[11]=1; B[12]=1; B[13]=0; B[14]=1; B[15]=1; Len=Len+6; // §3.2.4 111 011 AAAAAAAAAAAAAA UID
|
||||
B[16]=0; B[17]=0; B[18]=0; B[19]=0; B[20]=0; B[21]=0; B[22]=0; Len=Len+7;
|
||||
b=6; for (a=0; a<7; a++) {B[a+23]=bitRead(Loc,b); b--;} Len=Len+7;
|
||||
b=7; for (a=0; a<8; a++) {B[a+30]=bitRead(Lo[Loc].UID0,b); b--;} Len=Len+8; // UID
|
||||
b=7; for (a=0; a<8; a++) {B[a+38]=bitRead(Lo[Loc].UID1,b); b--;} Len=Len+8;
|
||||
b=7; for (a=0; a<8; a++) {B[a+46]=bitRead(Lo[Loc].UID2,b); b--;} Len=Len+8;
|
||||
b=7; for (a=0; a<8; a++) {B[a+54]=bitRead(Lo[Loc].UID3,b); b--;} Len=Len+8; //=61
|
||||
B[0]=Len; // Length in FIRST BYTE
|
||||
CRC(); ToSend=1;
|
||||
}
|
||||
|
||||
void Zentrale() { // p23
|
||||
byte a,b;
|
||||
if (Trace) {Serial.println("Zentrale");}
|
||||
do {} while (Busy); Busy=1;
|
||||
Len=0;
|
||||
Adr0();
|
||||
B[10]=1; B[11]=1; B[12]=1; B[13]=1; B[14]=0; B[15]=1; Len=Len+6;
|
||||
|
||||
B[16]=0; B[17]=1; B[18]=0; B[19]=0; B[20]=0; B[21]=1; B[22]=1; B[23]=1; Len=Len+8; // Zentrale UID (32 bit)
|
||||
B[24]=0; B[25]=1; B[26]=1; B[27]=0; B[28]=1; B[29]=0; B[30]=1; B[31]=1; Len=Len+8;
|
||||
B[32]=1; B[33]=0; B[34]=1; B[35]=1; B[36]=0; B[37]=1; B[38]=1; B[39]=1; Len=Len+8;
|
||||
B[40]=1; B[41]=1; B[42]=0; B[43]=1; B[44]=1; B[45]=1; B[46]=0; B[47]=0; Len=Len+8;
|
||||
|
||||
B[48]=1; B[49]=0; B[50]=0; B[51]=0; B[52]=0; B[53]=0; B[54]=0; B[55]=0; Len=Len+8; // Zähler (16 bit)
|
||||
b=7; for (a=0; a<8; a++) {B[a+56]=bitRead(Za,b); b--;} Len=Len+8;
|
||||
|
||||
B[0]=Len; // Length in FIRST BYTE
|
||||
CRC(); ToSend=1;
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
byte a, cmd;
|
||||
|
||||
switch (S) {
|
||||
|
||||
case 0 : // stay here after PowerOFF
|
||||
break;
|
||||
|
||||
case 1 : if (Serial.available() > 0) {cmd = Serial.read(); // start here from setup
|
||||
if (cmd==13) {SM=10; delay(200); S=2;}} // send Sync & PowerON
|
||||
break;
|
||||
|
||||
case 2 : if (Power) {delay(500); digitalWrite(Red_Led,1); Serial.println("PowerON (Enter to PowerOFF)"); S=3;}
|
||||
break;
|
||||
|
||||
case 3 : Za=1; Zentrale(); delay(500); Zentrale(); delay(500); Zentrale(); delay(500); S=4; // §4.2
|
||||
break;
|
||||
|
||||
case 4 : getSID(Rob); delay(200); Za++; Zentrale(); delay(200); Serial.println("getSID Robel");
|
||||
getSID(BLS); delay(200); Za++; Zentrale(); delay(200); Serial.println("getSID BLS");
|
||||
|
||||
Lo[Rob].Vit=0; Speed(Rob,Lo[Rob].Vit); Lo[Rob].Dir=0; Lo[Rob].Light=1; Func(Rob,0,Lo[Rob].Light);
|
||||
Lo[BLS].Vit=0; Speed(BLS,Lo[BLS].Vit); Lo[BLS].Dir=0; Lo[BLS].Light=1; Func(BLS,0,Lo[BLS].Light);
|
||||
|
||||
LoR=1;
|
||||
TP=millis()+50; TZ=millis()+500; T_S88 = millis()+1000; // set Timing
|
||||
S=5;
|
||||
break;
|
||||
|
||||
case 5 :
|
||||
|
||||
if (millis() > T_S88) {T_S88 = millis()+1000; S88();}
|
||||
if (millis() > TZ) {TZ = millis()+500; Zentrale();}
|
||||
if (millis() > TP) {TP = millis()+50; Periodic(LoR);
|
||||
LoR++; if (LoR==LoMax+1) {LoR=1;}} // Find Next Decoder
|
||||
|
||||
if (Serial.available() > 0) {
|
||||
cmd = Serial.read();
|
||||
if (cmd>64 && cmd<91) {Serial.println("CapsLock !!!");}
|
||||
if (cmd >= '0' && cmd <= '7') {Lo[LoA].Vit=cmd-48; Speed(LoA,Lo[LoA].Vit); Serial.print("Speed="); Serial.println(Lo[LoA].Vit);}
|
||||
switch (cmd) {
|
||||
case '8': LoA=Rob; Serial.println("Robel"); break;
|
||||
case '9': LoA=BLS; Serial.println("BLS"); break;
|
||||
case 'l': if (Lo[LoA].Light) {Lo[LoA].Light=0;} else {Lo[LoA].Light=1;} Func(LoA,0,Lo[LoA].Light); Serial.println("Toggle Light"); break;
|
||||
case 'd': if (Lo[LoA].Dir) {Lo[LoA].Dir=0;} else {Lo[LoA].Dir=1;} Speed(LoA,0); Serial.println("Toggle Direction"); break;
|
||||
case 't': TurnVal=!TurnVal; Turn(TurnAdr,TurnVal); delay(250); Serial.print("TurnVal="); Serial.println(TurnVal); break;
|
||||
case 's': Serial.print("Power="); Serial.print(Power); Serial.print(" S="); Serial.print(S); Serial.print(" SM="); Serial.println(SM);
|
||||
Serial.print("Len="); Serial.print(B[0]); Serial.print(" CRC="); Serial.println(crc,HEX);
|
||||
for (a=1; a<=B[0]; a++) {Serial.print(" "); Serial.print(B[a]);} Serial.println();
|
||||
Serial.print("MM2= "); for (a=0; a<=18; a++) {Serial.print(Pa[a]); Serial.print(" ");} Serial.println();
|
||||
Serial.print("S88 "); for (a=1; a<=16; a++) {Serial.print(a); Serial.print("="); Serial.print(P[a]); Serial.print(" ");} Serial.println();
|
||||
break;
|
||||
case 13 : if (Power) {S=1; SM=1; digitalWrite(PowerPin,0); Power=0; digitalWrite(Red_Led,0); Serial.println("PowerOFF");} break;
|
||||
case 'h': Serial.println("Speed:0-7 Robel:8 BLS:9 l:Light d:Direction t:Turn s:Statistics"); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void T() {
|
||||
|
||||
N++; // Important !
|
||||
switch (SM) {
|
||||
|
||||
case 1 : break; // stay here
|
||||
|
||||
case 3 : switch (N) { // §2.2.9 "mindestens 2 Sync"
|
||||
case 1 : case 3 : case 4 : case 6 : case 8 : case 9 : C(); break;
|
||||
case 10 : NSync++; if (NSync>1) {N=0; SM=4;} else {N=0;} break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4 : if (N==125) {Ti=0; SM=5; // §2.2.9 Pause=6.25 ms --> 6250/50=125
|
||||
Timer3.start(104);} break; // Interrupt = 104 us
|
||||
|
||||
case 5 : // Send First Turn Packet
|
||||
if (Pa[Ti]) {C(); delayMicroseconds(85); C();} // HIGH : 85 --> Scope=91
|
||||
else {C(); delayMicroseconds(9); C();} // LOW : 9 13
|
||||
Ti++;
|
||||
if (Ti == 18) {N=0; SM=6;}
|
||||
break;
|
||||
|
||||
case 6 : if (N==15) {Ti=0; SM=7;} break; // §2.2.9 Pause=1.5 ms
|
||||
|
||||
case 7 : // Send Second Turn Packet
|
||||
if (Pa[Ti]) {C(); delayMicroseconds(85); C();}
|
||||
else {C(); delayMicroseconds(9); C();}
|
||||
Ti++;
|
||||
if (Ti == 18) {N=0; SM=8;
|
||||
Timer3.start(50);} // Interrupt = 50 us
|
||||
break;
|
||||
|
||||
case 8 : if (N==124) { // §2.2.9 Pause=6.18 ms --> 6180/50=124
|
||||
TuCmd=0;
|
||||
N=0; NSync=0; SM=10;}
|
||||
break;
|
||||
|
||||
|
||||
case 10 : switch (N) { // Synchro
|
||||
case 1 : C(); if (!Power && S!=0) {digitalWrite(PowerPin,1); Power=1; digitalWrite(Red_Led,1);} break;
|
||||
case 3 : case 4 : case 6 : case 8 : case 9 : C(); break;
|
||||
|
||||
case 10 : if (ToSend && NSync>3) {ToSend=0; NSync=0; StufN=0; F=1; I=1; Len=B[0]; SM=20;}
|
||||
else if (TuCmd) {N=0; NSync=0; SM=3;}
|
||||
else {N=0; NSync++;}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 20 : if (F) {C();} // Data stream with CRC
|
||||
else {
|
||||
if (B[I]) {C(); StufN++; if (StufN==8) {StufN=0; F=0; SM=30;}} // F=0; + F=!F; --> F=1
|
||||
else {StufN=0;}
|
||||
I++; Len--; if (Len==0) { SM=10; N=0; Busy=0;} // NEW
|
||||
}
|
||||
F=!F;
|
||||
break;
|
||||
|
||||
case 30 : if (F) {C();} // Send "0" after 8 "1"
|
||||
else {SM=20;}
|
||||
F=!F;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void C() {if (Le) {digitalWrite(Pin2_L293,0); digitalWrite(Pin7_L293,1);} else {digitalWrite(Pin2_L293,1); digitalWrite(Pin7_L293,0);} Le=!Le;} // Change Level
|
||||
|
||||
void CRC() { // avoid to compute in interrupt ! --> easier for bit stuffing !
|
||||
byte a,b;
|
||||
crc=0x007F;
|
||||
for (a=1; a<B[0]+1; a++) {bCRC(B[a]);} // CRC
|
||||
for (a=0; a<8; a++) {bCRC(0);} // Krauss p13 "diese bit müssen zuerst mit 0 belegt ..."}
|
||||
b=8; for (a=0; a<8; a++) {B[Len+1+a]=bitRead(crc,b-1); b--;}
|
||||
B[0]=B[0]+8; // Length
|
||||
}
|
||||
|
||||
void bCRC(bool b) { // Krauss p13
|
||||
crc = (crc << 1) + b;
|
||||
if ((crc & 0x0100) > 0) {crc = (crc & 0x00FF) ^ 0x07;}
|
||||
}
|
||||
|
||||
|
||||
void Turn(int dev, bool val) { // Device Value
|
||||
int p[10]; int a; int q[10];
|
||||
|
||||
if (dev > 0 && dev < 320) {
|
||||
p[0] = 1; p[1] = 2; p[2] = 1 * 4; p[3] = 3 * 4; p[4] = 3 * 3 * 4; p[5] = 3 * 3 * 3 * 4; p[6] = 3 * 3 * 3 * 3 * 4;
|
||||
dev += 3;
|
||||
for (a=6; a>=2; a--) {q[a]=0; if (dev>=p[a]) {q[a]++; dev=dev-p[a];} if (dev>=p[a]) {q[a]++; dev=dev-p[a];} switch (a) {case 2 : Tri(q[2],0); break; // MM2 Adr become HIGH adr
|
||||
case 3 : Tri(q[3],2); break;
|
||||
case 4 : Tri(q[4],4); break;
|
||||
case 5 : Tri(q[5],6); break;
|
||||
case 6 : Tri(q[6],8); break;
|
||||
}
|
||||
}
|
||||
for (a=1;a>=0;a--) {q[a]=0; if (dev>=p[a]) {q[a]++; dev=dev-p[a];} switch (a) {case 0 : Tri(q[0],12); break; // Factor 4 implemented with bit 12 - 15
|
||||
case 1 : Tri(q[1],14); break;
|
||||
}
|
||||
}
|
||||
Tri(val,10); // Value
|
||||
Tri(1,16); // always 1
|
||||
|
||||
TuCmd=1; // TURN CMD
|
||||
}
|
||||
}
|
||||
|
||||
void Tri(int v, int b) { // Value, Bit
|
||||
switch (v) {
|
||||
case 0 : Pa[b]=0; Pa[b+1]=0; break; // MC 145026 encoding
|
||||
case 1 : Pa[b]=1; Pa[b+1]=1; break;
|
||||
case 2 : Pa[b]=1; Pa[b+1]=0; break;
|
||||
}
|
||||
}
|
||||
|
||||
void S88() {
|
||||
const byte TIME = 10;
|
||||
int j, k;
|
||||
|
||||
j = 1;
|
||||
digitalWrite(LOAD, HIGH); delayMicroseconds(TIME); // from Railuino
|
||||
digitalWrite(CLOCK, HIGH); delayMicroseconds(TIME);
|
||||
digitalWrite(CLOCK, LOW); delayMicroseconds(TIME);
|
||||
digitalWrite(RESET, HIGH); delayMicroseconds(TIME);
|
||||
digitalWrite(RESET, LOW); delayMicroseconds(TIME);
|
||||
digitalWrite(LOAD, LOW); delayMicroseconds(TIME / 2);
|
||||
P[j] = digitalRead(DATA); j++; delayMicroseconds(TIME / 2);
|
||||
for (k = 1; k <= S88_Nb; k++) {
|
||||
digitalWrite(CLOCK, HIGH); delayMicroseconds(TIME);
|
||||
digitalWrite(CLOCK, LOW); delayMicroseconds(TIME / 2);
|
||||
P[j] = digitalRead(DATA); j++; delayMicroseconds(TIME / 2);
|
||||
}
|
||||
}
|
||||
BIN
DirectMM2.pdf
Normal file
BIN
ESP32-GATEWAY.pdf
Normal file
BIN
Franck/Frank1978_01.jpg
Normal file
|
After Width: | Height: | Size: 998 KiB |
BIN
Franck/Frank1979_01.jpg
Normal file
|
After Width: | Height: | Size: 934 KiB |
BIN
Franck/Frank_680_02.JPG
Normal file
|
After Width: | Height: | Size: 613 KiB |
BIN
Franck/Frank_680_03.JPG
Normal file
|
After Width: | Height: | Size: 455 KiB |
BIN
Franck/Frank_685_01.jpg
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
Franck/Frank_685_03.jpg
Normal file
|
After Width: | Height: | Size: 386 KiB |
BIN
Franck/Frank_875.pdf
Normal file
499
Franck/Radiocollection.be _ la marque FRANK.html
Normal file
@@ -0,0 +1,499 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||||
<html><head>
|
||||
<title>Radiocollection.be : la marque FRANK</title>
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=windows-1252">
|
||||
|
||||
|
||||
<meta name="GENERATOR" content="quanta 1.0 (Linux)">
|
||||
|
||||
|
||||
<meta name="AUTHOR" content="Thierry Magis">
|
||||
|
||||
|
||||
<meta name="CREATED" content="20191102;20591100">
|
||||
|
||||
|
||||
<meta name="CHANGEDBY" content="Thierry Magis">
|
||||
|
||||
|
||||
<meta name="CHANGED" content="20250413;17503700">
|
||||
|
||||
|
||||
<meta name="DESCRIPTION" content="Informations sur la marque FRANK">
|
||||
|
||||
|
||||
<meta name="KEYWORDS" content="radio, collection, FRANK, Belgique">
|
||||
|
||||
|
||||
<meta name="rating" content="General">
|
||||
|
||||
|
||||
<meta name="distribution" content="Global">
|
||||
|
||||
|
||||
<meta name="revisit-after" content="7 days">
|
||||
|
||||
|
||||
<meta http-equiv="Content-Language" content="fr">
|
||||
|
||||
|
||||
<meta name="COPYRIGHT" content="Copyright (c) 2019-2025 by radiocollection.be">
|
||||
|
||||
|
||||
<meta name="Location" content="Belgique">
|
||||
|
||||
|
||||
<meta name="contact" content="info@radiocollection.be">
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
TD P { color: #000000 }
|
||||
P { color: #000000 }
|
||||
A:visited { color: #800080 }
|
||||
A:link { color: #0000ff }
|
||||
-->
|
||||
</style>
|
||||
</head><body style="background-color: rgb(244, 255, 136);" link="#0000ff" vlink="#800080">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="100" bgcolor="#f4ffd0">
|
||||
<p align="center"><font color="#ff0000"><font face="Helvetica, Arial"><font size="5">Informations sur la marque FRANK</font></font></font></p>
|
||||
<p align="center"><a href="https://www.radiocollection.be/mult/important.html">Note
|
||||
importante au sujet des documents et images
|
||||
présentés ici ! </a></p>
|
||||
<hr>
|
||||
<p align="center">Quelques publicités et documents de la marque
|
||||
FRANK.</p>
|
||||
<p align="center">Cette entreprise, d'abord nommée <a href="https://www.radiocollection.be/fr/radiounion_fr.html">Radio Union</a>,
|
||||
est devenue Frank (du nom du fondateur, Maurice Frank) par la suite. <br>
|
||||
</p>
|
||||
<p align="center">Avec la marque Frank, la production a été axée
|
||||
sur la hi-fi et la
|
||||
sonorisation (tables de mixage, amplis de puissance...).<br>
|
||||
Nombre d'appareils de cette époque (tables de mixage et amplis) sont
|
||||
encore en circulation en Belgique et le plus souvent en excellent état.
|
||||
Ce matériel fut d'excellente qualité. </p>
|
||||
<p align="center">L'adresse était : 54, rue Nestor de Tière à
|
||||
Bruxelles (époque Radio-Union : 9, avenue Sleeckx, Bruxelles)</p>
|
||||
<p align="center">A noter que dans les années 70, l'entreprise
|
||||
collabora avec le constructeur d'éclairages <a href="https://www.radiocollection.be/fr/Ever1_fr.html">Ever</a>
|
||||
pour la réalisation de
|
||||
systèmes de son et lumières, et fut aussi distributeur (unique en 1979)
|
||||
des enceintes de
|
||||
sono <a href="https://www.radiocollection.be/fr/willaudio_fr.html">Will Audio</a>.<br>
|
||||
</p>
|
||||
<p align="center"> <img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_logo2.gif" alt="Logo Frank" border="0"></p>
|
||||
<p align="center">Quelques schémas Frank sur la page <a href="https://www.radiocollection.be/mult/schemas.html">schémas
|
||||
belges</a>, et quelques documents ci-dessous. Toute information sur ce
|
||||
constructeur est bienvenue !<br>
|
||||
</p>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/pub_frank05.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/pub_frank05_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Publicité de 1955, les débuts de la hi-fi sous la marque
|
||||
Frank.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/pub_frank08.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/pub_frank08_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Au salon de la radio / télévision 1958 : matériel hi-fi
|
||||
Frank (toujours mentionné dans le texte comme "Radio-Union").<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/pub_frank09.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/pub_frank09_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Sanon de la radio / télévision 1958 : la hi-fi Frank.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/frank_labo1.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/frank_labo1_low.jpg" alt="Ateliers Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Le laboratoire de la société Frank, en 1972.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/frank_labo2.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/frank_labo2_low.jpg" alt="Ateliers Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une autre vue du laboratoire de la société Frank, en
|
||||
1972.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/frank_labo3.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/frank_labo3_low.jpg" alt="Ateliers Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>L'assemblage des appareils, en 1972.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/frank_labo4.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/frank_labo4_low.jpg" alt="Ateliers Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Vue d'ensemble du laboratoire, en 1972.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/pub_frank06.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/pub_frank06_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une publicité de 1968.</p>
|
||||
<p>Appareils présentés : amplificateurs PRAM 220, PRAM 230
|
||||
et PRAM 240.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/pub_frank07.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/pub_frank07_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une publicité de 1968.</p>
|
||||
<p>Appareils présentés : tuner FM MK3 FET, tuner FM R1000,
|
||||
table de mixage Professional Mixer Monitor.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/pub_frank01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/pub_frank01_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une publicité de 1972 (page de gauche).</p>
|
||||
<p>Appareils présentés : Audiomixer 470, ampli PRAM215,
|
||||
mixer professionnel, Booster B200.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/pub_frank02.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/pub_frank02_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une publicité de 1972 (page de droite).</p>
|
||||
<p>Appareils présentés : ampli PRAM230, tuner FM MK5, mixer
|
||||
stéréo 670.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank1973_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank1973_01_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une publicité de 1973.</p>
|
||||
<p>Appareils présentés : ampli PRAM222, mixer
|
||||
stéréo 875.<br>
|
||||
Vendus en France par la société Film et Radio. </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank1978_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank1978_01_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une publicité de 1978 (Salon Intratel 1978 à Bruxelles).</p>
|
||||
<p>Appareils présentés : table de mixage type 875MK2, table
|
||||
de mixage type 580, table de mixage type 570.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank1979_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank1979_01_low.jpg" alt="Frank" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Une publicité de 1979 (Salon Intratel 1979 à Bruxelles).</p>
|
||||
<p>Appareils présentés : table de mixage type 875MK3, table
|
||||
de mixage type 680, table de mixage type 575, table de mixage type 780,
|
||||
ampli booster type B1200.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_235.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_235_low.jpg" alt="Frank 235" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Amplificateurs types 235 et 245. Catalogue de 1980. </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_260_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_260_01_low.jpg" alt="Frank 260" border="0"></a><br><br>
|
||||
</p>
|
||||
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Amplificateur type 260. Catalogue de 1980. </p>
|
||||
<p>Autres photos : <a href="https://www.radiocollection.be/images/frank_img/Frank_260_02.jpg" target="blank">Détails
|
||||
face avant</a>, <a href="https://www.radiocollection.be/images/frank_img/Frank_260_03.jpg" target="blank">Arrière de
|
||||
l'appareil</a>, <a href="https://www.radiocollection.be/images/frank_img/Frank_260_04.jpg" target="blank">Intérieur de l'appareil</a><br>
|
||||
Merci à Joël Deshaires pour les photos !
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_470.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_470_low.jpg" alt="Frank 470" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 470. Catalogue de 1980. </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_670.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_670_low.jpg" alt="Frank 670" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage + préampli type 670. Catalogue de 1980. </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_680_01.JPG" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_680_01_low.JPG" alt="Frank 680" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 680. Année inconnue (probablement
|
||||
1982, voir
|
||||
photo de l'intérieur avec le N° de série). L'appareil de la photo
|
||||
ci-contre a subi des modifications : ajout des 4 interrupteurs et du
|
||||
connecteur XLR sur la face avant.<br>
|
||||
</p>
|
||||
<p>Photos : <a href="https://www.radiocollection.be/images/frank_img/Frank_680_02.JPG" target="blank">intérieur</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_680_03.JPG" target="blank">arrière</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_682_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_682_01_low.jpg" alt="Frank 682" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 682. Prix en 1982 : 20.000BEF
|
||||
(500€) <br>
|
||||
Page de <a href="https://www.radiocollection.be/images/frank_img/Frank_682_02.jpg" target="blank">présentation
|
||||
commerciale</a> de
|
||||
cet appareil.<br>
|
||||
</p>
|
||||
<p>Documentations : <a href="https://www.radiocollection.be/images/frank_img/Frank_682.pdf" target="blank">Schémas</a>
|
||||
(merci à Philippe Bastin). <br>
|
||||
</p>
|
||||
<p>Photos (merci à Mario Secci) : <a href="https://www.radiocollection.be/images/frank_img/Frank_682_03.jpg" target="blank">1</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_682_04.jpg" target="blank">2</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_682_05.jpg" target="blank">3</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_682_06.jpg" target="blank">4</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_682_07.jpg" target="blank">5</a> </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_685_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_685_01_low.jpg" alt="Frank 685" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 685. Prix en 1982 : 30.000BEF
|
||||
(750€) </p>
|
||||
<p>Pages de <a href="https://www.radiocollection.be/images/frank_img/Frank_685_02.jpg" target="blank">présentation
|
||||
commerciale</a> et <a href="https://www.radiocollection.be/images/frank_img/Frank_685_03.jpg" target="blank">spécifications techniques</a> (+ module d'extension) de
|
||||
cet appareil.</p>
|
||||
<p>Photos (merci à Mario Secci) : <a href="https://www.radiocollection.be/images/frank_img/Frank_685_04.jpg" target="blank">1</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_685_05.jpg" target="blank">2</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_685_06.jpg" target="blank">3</a> - <a href="https://www.radiocollection.be/images/frank_img/Frank_685_07.jpg" target="blank">4</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_875.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_875_low.jpg" alt="Frank 875" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 875. Prix en 1981 : 31.590BEF
|
||||
(TVAC, 800€) </p>
|
||||
<p>Pages de <a href="https://www.radiocollection.be/images/frank_img/Frank_875.pdf" target="blank">documentation
|
||||
technique</a> (avec caractéristiques) de
|
||||
cet appareil.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_875_02.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_875_02_low.jpg" alt="Frank 875" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 875, catalogue Frank vers 1980.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_885_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_885_01_low.jpg" alt="Frank 885" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 885. Prix en 1982 : 38.500BEF
|
||||
(960€) </p>
|
||||
<p>Pages de <a href="https://www.radiocollection.be/images/frank_img/Frank_885_02.jpg" target="blank">présentation
|
||||
commerciale</a> et <a href="https://www.radiocollection.be/images/frank_img/Frank_885_03.jpg" target="blank">spécifications techniques</a> (+ module d'extension) de
|
||||
cet appareil.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_1080_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_1080_01_low.jpg" alt="Frank 1080" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Table de mixage type 1080. Prix en 1982 : 75.000BEF
|
||||
(1.875€) </p>
|
||||
<p>Pages du dépliant de cet appareil : <a href="https://www.radiocollection.be/images/frank_img/Frank_1080_02.jpg" target="blank">première
|
||||
page</a>, <a href="https://www.radiocollection.be/images/frank_img/Frank_1080_03.jpg" target="blank">généralités</a>, <a href="https://www.radiocollection.be/images/frank_img/Frank_1080_04.jpg" target="blank">page 1
|
||||
caractéristiques</a>, <a href="https://www.radiocollection.be/images/frank_img/Frank_1080_05.jpg" target="blank">page 2 caractéristiques et bloc alimentation</a><br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_B100_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_B100_01_low.jpg" alt="Frank B100" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Ampli de puissance B100, catalogue de 1980.</p>
|
||||
<p> </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_B200.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_B200_low.jpg" alt="Frank B200" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Ampli de puissance B200, catalogue de 1980.</p>
|
||||
<p> </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_B250_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_B250_01_low.jpg" alt="Frank B250" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Amplificateur de sono type B250. Page de <a href="https://www.radiocollection.be/images/frank_img/Frank_B250_02.jpg" target="blank">présentation
|
||||
commerciale</a> de
|
||||
cet appareil.<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_B500_01.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_B500_01_low.jpg" alt="Frank B500" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Ampli de puissance B500. <a href="https://www.radiocollection.be/images/frank_img/Frank_B500_presentation.pdf" target="blank">Caractéristiques</a>
|
||||
(présentation commerciale, en pdf)</p>
|
||||
<p>Autres photos : <a href="https://www.radiocollection.be/images/frank_img/Frank_B500_02.jpg" target="blank">Détails
|
||||
face avant</a>, <a href="https://www.radiocollection.be/images/frank_img/Frank_B500_03.jpg" target="blank">Arrière de
|
||||
l'appareil</a>, <a href="https://www.radiocollection.be/images/frank_img/Frank_B500_04.jpg" target="blank">Intérieur de l'appareil</a><br>
|
||||
</p>
|
||||
<p><a href="https://www.radiocollection.be/images/frank_img/Frank_B500_schema.pdf" target="blank">Schémas</a> (en pdf). Merci à Didier Dablemont pour ces
|
||||
documents !</p>
|
||||
<p> </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#f4ffd0" width="33%">
|
||||
<p align="center"><a href="https://www.radiocollection.be/images/frank_img/Frank_MK5.jpg" target="blank"><img src="Radiocollection.be%20_%20la%20marque%20FRANK_fichiers/Frank_MK5_low.jpg" alt="Frank MK5" border="0"></a><br>
|
||||
<br>
|
||||
</p>
|
||||
</td>
|
||||
<td bgcolor="#f4ffd0" width="67%">
|
||||
<p>Tuner MK5, catalogue de 1980.</p>
|
||||
<p> </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<p>© Radiocollection.be, Thierry Magis 2019-2025</p>
|
||||
<p align="center"><a href="https://www.radiocollection.be/fr/radiounion_fr.html">Les débuts sous la
|
||||
marque Radio Union</a> </p>
|
||||
<p align="center"><a href="https://www.radiocollection.be/fr/constructeurs_fr.html">Retour
|
||||
page fabricants belges</a></p>
|
||||
<p align="center"><a href="https://www.radiocollection.be/fr/pub_fr.html#BACK_PUB_FR">Retour page
|
||||
publicités</a></p>
|
||||
<p align="center"><a href="https://www.radiocollection.be/fr/fr.htm" target="_top">Retour page
|
||||
accueil</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</body></html>
|
||||
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 23 KiB |
BIN
JQ8400_English.pdf
Normal file
BIN
MAX98357A_datasheet.pdf
Normal file
BIN
MCP2515-Stand-Alone-CAN-Controller-with-SPI-20001801J.pdf
Normal file
BIN
MDD-Microdiode-Semiconductor-SS24_C50645.pdf
Normal file
BIN
ME3116_E3.0.pdf
Normal file
BIN
MOSFET_XIN-FEI-HONG-FH8904G6_C2929014.pdf
Normal file
BIN
Occupancy/Occupancy-backups/Occupancy-2026-02-10_102331.zip
Normal file
2
Occupancy/Occupancy.kicad_pcb
Normal file
@@ -0,0 +1,2 @@
|
||||
(kicad_pcb (version 20241229) (generator "pcbnew") (generator_version "9.0")
|
||||
)
|
||||
98
Occupancy/Occupancy.kicad_prl
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"board": {
|
||||
"active_layer": 0,
|
||||
"active_layer_preset": "",
|
||||
"auto_track_width": true,
|
||||
"hidden_netclasses": [],
|
||||
"hidden_nets": [],
|
||||
"high_contrast_mode": 0,
|
||||
"net_color_mode": 1,
|
||||
"opacity": {
|
||||
"images": 0.6,
|
||||
"pads": 1.0,
|
||||
"shapes": 1.0,
|
||||
"tracks": 1.0,
|
||||
"vias": 1.0,
|
||||
"zones": 0.6
|
||||
},
|
||||
"selection_filter": {
|
||||
"dimensions": true,
|
||||
"footprints": true,
|
||||
"graphics": true,
|
||||
"keepouts": true,
|
||||
"lockedItems": false,
|
||||
"otherItems": true,
|
||||
"pads": true,
|
||||
"text": true,
|
||||
"tracks": true,
|
||||
"vias": true,
|
||||
"zones": true
|
||||
},
|
||||
"visible_items": [
|
||||
"vias",
|
||||
"footprint_text",
|
||||
"footprint_anchors",
|
||||
"ratsnest",
|
||||
"grid",
|
||||
"footprints_front",
|
||||
"footprints_back",
|
||||
"footprint_values",
|
||||
"footprint_references",
|
||||
"tracks",
|
||||
"drc_errors",
|
||||
"drawing_sheet",
|
||||
"bitmaps",
|
||||
"pads",
|
||||
"zones",
|
||||
"drc_warnings",
|
||||
"drc_exclusions",
|
||||
"locked_item_shadows",
|
||||
"conflict_shadows",
|
||||
"shapes"
|
||||
],
|
||||
"visible_layers": "ffffffff_ffffffff_ffffffff_ffffffff",
|
||||
"zone_display_mode": 0
|
||||
},
|
||||
"git": {
|
||||
"repo_type": "",
|
||||
"repo_username": "",
|
||||
"ssh_key": ""
|
||||
},
|
||||
"meta": {
|
||||
"filename": "Occupancy.kicad_prl",
|
||||
"version": 5
|
||||
},
|
||||
"net_inspector_panel": {
|
||||
"col_hidden": [],
|
||||
"col_order": [],
|
||||
"col_widths": [],
|
||||
"custom_group_rules": [],
|
||||
"expanded_rows": [],
|
||||
"filter_by_net_name": true,
|
||||
"filter_by_netclass": true,
|
||||
"filter_text": "",
|
||||
"group_by_constraint": false,
|
||||
"group_by_netclass": false,
|
||||
"show_unconnected_nets": false,
|
||||
"show_zero_pad_nets": false,
|
||||
"sort_ascending": true,
|
||||
"sorting_column": -1
|
||||
},
|
||||
"open_jobsets": [],
|
||||
"project": {
|
||||
"files": []
|
||||
},
|
||||
"schematic": {
|
||||
"selection_filter": {
|
||||
"graphics": true,
|
||||
"images": true,
|
||||
"labels": true,
|
||||
"lockedItems": false,
|
||||
"otherItems": true,
|
||||
"pins": true,
|
||||
"symbols": true,
|
||||
"text": true,
|
||||
"wires": true
|
||||
}
|
||||
}
|
||||
}
|
||||
417
Occupancy/Occupancy.kicad_pro
Normal file
@@ -0,0 +1,417 @@
|
||||
{
|
||||
"board": {
|
||||
"3dviewports": [],
|
||||
"design_settings": {
|
||||
"defaults": {},
|
||||
"diff_pair_dimensions": [],
|
||||
"drc_exclusions": [],
|
||||
"rules": {},
|
||||
"track_widths": [],
|
||||
"via_dimensions": []
|
||||
},
|
||||
"ipc2581": {
|
||||
"dist": "",
|
||||
"distpn": "",
|
||||
"internal_id": "",
|
||||
"mfg": "",
|
||||
"mpn": ""
|
||||
},
|
||||
"layer_pairs": [],
|
||||
"layer_presets": [],
|
||||
"viewports": []
|
||||
},
|
||||
"boards": [],
|
||||
"cvpcb": {
|
||||
"equivalence_files": []
|
||||
},
|
||||
"erc": {
|
||||
"erc_exclusions": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"pin_map": [
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
]
|
||||
],
|
||||
"rule_severities": {
|
||||
"bus_definition_conflict": "error",
|
||||
"bus_entry_needed": "error",
|
||||
"bus_to_bus_conflict": "error",
|
||||
"bus_to_net_conflict": "error",
|
||||
"different_unit_footprint": "error",
|
||||
"different_unit_net": "error",
|
||||
"duplicate_reference": "error",
|
||||
"duplicate_sheet_names": "error",
|
||||
"endpoint_off_grid": "warning",
|
||||
"extra_units": "error",
|
||||
"footprint_filter": "ignore",
|
||||
"footprint_link_issues": "warning",
|
||||
"four_way_junction": "ignore",
|
||||
"global_label_dangling": "warning",
|
||||
"hier_label_mismatch": "error",
|
||||
"label_dangling": "error",
|
||||
"label_multiple_wires": "warning",
|
||||
"lib_symbol_issues": "warning",
|
||||
"lib_symbol_mismatch": "warning",
|
||||
"missing_bidi_pin": "warning",
|
||||
"missing_input_pin": "warning",
|
||||
"missing_power_pin": "error",
|
||||
"missing_unit": "warning",
|
||||
"multiple_net_names": "warning",
|
||||
"net_not_bus_member": "warning",
|
||||
"no_connect_connected": "warning",
|
||||
"no_connect_dangling": "warning",
|
||||
"pin_not_connected": "error",
|
||||
"pin_not_driven": "error",
|
||||
"pin_to_pin": "warning",
|
||||
"power_pin_not_driven": "error",
|
||||
"same_local_global_label": "warning",
|
||||
"similar_label_and_power": "warning",
|
||||
"similar_labels": "warning",
|
||||
"similar_power": "warning",
|
||||
"simulation_model_issue": "ignore",
|
||||
"single_global_label": "ignore",
|
||||
"unannotated": "error",
|
||||
"unconnected_wire_endpoint": "warning",
|
||||
"unit_value_mismatch": "error",
|
||||
"unresolved_variable": "error",
|
||||
"wire_dangling": "error"
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"pinned_footprint_libs": [],
|
||||
"pinned_symbol_libs": []
|
||||
},
|
||||
"meta": {
|
||||
"filename": "Occupancy.kicad_pro",
|
||||
"version": 3
|
||||
},
|
||||
"net_settings": {
|
||||
"classes": [
|
||||
{
|
||||
"bus_width": 12,
|
||||
"clearance": 0.2,
|
||||
"diff_pair_gap": 0.25,
|
||||
"diff_pair_via_gap": 0.25,
|
||||
"diff_pair_width": 0.2,
|
||||
"line_style": 0,
|
||||
"microvia_diameter": 0.3,
|
||||
"microvia_drill": 0.1,
|
||||
"name": "Default",
|
||||
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||
"priority": 2147483647,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.2,
|
||||
"via_diameter": 0.6,
|
||||
"via_drill": 0.3,
|
||||
"wire_width": 6
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 4
|
||||
},
|
||||
"net_colors": null,
|
||||
"netclass_assignments": null,
|
||||
"netclass_patterns": []
|
||||
},
|
||||
"pcbnew": {
|
||||
"last_paths": {
|
||||
"gencad": "",
|
||||
"idf": "",
|
||||
"netlist": "",
|
||||
"plot": "",
|
||||
"pos_files": "",
|
||||
"specctra_dsn": "",
|
||||
"step": "",
|
||||
"svg": "",
|
||||
"vrml": ""
|
||||
},
|
||||
"page_layout_descr_file": ""
|
||||
},
|
||||
"schematic": {
|
||||
"annotate_start_num": 0,
|
||||
"bom_export_filename": "${PROJECTNAME}.csv",
|
||||
"bom_fmt_presets": [],
|
||||
"bom_fmt_settings": {
|
||||
"field_delimiter": ",",
|
||||
"keep_line_breaks": false,
|
||||
"keep_tabs": false,
|
||||
"name": "CSV",
|
||||
"ref_delimiter": ",",
|
||||
"ref_range_delimiter": "",
|
||||
"string_delimiter": "\""
|
||||
},
|
||||
"bom_presets": [],
|
||||
"bom_settings": {
|
||||
"exclude_dnp": false,
|
||||
"fields_ordered": [
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Reference",
|
||||
"name": "Reference",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Qty",
|
||||
"name": "${QUANTITY}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Value",
|
||||
"name": "Value",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "DNP",
|
||||
"name": "${DNP}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Exclude from BOM",
|
||||
"name": "${EXCLUDE_FROM_BOM}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Exclude from Board",
|
||||
"name": "${EXCLUDE_FROM_BOARD}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Footprint",
|
||||
"name": "Footprint",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Datasheet",
|
||||
"name": "Datasheet",
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"filter_string": "",
|
||||
"group_symbols": true,
|
||||
"include_excluded_from_bom": true,
|
||||
"name": "Default Editing",
|
||||
"sort_asc": true,
|
||||
"sort_field": "Reference"
|
||||
},
|
||||
"connection_grid_size": 50.0,
|
||||
"drawing": {
|
||||
"dashed_lines_dash_length_ratio": 12.0,
|
||||
"dashed_lines_gap_length_ratio": 3.0,
|
||||
"default_line_thickness": 6.0,
|
||||
"default_text_size": 50.0,
|
||||
"field_names": [],
|
||||
"intersheets_ref_own_page": false,
|
||||
"intersheets_ref_prefix": "",
|
||||
"intersheets_ref_short": false,
|
||||
"intersheets_ref_show": false,
|
||||
"intersheets_ref_suffix": "",
|
||||
"junction_size_choice": 3,
|
||||
"label_size_ratio": 0.375,
|
||||
"operating_point_overlay_i_precision": 3,
|
||||
"operating_point_overlay_i_range": "~A",
|
||||
"operating_point_overlay_v_precision": 3,
|
||||
"operating_point_overlay_v_range": "~V",
|
||||
"overbar_offset_ratio": 1.23,
|
||||
"pin_symbol_size": 25.0,
|
||||
"text_offset_ratio": 0.15
|
||||
},
|
||||
"legacy_lib_dir": "",
|
||||
"legacy_lib_list": [],
|
||||
"meta": {
|
||||
"version": 1
|
||||
},
|
||||
"net_format_name": "",
|
||||
"page_layout_descr_file": "",
|
||||
"plot_directory": "",
|
||||
"space_save_all_events": true,
|
||||
"spice_current_sheet_as_root": false,
|
||||
"spice_external_command": "spice \"%I\"",
|
||||
"spice_model_current_sheet_as_root": true,
|
||||
"spice_save_all_currents": false,
|
||||
"spice_save_all_dissipations": false,
|
||||
"spice_save_all_voltages": false,
|
||||
"subpart_first_id": 65,
|
||||
"subpart_id_separator": 0
|
||||
},
|
||||
"sheets": [
|
||||
[
|
||||
"61ed72e9-2d78-4b50-a4b1-eb9c01465d14",
|
||||
"Root"
|
||||
]
|
||||
],
|
||||
"text_variables": {}
|
||||
}
|
||||
2173
Occupancy/Occupancy.kicad_sch
Normal file
BIN
Plans-et-decors-de-reseaux_Jouef_HO_Telecommande.pdf
Normal file
BIN
RS485_SIT-SIT3088ETK_C601076.pdf
Normal file
BIN
Railcom.pdf
Normal file
BIN
Railuino/.DS_Store
vendored
Normal file
2
Railuino/.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
5
Railuino/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.pio
|
||||
.vscode/.browse.c_cpp.db*
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
||||
10
Railuino/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
||||
140
Railuino/README.md
Normal file
@@ -0,0 +1,140 @@
|
||||
# Railuino
|
||||
Rewrite of version 0.9.0 of Joerg Pleumann's Railuino library
|
||||
|
||||
https://youtu.be/x5fVPsChlIA
|
||||
|
||||
Version 0.9.1 de la bibliothèque Railuino de Joerg Pleumann dont le dépôt git se trouve à cet emplacement : https://code.google.com/archive/p/railuino/
|
||||
|
||||
Cette bibliothèque est sous licence GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 2012 Joerg Pleumann
|
||||
|
||||
Cette version 9.0.1 est une réécriture profonde à partir de la version 0.9.0, dernière version publiée à ma connaissance.
|
||||
|
||||
Dans sa version 0.9.0, cette bibliothèque est très bien écrite mais elle est ancienne (2013, c’est beaucoup en programmation), elle n’est pas adaptée aux nouveaux microcontrôleurs comme l’ESP32, comporte quelques manques (comme la reconnaissance automatique en MFX) et doit être optimisée par rapport aux normes C++ 11 et suivantes. Je suis actuellement en train de réécrire certaines parties de cette bibliothèque que je teste au fur et à mesure.
|
||||
|
||||
Je ne m’intéresse actuellement qu’à la version ESP32. Je publie mon travail sur ce git à chaque évolution majeure.
|
||||
|
||||
Les exemples originaux pour la mise en œuvre et les tests de cette bibliothèque sont encore d’actualité mais doivent aussi être adaptés.
|
||||
|
||||
Vous trouverez dans le dossier « exemples » les fichiers mis à jour qui portent les noms originaux auxquels j’ai ajouté « _new ».
|
||||
|
||||
Les fichiers originaux sont conservés à titre de mémoire et de comparaison.
|
||||
|
||||
*****************************************************************************************************
|
||||
|
||||
Version 0.9.1 of Joerg Pleumann's Railuino library, the git repository for which can be found at: https://code.google.com/archive/p/railuino/
|
||||
|
||||
This library is licensed under the GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 2012 Joerg Pleumann
|
||||
|
||||
This version 9.0.1 is a thorough rewrite of version 0.9.0, the last version published to my knowledge.
|
||||
|
||||
In its version 0.9.0, this library is very well written but it is old (2013 is a long time in programming), it is not adapted to new microcontrollers such as the ESP32, has a few shortcomings (such as automatic recognition in MFX) and needs to be optimised in relation to the C++ 11 and later standards. I'm currently rewriting parts of this library and testing them as I go along.
|
||||
|
||||
I'm currently only interested in the ESP32 version. I publish my work on this git whenever there is a major change.
|
||||
|
||||
The original examples for implementing and testing this library are still relevant, but they also need to be adapted.
|
||||
|
||||
You'll find the updated files in the "examples" folder, which have the original names to which I've added "_new".
|
||||
|
||||
The original files are kept for memory and comparison.
|
||||
|
||||
|
||||
|
||||
|
||||
TrackController Class Documentation
|
||||
Overview
|
||||
|
||||
The TrackController class abstracts the communication with Märklin model train components using a CAN bus interface. It provides high-level methods for controlling locomotives, turnouts, and accessories, while managing low-level message handling internally. This documentation summarizes the class's functionality and usage patterns for interfacing with model train systems.
|
||||
|
||||
Dependencies
|
||||
Arduino.h: Arduino standard library.
|
||||
TrackMessage.h: Header for defining CAN message structure.
|
||||
Config.h: Configuration file (not provided) for specific settings.
|
||||
|
||||
Constructors
|
||||
TrackController();
|
||||
Default constructor initializes the controller with default settings.
|
||||
TrackController(uint16_t hash, bool debug);
|
||||
Constructor with parameters to initialize the controller with a specific hash and debug mode.
|
||||
Destructor
|
||||
~TrackController();
|
||||
Cleans up resources when the object is destroyed.
|
||||
|
||||
Public Methods
|
||||
Initialization and Configuration
|
||||
void init(uint16_t hash, bool debug, bool loopback);
|
||||
|
||||
Initializes the controller with a specified hash, debug mode, and loopback mode.
|
||||
void begin();
|
||||
|
||||
Initializes the CAN hardware and starts message reception.
|
||||
void end();
|
||||
|
||||
Stops message reception and clears the internal message buffer.
|
||||
void generateHash();
|
||||
|
||||
Generates a unique hash for the controller to avoid conflicts on the CAN bus.
|
||||
Power and Control
|
||||
bool setPower(bool power);
|
||||
|
||||
Controls the power state of the track. Stops all locomotives when power is false.
|
||||
bool setLocoDirection(uint16_t address, uint8_t direction);
|
||||
|
||||
Sets the direction of a locomotive identified by address.
|
||||
bool toggleLocoDirection(uint16_t address);
|
||||
|
||||
Toggles the direction of a locomotive identified by address.
|
||||
bool setLocoSpeed(uint16_t address, uint16_t speed);
|
||||
|
||||
Sets the speed of a locomotive identified by address.
|
||||
bool setLocoFunction(uint16_t address, uint8_t function, uint8_t power);
|
||||
|
||||
Sets a specific function (e.g., lights) of a locomotive.
|
||||
bool toggleLocoFunction(uint16_t address, uint8_t function);
|
||||
|
||||
Toggles a function (on/off) of a locomotive.
|
||||
bool setAccessory(uint16_t address, uint8_t position, uint8_t power, uint16_t time);
|
||||
|
||||
Controls a magnetic accessory (e.g., turnout).
|
||||
bool setTurnout(uint16_t address, bool straight);
|
||||
|
||||
Controls a turnout to be straight or curved.
|
||||
Query Methods
|
||||
bool getLocoDirection(uint16_t address, uint8_t *direction);
|
||||
|
||||
Queries the direction of a locomotive identified by address.
|
||||
bool getLocoSpeed(uint16_t address, uint16_t *speed);
|
||||
|
||||
Queries the speed of a locomotive identified by address.
|
||||
bool getLocoFunction(uint16_t address, uint8_t function, uint8_t *power);
|
||||
|
||||
Queries the status of a specific function of a locomotive.
|
||||
bool getAccessory(uint16_t address, uint8_t *position, uint8_t *power);
|
||||
|
||||
Queries the state of a magnetic accessory.
|
||||
Configuration Methods
|
||||
bool writeConfig(uint16_t address, uint16_t number, uint8_t value);
|
||||
|
||||
Writes a configuration value to a locomotive.
|
||||
bool readConfig(uint16_t address, uint16_t number, uint8_t *value);
|
||||
|
||||
Reads a configuration value from a locomotive.
|
||||
Utility Methods
|
||||
bool exchangeMessage(TrackMessage &out, TrackMessage &in, uint16_t timeout);
|
||||
|
||||
Sends a message and waits for a response within the specified timeout.
|
||||
bool getVersion(uint8_t *high, uint8_t *low);
|
||||
|
||||
Queries the software version of the track format processor.
|
||||
|
||||
Member Variables
|
||||
uint16_t mHash: Hash of the controller instance.
|
||||
bool mDebug: Debug mode flag.
|
||||
bool mLoopback: Loopback mode flag.
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
Railuino/data/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Railuino/data/image1.jpg
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
Railuino/data/image2.jpg
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Railuino/data/image3.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
Railuino/data/image4.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
48
Railuino/data/index.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Track Controller</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Track Controller</h1>
|
||||
<div id="logWindow" class="log-window"></div>
|
||||
<div class="image-buttons">
|
||||
<img src="image1.jpg" class="address-button" data-address="16391">
|
||||
<img src="image2.jpg" class="address-button" data-address="11000">
|
||||
<img src="image3.jpg" class="address-button" data-address="12000">
|
||||
<img src="image4.jpg" class="address-button" data-address="13000">
|
||||
</div>
|
||||
<button id="powerButton" class="toggle-button">Power</button>
|
||||
<button id="stopButton" class="normal-button">Stop</button>
|
||||
<button id="systemHaltButton" class="normal-button">System Halt</button>
|
||||
<button id="directionButton" class="toggle-button"><< / >></button>
|
||||
<div class="slider-container">
|
||||
<span class="slider-label" id="slider-min">0</span>
|
||||
<input type="range" id="speedSlider" min="0" max="1000" value="0">
|
||||
<span class="slider-label" id="slider-max">1000</span>
|
||||
</div>
|
||||
<div class="speed-percentage">
|
||||
Speed: <span id="speedValue">0</span>%
|
||||
</div>
|
||||
<div class="function-buttons">
|
||||
<button class="function-button" data-function="0">F0</button>
|
||||
<button class="function-button" data-function="1">F1</button>
|
||||
<button class="function-button" data-function="2">F2</button>
|
||||
<button class="function-button" data-function="3">F3</button>
|
||||
<button class="function-button" data-function="4">F4</button>
|
||||
</div>
|
||||
<div class="function-buttons">
|
||||
<button class="function-button" data-function="5">F5</button>
|
||||
<button class="function-button" data-function="6">F6</button>
|
||||
<button class="function-button" data-function="7">F7</button>
|
||||
<button class="function-button" data-function="8">F8</button>
|
||||
<button class="function-button" data-function="9">F9</button>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
180
Railuino/data/script.js
Normal file
@@ -0,0 +1,180 @@
|
||||
let isPowerOn = false;
|
||||
const locos = {};
|
||||
let selectedLoco = null;
|
||||
|
||||
// Classe Loco
|
||||
class Loco {
|
||||
constructor(address) {
|
||||
this.address = address;
|
||||
this.speed = 0;
|
||||
this.direction = 0;
|
||||
this.functions = Array(10).fill(false);
|
||||
}
|
||||
|
||||
setSpeed(speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
setDirection(direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
setFunction(index, state) {
|
||||
this.functions[index] = state;
|
||||
}
|
||||
}
|
||||
|
||||
// Créer des instances de Loco pour chaque bouton image
|
||||
document.querySelectorAll('.address-button').forEach(button => {
|
||||
const address = button.getAttribute('data-address');
|
||||
locos[address] = new Loco(address);
|
||||
});
|
||||
|
||||
// Fonction pour mettre à jour l'affichage avec les valeurs de la locomotive sélectionnée
|
||||
function updateUI() {
|
||||
if (selectedLoco) {
|
||||
document.getElementById('speedSlider').value = selectedLoco.speed;
|
||||
updateSpeedValue(selectedLoco.speed);
|
||||
document.querySelectorAll('.function-button').forEach((button, index) => {
|
||||
if (selectedLoco.functions[index]) {
|
||||
button.classList.add('active');
|
||||
} else {
|
||||
button.classList.remove('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Fonction pour ajouter un message au log
|
||||
// function addLogMessage(message) {
|
||||
// const logWindow = document.getElementById('logWindow');
|
||||
// const newMessage = document.createElement('div');
|
||||
// newMessage.textContent = message;
|
||||
// logWindow.appendChild(newMessage);
|
||||
// logWindow.scrollTop = logWindow.scrollHeight;
|
||||
// }
|
||||
|
||||
function addLogMessage(message) {
|
||||
const logWindow = document.getElementById('logWindow');
|
||||
logWindow.textContent = message; // Remplace le contenu du log par le nouveau message
|
||||
}
|
||||
|
||||
// Gestionnaire d'événement pour le bouton d'alimentation
|
||||
document.getElementById('powerButton').addEventListener('click', () => {
|
||||
fetch('/setPower', { method: 'POST' })
|
||||
.then(response => response.text())
|
||||
.then(state => {
|
||||
isPowerOn = state === 'true';
|
||||
const powerButton = document.getElementById('powerButton');
|
||||
if (isPowerOn == true) {
|
||||
powerButton.classList.remove('power-off');
|
||||
powerButton.classList.add('power-on');
|
||||
addLogMessage('Power ON');
|
||||
} else if (isPowerOn == false) {
|
||||
powerButton.classList.remove('power-on');
|
||||
powerButton.classList.add('power-off');
|
||||
addLogMessage('Power OFF');
|
||||
} else {
|
||||
addLogMessage('Error for power function');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById('systemHaltButton').addEventListener('click', () => {
|
||||
if (selectedLoco) {
|
||||
fetch(`/setSystemHalt?address=0x0000`, { method: 'POST' })
|
||||
.then(() => {
|
||||
document.getElementById('speedSlider').value = 0;
|
||||
updateSpeedValue(0);
|
||||
selectedLoco.setSpeed(0);
|
||||
addLogMessage(`System Halt`);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('stopButton').addEventListener('click', () => {
|
||||
if (selectedLoco) {
|
||||
fetch(`/setStop?address=${selectedLoco.address}`, { method: 'POST' })
|
||||
.then(() => {
|
||||
document.getElementById('speedSlider').value = 0;
|
||||
updateSpeedValue(0);
|
||||
selectedLoco.setSpeed(0);
|
||||
addLogMessage(`Stop for address ${selectedLoco.address}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('directionButton').addEventListener('click', () => {
|
||||
if (selectedLoco) {
|
||||
selectedLoco.direction = 1 - selectedLoco.direction; // Change de direction
|
||||
fetch(`/setDirection?address=${selectedLoco.address}`, { method: 'POST' })
|
||||
.then(() => {
|
||||
document.getElementById('speedSlider').value = 0;
|
||||
updateSpeedValue(0);
|
||||
addLogMessage(`Direction change for address ${selectedLoco.address}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('speedSlider').addEventListener('input', (event) => {
|
||||
if (!isPowerOn) {
|
||||
addLogMessage('Power is off');
|
||||
event.target.value = 0; // Réinitialiser le curseur à 0
|
||||
updateSpeedValue(0);
|
||||
return;
|
||||
}
|
||||
if (!selectedLoco) {
|
||||
addLogMessage('Select a locomotive');
|
||||
event.target.value = 0; // Réinitialiser le curseur à 0
|
||||
updateSpeedValue(0);
|
||||
return;
|
||||
}
|
||||
const speed = event.target.value;
|
||||
fetch(`/setSpeed?address=${selectedLoco.address}&speed=${speed}`, { method: 'POST' });
|
||||
selectedLoco.setSpeed(speed);
|
||||
updateSpeedValue(speed);
|
||||
addLogMessage(`Speed set to ${speed} for address ${selectedLoco.address}`);
|
||||
});
|
||||
|
||||
document.querySelectorAll('.address-button').forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
// Supprimer la classe 'selected' de tous les boutons
|
||||
document.querySelectorAll('.address-button').forEach(btn => btn.classList.remove('selected'));
|
||||
// Ajouter la classe 'selected' au bouton cliqué
|
||||
button.classList.add('selected');
|
||||
// Mettre à jour la locomotive sélectionnée
|
||||
const address = button.getAttribute('data-address');
|
||||
selectedLoco = locos[address];
|
||||
// Envoyer l'adresse au serveur
|
||||
fetch(`/setAddress?address=${address}`, { method: 'POST' });
|
||||
// Mettre à jour l'interface utilisateur avec les valeurs de la locomotive sélectionnée
|
||||
updateUI();
|
||||
addLogMessage(`Locomotive selected with address ${address}`);
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.function-button').forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
if (selectedLoco) {
|
||||
const functionId = button.getAttribute('data-function');
|
||||
const newState = !selectedLoco.functions[functionId];
|
||||
fetch(`/setFunction?address=${selectedLoco.address}&function=${functionId}&power=${newState ? 1 : 0}`, { method: 'POST' })
|
||||
.then(() => {
|
||||
selectedLoco.setFunction(functionId, newState);
|
||||
if (newState) {
|
||||
button.classList.add('active');
|
||||
addLogMessage(`Function F ${functionId} activated for address ${selectedLoco.address}`);
|
||||
} else {
|
||||
button.classList.remove('active');
|
||||
addLogMessage(`Function F ${functionId} deactivated for address ${selectedLoco.address}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function updateSpeedValue(speed) {
|
||||
const speedValue = document.getElementById('speedValue');
|
||||
const percentage = (speed / 1000) * 100;
|
||||
speedValue.textContent = Math.round(percentage);
|
||||
}
|
||||
105
Railuino/data/style.css
Normal file
@@ -0,0 +1,105 @@
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.log-window {
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
max-height: 150px;
|
||||
overflow-y: scroll;
|
||||
background-color: #f9f9f9;
|
||||
font-family: monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.toggle-button {
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
margin: 10px;
|
||||
cursor: pointer;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.normal-button {
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
margin: 10px;
|
||||
cursor: pointer;
|
||||
background-color: #a81b9c;
|
||||
}
|
||||
|
||||
.toggle-button.power-on {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.toggle-button.power-off {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.slider-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#speedSlider {
|
||||
width: 70%;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.slider-label {
|
||||
font-weight: bold;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.speed-percentage {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.image-buttons {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.address-button {
|
||||
margin: 0 10px;
|
||||
width: 90px;
|
||||
height: 60px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.address-button.selected {
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.function-buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.function-button {
|
||||
margin: 5px;
|
||||
padding: 10px 20px;
|
||||
cursor: pointer;
|
||||
background-color: lightgray;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.function-button.active {
|
||||
background-color: rgb(74, 72, 72);
|
||||
color: white;
|
||||
}
|
||||
BIN
Railuino/examples/.DS_Store
vendored
Normal file
BIN
Railuino/examples/01.Controller/.DS_Store
vendored
Normal file
BIN
Railuino/examples/01.Controller/CV/.DS_Store
vendored
Normal file
68
Railuino/examples/01.Controller/CV/CV_new.ino
Normal file
@@ -0,0 +1,68 @@
|
||||
/*********************************************************************
|
||||
* Railuino - Hacking your Märklin
|
||||
*
|
||||
* Copyright (C) 2012 Joerg Pleumann
|
||||
* Copyright (C) 2024 Christophe Bobille
|
||||
*
|
||||
* This example is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Creative Commons Zero License,
|
||||
* version 1.0, as published by the Creative Commons Organisation.
|
||||
* This effectively puts the file into the public domain.
|
||||
*
|
||||
* This example is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* LICENSE file for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This exemple is the update of examples/01.Controller/CV/CV_new.ino
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
|
||||
const uint16_t LOCO = ADDR_MFX + 7; // Change with your own address
|
||||
|
||||
const bool DEBUG = false;
|
||||
const uint64_t TIMEOUT = 500; // ms
|
||||
const uint16_t HASH = 0x00;
|
||||
const bool LOOPBACK = false;
|
||||
|
||||
TrackController ctrl(HASH, DEBUG, TIMEOUT, LOOPBACK); // Instance de la classe TrackController, création de l'objet ctrl.
|
||||
|
||||
void showRegister(uint16_t, String);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while (!Serial)
|
||||
;
|
||||
|
||||
ctrl.begin();
|
||||
Serial.print("Power on\n\n");
|
||||
ctrl.setPower(true);
|
||||
|
||||
showRegister(1, "Address");
|
||||
showRegister(2, "Min. Voltage");
|
||||
showRegister(3, "Accel. time");
|
||||
showRegister(4, "Decel. time");
|
||||
showRegister(5, "Max. speed");
|
||||
showRegister(6, "Avg. speed");
|
||||
showRegister(7, "Version");
|
||||
showRegister(8, "Manufacturer");
|
||||
|
||||
Serial.println("\n\nSystem stopped. Need to reset.");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
}// Nothing to do
|
||||
|
||||
void showRegister(uint16_t i, String label)
|
||||
{
|
||||
uint8_t b = 0;
|
||||
|
||||
if (ctrl.readConfig(LOCO, i, &b))
|
||||
Serial.print("Register "+label+" : "+b+"\n");
|
||||
}
|
||||
BIN
Railuino/examples/01.Controller/Direction/.DS_Store
vendored
Normal file
68
Railuino/examples/01.Controller/Direction/Direction_new.ino
Normal file
@@ -0,0 +1,68 @@
|
||||
/*********************************************************************
|
||||
* Railuino - Hacking your Märklin
|
||||
*
|
||||
* Copyright (C) 2012 Joerg Pleumann
|
||||
* Copyright (C) 2024 Christophe Bobille
|
||||
*
|
||||
* This example is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Creative Commons Zero License,
|
||||
* version 1.0, as published by the Creative Commons Organisation.
|
||||
* This effectively puts the file into the public domain.
|
||||
*
|
||||
* This example is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* LICENSE file for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This exemple is the update of examples/01.Controller/Direction/Direction.ino
|
||||
*/
|
||||
|
||||
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
|
||||
const uint16_t LOCO = ADDR_MFX + 7; // Change with your own address
|
||||
|
||||
const uint16_t PAUSE = 10UL * 1000UL;
|
||||
|
||||
const bool DEBUG = false;
|
||||
const uint64_t TIMEOUT = 500; // ms
|
||||
const uint16_t HASH = 0x00;
|
||||
const bool LOOPBACK = false;
|
||||
|
||||
TrackController ctrl(HASH, DEBUG, TIMEOUT, LOOPBACK); // Instance de la classe TrackController, création de l'objet ctrl.
|
||||
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial);
|
||||
|
||||
ctrl.begin();
|
||||
Serial.println("Power on");
|
||||
ctrl.setPower(true);
|
||||
Serial.println("Headlights on");
|
||||
ctrl.setLocoFunction(LOCO, 0, 1);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
byte b;
|
||||
|
||||
ctrl.setLocoDirection(LOCO, DIR_FORWARD);
|
||||
if (ctrl.getLocoDirection(LOCO, &b)) {
|
||||
Serial.print("Direction is ");
|
||||
Serial.println(b == DIR_FORWARD ? "forward" : "reverse");
|
||||
}
|
||||
|
||||
delay(PAUSE);
|
||||
|
||||
ctrl.setLocoDirection(LOCO, DIR_REVERSE);
|
||||
if (ctrl.getLocoDirection(LOCO, &b)) {
|
||||
Serial.print("Direction is ");
|
||||
Serial.println(b == DIR_FORWARD ? "forward" : "reverse");
|
||||
}
|
||||
|
||||
delay(PAUSE);
|
||||
}
|
||||
|
||||
BIN
Railuino/examples/01.Controller/Function/.DS_Store
vendored
Normal file
82
Railuino/examples/01.Controller/Function/Function_new.ino
Normal file
@@ -0,0 +1,82 @@
|
||||
/*********************************************************************
|
||||
* Railuino - Hacking your Märklin
|
||||
*
|
||||
* Copyright (C) 2012 Joerg Pleumann
|
||||
* Copyright (C) 2024 Christophe Bobille
|
||||
*
|
||||
* This example is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Creative Commons Zero License,
|
||||
* version 1.0, as published by the Creative Commons Organisation.
|
||||
* This effectively puts the file into the public domain.
|
||||
*
|
||||
* This example is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* LICENSE file for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This exemple is the update of examples/01.Controller/Function/Function_new.ino
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
|
||||
const uint16_t LOCO = ADDR_MFX + 7; // Change with your own address
|
||||
|
||||
const uint16_t PAUSE = 5UL * 1000UL;
|
||||
|
||||
const bool DEBUG = false;
|
||||
const uint64_t TIMEOUT = 500; // ms
|
||||
const uint16_t HASH = 0x00;
|
||||
const bool LOOPBACK = false;
|
||||
|
||||
TrackController ctrl(HASH, DEBUG, TIMEOUT, LOOPBACK); // Instance de la classe TrackController, création de l'objet ctrl.
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while (!Serial)
|
||||
;
|
||||
|
||||
ctrl.begin();
|
||||
Serial.println("Power on");
|
||||
ctrl.setPower(true);
|
||||
|
||||
byte b;
|
||||
|
||||
for (uint8_t i = 0; i <= 12; i++)
|
||||
{
|
||||
// Serial.print("Function ");
|
||||
// Serial.print(i, DEC);
|
||||
|
||||
ctrl.setLocoFunction(LOCO, i, 1);
|
||||
if (ctrl.getLocoFunction(LOCO, i, &b))
|
||||
{
|
||||
Serial.print("Function ");
|
||||
Serial.print(i, DEC);
|
||||
Serial.println(b ? " is on" : " is off");
|
||||
}
|
||||
|
||||
delay(PAUSE);
|
||||
|
||||
ctrl.setLocoFunction(LOCO, i, 0);
|
||||
if (ctrl.getLocoFunction(LOCO, i, &b))
|
||||
{
|
||||
Serial.print("Function ");
|
||||
Serial.print(i, DEC);
|
||||
Serial.println(b ? " is on" : " is off");
|
||||
}
|
||||
|
||||
delay(PAUSE);
|
||||
}
|
||||
|
||||
Serial.println("Power off");
|
||||
ctrl.setPower(false);
|
||||
|
||||
Serial.println("System stopped. Need to reset.");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
} // Nothing to do
|
||||
65
Railuino/examples/01.Controller/Headlight/Headlight_new.ino
Normal file
@@ -0,0 +1,65 @@
|
||||
/*********************************************************************
|
||||
* Railuino - Hacking your Märklin
|
||||
*
|
||||
* Copyright (C) 2012 Joerg Pleumann
|
||||
* Copyright (C) 2024 Christophe Bobille
|
||||
*
|
||||
* This example is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Creative Commons Zero License,
|
||||
* version 1.0, as published by the Creative Commons Organisation.
|
||||
* This effectively puts the file into the public domain.
|
||||
*
|
||||
* This example is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* LICENSE file for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This exemple is the update of examples/01.Controller/Headlight/Headlight_new.ino
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
|
||||
const uint16_t LOCO = ADDR_MFX + 7; // Change with your own address
|
||||
|
||||
const uint16_t PAUSE = 5UL * 1000UL;
|
||||
|
||||
const bool DEBUG = false;
|
||||
const uint64_t TIMEOUT = 500; // ms
|
||||
const uint16_t HASH = 0x00;
|
||||
const bool LOOPBACK = false;
|
||||
|
||||
TrackController ctrl(HASH, DEBUG, TIMEOUT, LOOPBACK); // Instance de la classe TrackController, création de l'objet ctrl.
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial);
|
||||
|
||||
ctrl.begin();
|
||||
Serial.println("Power on");
|
||||
ctrl.setPower(true);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
byte b;
|
||||
|
||||
ctrl.setLocoFunction(LOCO, 0, 1);
|
||||
if (ctrl.getLocoFunction(LOCO, 0, &b)) {
|
||||
Serial.print("Lights are ");
|
||||
Serial.println(b ? "on" : "off");
|
||||
}
|
||||
|
||||
delay(PAUSE);
|
||||
|
||||
ctrl.setLocoFunction(LOCO, 0, 0);
|
||||
if (ctrl.getLocoFunction(LOCO, 0, &b)) {
|
||||
Serial.print("Lights are ");
|
||||
Serial.println(b ? "on" : "off");
|
||||
}
|
||||
|
||||
delay(PAUSE);
|
||||
}
|
||||
|
||||
|
||||
BIN
Railuino/examples/01.Controller/Power/.DS_Store
vendored
Normal file
48
Railuino/examples/01.Controller/Power/Power_new.ino
Normal file
@@ -0,0 +1,48 @@
|
||||
/*********************************************************************
|
||||
* Railuino - Hacking your Märklin
|
||||
*
|
||||
* Copyright (C) 2012 Joerg Pleumann
|
||||
* Copyright (C) 2024 Christophe Bobille
|
||||
*
|
||||
* This example is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Creative Commons Zero License,
|
||||
* version 1.0, as published by the Creative Commons Organisation.
|
||||
* This effectively puts the file into the public domain.
|
||||
*
|
||||
* This example is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* LICENSE file for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This exemple is the update of examples/01.Controller/Power/Power.ino
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
|
||||
const uint16_t PAUSE = 5000;
|
||||
const bool DEBUG = true;
|
||||
const uint64_t TIMEOUT = 500; // ms
|
||||
const uint16_t HASH = 0x00;
|
||||
const bool LOOPBACK = false;
|
||||
|
||||
TrackController ctrl(HASH, DEBUG, TIMEOUT, LOOPBACK); // Instance de la classe TrackController, création de l'objet ctrl.
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial);
|
||||
|
||||
ctrl.begin(); // Lancement du contrôleur
|
||||
}
|
||||
|
||||
void loop() {
|
||||
ctrl.setPower(true); // Allumage de la centrale
|
||||
delay(PAUSE);
|
||||
|
||||
ctrl.setPower(false); // Extinction de la centrale
|
||||
delay(PAUSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*********************************************************************
|
||||
* Railuino - Hacking your Märklin
|
||||
*
|
||||
* Copyright (C) 2012 Joerg Pleumann
|
||||
* Copyright (C) 2024 Christophe Bobille
|
||||
*
|
||||
* This example is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Creative Commons Zero License,
|
||||
* version 1.0, as published by the Creative Commons Organisation.
|
||||
* This effectively puts the file into the public domain.
|
||||
*
|
||||
* This example is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* LICENSE file for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This exemple is the update of examples/01.Controller/SerialCommand/SerialCommand.ino
|
||||
*/
|
||||
|
||||
/*
|
||||
* Exemple :
|
||||
power 1
|
||||
speed 16391 100
|
||||
function 16391 0 1
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
|
||||
const bool DEBUG = false;
|
||||
const uint64_t TIMEOUT = 500; // ms
|
||||
const uint16_t HASH = 0x00;
|
||||
const bool LOOPBACK = false;
|
||||
|
||||
TrackController ctrl(HASH, DEBUG, TIMEOUT, LOOPBACK); // Instance de la classe TrackController, création de l'objet ctrl.
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while (!Serial)
|
||||
;
|
||||
ctrl.begin();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (Serial.available())
|
||||
{
|
||||
String command = Serial.readStringUntil('\n');
|
||||
Serial.println(command);
|
||||
ctrl.handleUserCommands(command);
|
||||
}
|
||||
}
|
||||
94
Railuino/examples/01.Controller/SerialCommand/TCPCommand.ino
Normal file
@@ -0,0 +1,94 @@
|
||||
/*********************************************************************
|
||||
* Railuino - Hacking your Märklin
|
||||
*
|
||||
* Copyright (C) 2012 Joerg Pleumann
|
||||
* Copyright (C) 2024 Christophe Bobille
|
||||
*
|
||||
* This example is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Creative Commons Zero License,
|
||||
* version 1.0, as published by the Creative Commons Organisation.
|
||||
* This effectively puts the file into the public domain.
|
||||
*
|
||||
* This example is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* LICENSE file for more details.
|
||||
*/
|
||||
|
||||
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Include files
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#include <ACAN_ESP32.h> // https://github.com/pierremolinaro/acan-esp32.git
|
||||
#include <Arduino.h>
|
||||
#include <WiFi.h>
|
||||
|
||||
const uint16_t LOCO = ADDR_MFX + 7; // Change with your own address
|
||||
const bool DEBUG = true;
|
||||
|
||||
byte cBuffer[13]; // CAN buffer
|
||||
byte sBuffer[13]; // Serial buffer
|
||||
|
||||
TrackController ctrl(0xDF24, DEBUG);
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// TCP/WIFI-ETHERNET
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
const char *ssid = "**********";
|
||||
const char *password = "**********";
|
||||
IPAddress ip(192, 168, 1, 103);
|
||||
IPAddress gateway(192, 168, 1, 254);
|
||||
IPAddress subnet(255, 255, 255, 0);
|
||||
const uint port = 15731;
|
||||
WiFiServer server(port);
|
||||
WiFiClient client;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while (!Serial)
|
||||
;
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED)
|
||||
{
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
|
||||
Serial.println("");
|
||||
Serial.println("WiFi connected.");
|
||||
Serial.println("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
server.begin();
|
||||
|
||||
ctrl.begin();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
while (!client) // listen for incoming clients
|
||||
client = server.available();
|
||||
if (client.connected())
|
||||
{
|
||||
if (client.available())
|
||||
{
|
||||
String command = client.readStringUntil('\n');
|
||||
|
||||
Serial.println(command);
|
||||
ctrl.handleUserCommands(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (!client.connected())
|
||||
// {
|
||||
// Serial.println("Client disconnected.");
|
||||
// client.stop();
|
||||
// }
|
||||
308
Railuino/examples/01.Controller/SerialCommand/WebCommand
Normal file
@@ -0,0 +1,308 @@
|
||||
|
||||
|
||||
#ifndef ARDUINO_ARCH_ESP32
|
||||
#error "Select an ESP32 board"
|
||||
#endif
|
||||
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <WebServer.h>
|
||||
#include <SPIFFS.h>
|
||||
#include <ACAN_ESP32.h>
|
||||
#include "Config.h"
|
||||
#include "TrackController.h"
|
||||
|
||||
bool powerState = false; // Variable globale pour suivre l'état de l'alimentation
|
||||
const bool DEBUG = true;
|
||||
|
||||
byte cBuffer[13];
|
||||
byte sBuffer[13];
|
||||
|
||||
const gpio_num_t can_rx_pin = GPIO_NUM_22;
|
||||
const gpio_num_t can_tx_pin = GPIO_NUM_23;
|
||||
|
||||
//TrackController ctrl; // Instance without parameters
|
||||
//TrackController ctrl(500); // Instance by changing the default exchangeMessage timeout from 1000ms to 500ms
|
||||
//TrackController ctrl(0xDF24, DEBUG); // Instance with hash, debug and defaut exchangeMessage timeout = 1000
|
||||
TrackController ctrl(0xDF24, DEBUG, 500); // Instance with hash, debug and exchangeMessage timeout = 500
|
||||
|
||||
|
||||
|
||||
// const char *ssid = "**********";
|
||||
// const char *password = "**********";
|
||||
const char *ssid = "Livebox-BC90";
|
||||
const char *password = "V9b7qzKFxdQfbMT4Pa";
|
||||
|
||||
|
||||
IPAddress ip(192, 168, 1, 103);
|
||||
IPAddress gateway(192, 168, 1, 254);
|
||||
IPAddress subnet(255, 255, 255, 0);
|
||||
const uint port = 80;
|
||||
|
||||
WebServer server(port);
|
||||
|
||||
void handleRoot();
|
||||
void handleCss();
|
||||
void handleJs();
|
||||
void handleImage1();
|
||||
void handleImage2();
|
||||
void handleImage3();
|
||||
void handleImage4();
|
||||
void handleFavinco();
|
||||
void handleSetPower();
|
||||
void handleSetStop();
|
||||
void handleSetSystemHalt();
|
||||
void handleSetDirection();
|
||||
void handleSetSpeed();
|
||||
void handleSetAddress();
|
||||
void handleSetFunction();
|
||||
void handleNotFound();
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Serial.print("An error has occurred while mounting SPIFFS\n");
|
||||
return;
|
||||
}
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
while (WiFi.status() != WL_CONNECTED)
|
||||
{
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
Serial.println("");
|
||||
Serial.println("WiFi connected.");
|
||||
Serial.println("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
server.on("/", handleRoot);
|
||||
server.on("/style.css", handleCss);
|
||||
server.on("/script.js", handleJs);
|
||||
server.on("/image1.jpg", handleImage1);
|
||||
server.on("/image2.jpg", handleImage2);
|
||||
server.on("/image3.jpg", handleImage3);
|
||||
server.on("/image4.jpg", handleImage4);
|
||||
server.on("/favicon.ico", handleFavinco);
|
||||
|
||||
server.on("/setPower", HTTP_POST, handleSetPower);
|
||||
server.on("/setStop", HTTP_POST, handleSetStop);
|
||||
server.on("/setSystemHalt", HTTP_POST, handleSetSystemHalt);
|
||||
server.on("/setDirection", HTTP_POST, handleSetDirection);
|
||||
server.on("/setSpeed", HTTP_POST, handleSetSpeed);
|
||||
server.on("/setAddress", HTTP_POST, handleSetAddress);
|
||||
server.on("/setFunction", HTTP_POST, handleSetFunction);
|
||||
server.onNotFound(handleNotFound);
|
||||
|
||||
server.begin();
|
||||
ctrl.begin(can_rx_pin, can_tx_pin);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
server.handleClient();
|
||||
}
|
||||
|
||||
|
||||
void handleRoot()
|
||||
{
|
||||
File file = SPIFFS.open("/index.html", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "text/html");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleCss()
|
||||
{
|
||||
File file = SPIFFS.open("/style.css", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "text/css");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleJs()
|
||||
{
|
||||
File file = SPIFFS.open("/script.js", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "text/javascript");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleImage1()
|
||||
{
|
||||
File file = SPIFFS.open("/image1.jpg", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "image/jpg");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleImage2()
|
||||
{
|
||||
File file = SPIFFS.open("/image2.jpg", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "image/jpg");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleImage3()
|
||||
{
|
||||
File file = SPIFFS.open("/image3.jpg", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "image/jpg");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleImage4()
|
||||
{
|
||||
File file = SPIFFS.open("/image4.jpg", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "image/jpg");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleFavinco()
|
||||
{
|
||||
File file = SPIFFS.open("/favicon.ico", "r");
|
||||
if (!file)
|
||||
{
|
||||
server.send(500, "text/plain", "File not found");
|
||||
return;
|
||||
}
|
||||
size_t sent = server.streamFile(file, "image/x-icon");
|
||||
file.close();
|
||||
}
|
||||
|
||||
void handleSetPower()
|
||||
{
|
||||
auto togglePower = [&]() -> bool
|
||||
{
|
||||
powerState = !powerState;
|
||||
return ctrl.setPower(powerState);
|
||||
};
|
||||
|
||||
if (togglePower())
|
||||
{
|
||||
if (powerState)
|
||||
server.send(200, "text/plain", "true");
|
||||
else
|
||||
server.send(200, "text/plain", "false");
|
||||
}
|
||||
else
|
||||
server.send(200, "text/plain", "Error power function");
|
||||
}
|
||||
|
||||
void handleSetStop()
|
||||
{
|
||||
if (server.hasArg("address"))
|
||||
{
|
||||
uint16_t address = server.arg("address").toInt();
|
||||
const bool ok = ctrl.setLocoSpeed(address, 0);
|
||||
if (ok)
|
||||
server.send(200, "text/plain", "Stop");
|
||||
else
|
||||
server.send(400, "text/plain", "Server error");
|
||||
}
|
||||
}
|
||||
|
||||
void handleSetSystemHalt()
|
||||
{
|
||||
|
||||
if (server.hasArg("address"))
|
||||
{
|
||||
uint16_t address = server.arg("address").toInt();
|
||||
const bool ok = ctrl.systemHalt(address);
|
||||
if (ok)
|
||||
server.send(200, "text/plain", "SystemHalt");
|
||||
else
|
||||
server.send(200, "text/plain", " Server erro#");
|
||||
}
|
||||
else
|
||||
server.send(400, "text/plain", "Address parameter missing");
|
||||
}
|
||||
|
||||
void handleSetDirection()
|
||||
{
|
||||
if (server.hasArg("address"))
|
||||
{
|
||||
uint16_t address = server.arg("address").toInt();
|
||||
ctrl.toggleLocoDirection(address);
|
||||
server.send(200, "text/plain", "Direction toggled");
|
||||
}
|
||||
else
|
||||
server.send(400, "text/plain", "Address parameter missing");
|
||||
}
|
||||
|
||||
void handleSetSpeed()
|
||||
{
|
||||
uint16_t address = 0;
|
||||
uint16_t speed = 0;
|
||||
if (server.hasArg("address") && server.hasArg("speed"))
|
||||
{
|
||||
address = server.arg("address").toInt();
|
||||
speed = server.arg("speed").toInt();
|
||||
ctrl.setLocoSpeed(address, speed);
|
||||
server.send(200, "text/plain", "Speed set");
|
||||
}
|
||||
else
|
||||
server.send(400, "text/plain", "Speed parameter missing");
|
||||
}
|
||||
|
||||
void handleSetAddress()
|
||||
{
|
||||
if (server.hasArg("address"))
|
||||
{
|
||||
uint16_t address = server.arg("address").toInt();
|
||||
server.send(200, "text/plain", "Address set");
|
||||
}
|
||||
else
|
||||
server.send(400, "text/plain", "Address parameter missing");
|
||||
}
|
||||
|
||||
void handleSetFunction()
|
||||
{
|
||||
if (server.hasArg("address") && server.hasArg("function") && server.hasArg("power"))
|
||||
{
|
||||
uint16_t address = server.arg("address").toInt();
|
||||
uint8_t function = server.arg("function").toInt();
|
||||
uint8_t power = server.arg("power").toInt();
|
||||
ctrl.setLocoFunction(address, function, power);
|
||||
server.send(200, "text/plain", "Function set");
|
||||
}
|
||||
else
|
||||
server.send(400, "text/plain", "Function parameter missing");
|
||||
}
|
||||
|
||||
void handleNotFound()
|
||||
{
|
||||
server.send(404, "text/plain", "Not found");
|
||||
}
|
||||
BIN
Railuino/examples/01.Controller/Speed/.DS_Store
vendored
Normal file
BIN
Railuino/examples/01.Controller/Test_address_loco.zip
Normal file
39
Railuino/include/README
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
This directory is intended for project header files.
|
||||
|
||||
A header file is a file containing C declarations and macro definitions
|
||||
to be shared between several project source files. You request the use of a
|
||||
header file in your project source file (C, C++, etc) located in `src` folder
|
||||
by including it, with the C preprocessing directive `#include'.
|
||||
|
||||
```src/main.c
|
||||
|
||||
#include "header.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Including a header file produces the same results as copying the header file
|
||||
into each source file that needs it. Such copying would be time-consuming
|
||||
and error-prone. With a header file, the related declarations appear
|
||||
in only one place. If they need to be changed, they can be changed in one
|
||||
place, and programs that include the header file will automatically use the
|
||||
new version when next recompiled. The header file eliminates the labor of
|
||||
finding and changing all the copies as well as the risk that a failure to
|
||||
find one copy will result in inconsistencies within a program.
|
||||
|
||||
In C, the usual convention is to give header files names that end with `.h'.
|
||||
It is most portable to use only letters, digits, dashes, and underscores in
|
||||
header file names, and at most one dot.
|
||||
|
||||
Read more about using header files in official GCC documentation:
|
||||
|
||||
* Include Syntax
|
||||
* Include Operation
|
||||
* Once-Only Headers
|
||||
* Computed Includes
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
||||