Ganponブログ

趣味の模型作り、ドライブ、旅行など
since Mar.2017

ラジコン WPL C24-1 カスタム(その8)

2023-08-01 10:19:58 | ラジコン

2023-07-30
ターンシグナルもステアリングに連動して点滅するようにしました。
点滅はPICで動作させ、毎分80回に設定しました。
又、点灯の安定を向上させるために5V出力のコンバータを追加しました。
ステアリングのトリム調整をするとウィンカー点灯位置検出の中央ポジションとズレが生じるので、回路側でも固定抵抗を可変抵抗に戻して調整できるようにしました。

 
▼回路図
 

▼PICプログラム

  1. // Created on 2023/07/26, 10:14
  2.  
  3. // CONFIG1
  4. #pragma config FOSC = INTOSC // Oscillator Selection (INTOSC oscillator: I/O function on CLKIN pin)
  5. #pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled)
  6. #pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled)
  7. #pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input)
  8. #pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled)
  9. #pragma config CPD = OFF // Data Memory Code Protection (Data memory code protection is disabled)
  10. #pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset disabled)
  11. #pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin)
  12. #pragma config IESO = OFF // Internal/External Switchover (Internal/External Switchover mode is disabled)
  13. #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is disabled)
  14.  
  15. // CONFIG2
  16. #pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off)
  17. #pragma config PLLEN = OFF // PLL Enable (4x PLL disabled)
  18. #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset)
  19. #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.)
  20. #pragma config LVP = OFF // Low-Voltage Programming Enable (Low-voltage programming enabled)
  21.  
  22. #include <xc.h>
  23. #define _XTAL_FREQ 8000000
  24.  
  25. void main(void) {
  26.  
  27.     OSCCON = 0b01110010; //内部クロック8MHz 4MHz 0b01101010
  28.     ANSELA = 0b00000000; //アナログは使用しない(すべてデジタルI/Oに割り当てる)
  29.     TRISA = 0b00011000; //RA3,RA4だけ入力その他のピンは出力に割当てる(RA5は入力専用)
  30.  
  31.     PORTA = 0; //出力ピンの初期化(全てLOWにする)
  32.  
  33.     while (1) {
  34.         if (RA3 == 1) {
  35.             RA1 = 0;
  36.             __delay_ms(300);
  37.             RA1 = 1;
  38.             __delay_ms(450);
  39.         }
  40.         if (RA4 == 1) {
  41.             RA0 = 0;
  42.             __delay_ms(300);
  43.             RA0 = 1;
  44.             __delay_ms(450);
  45.         }
  46.         return;
  47.     }
  48.  
  49. }
 
 
▼点灯動画
WPL C24 1 ライティングテスト2
 
【追記】
バンプステア(サスペンションが縮んだ時にタイヤがステアリングを切ったかの様に、角度が付いてしまう現象 )対策で手配していたパーツが中国から届きません。
税関で「輸出取止め」という事になっていました。
Amazon経由で業者に確認した所、返金処理となりました。
他にも数点同様に税関で止められ返金処理となっています。
今までこんなことは無かったのですが。。。。。
別の業者に再手配しましたが、どうなる事やら。
 
【追記 2023-08-01】
室内でのテスト走行の動画です。