Renesas Community
Renesas Community
  • User
    Join or sign in
  • Site
  • Search Community
  • User
  • Renesas Engineering Community
  • FAQ
  • HELP
  • More
  • Cancel
がじぇっとるねさすコミュニティ
がじぇっとるねさすコミュニティ
GR-SAKURA フォーラム GR-SAKURAをマウスの代わりに使いたい
  • Forums
  • Files
  • がじぇっとるねさす ゆーざー会 - Wiki
  • Tags
  • More
  • Cancel
  • New

 

 GR-SAKURA

 GR-KURUMI

 GR-COTTON

 GR-CITRUS

 GR-PEACH

 GR-KAEDE

 GR-ADZUKI

 GR-LYCHEE

 GR-ROSE

 GR-MANGO(*)

 SNShield

 Web Compiler

 IDE for GR

 TOPPERS関連

 女子美コラボ

 その他

 ※プロデューサミーティング中

 作り方使い方資料

 イベント関連

 作品記事

 体験記事

 その他

 

 ライブラリ

 ツール

 その他・過去ファイル

  • Replies 2 replies
  • Subscribers 273 subscribers
  • Views 863 views
  • Users 0 members are here
  • gr-sakura
  • USB
Options
  • Share
  • More
  • Cancel
Related Tags
  • Ehternet
  • ethernet
  • gr-sakura
  • GR-SAKURA GR-KURUMI I2C
  • gr-sakura rtc
  • GR-SAKURA SDMMC
  • GR-SAKURA 液晶 aitendo
  • I2c
  • lcd
  • mruby
  • sd_card
  • sdmmc
  • SDカード
  • serial
  • SPI
  • udp
  • USB仮想シリアル
  • Windows8 serial com driver
  • がじぇっとルネサス
  • がじぇるね
  • シリアル
  • タイマ割込み
  • ネットワーク
  • ライブラリ
  • 割り込み
Related

GR-SAKURAをマウスの代わりに使いたい

カビらJ
カビらJ over 2 years ago

表題の件で、下記に示すArduinoのサンプルスケッチを IDE for GR でコンパイルすると、Mouse.hがないといってエラーが出ます。

GR-SAKURAでは無理なんでしょうか? 初心者ですみません。

/*
ButtonMouseControl

For Leonardo and Due boards only.

Controls the mouse from five pushbuttons on an Arduino Leonardo, Micro or Due.

Hardware:
- five pushbuttons attached to D2, D3, D4, D5, D6

The mouse movement is always relative. This sketch reads four pushbuttons,
and uses them to set the movement of the mouse.

WARNING: When you use the Mouse.move() command, the Arduino takes over your
mouse! Make sure you have control before you use the mouse commands.

created 15 Mar 2012
modified 27 Mar 2012
by Tom Igoe

This example code is in the public domain.

www.arduino.cc/.../ButtonMouseControl
*/

#include "Mouse.h"

// set pin numbers for the five buttons:
const int upButton = 2;
const int downButton = 3;
const int leftButton = 4;
const int rightButton = 5;
const int mouseButton = 6;

int range = 5; // output range of X or Y movement; affects movement speed
int responseDelay = 10; // response delay of the mouse, in ms


void setup() {
// initialize the buttons' inputs:
pinMode(upButton, INPUT);
pinMode(downButton, INPUT);
pinMode(leftButton, INPUT);
pinMode(rightButton, INPUT);
pinMode(mouseButton, INPUT);
// initialize mouse control:
Mouse.begin();
}

void loop() {
// read the buttons:
int upState = digitalRead(upButton);
int downState = digitalRead(downButton);
int rightState = digitalRead(rightButton);
int leftState = digitalRead(leftButton);
int clickState = digitalRead(mouseButton);

// calculate the movement distance based on the button states:
int xDistance = (leftState - rightState) * range;
int yDistance = (upState - downState) * range;

// if X or Y is non-zero, move:
if ((xDistance != 0) || (yDistance != 0)) {
Mouse.move(xDistance, yDistance, 0);
}

// if the mouse button is pressed:
if (clickState == HIGH) {
// if the mouse is not pressed, press it:
if (!Mouse.isPressed(MOUSE_LEFT)) {
Mouse.press(MOUSE_LEFT);
}
}
// else the mouse button is not pressed:
else {
// if the mouse is pressed, release it:
if (Mouse.isPressed(MOUSE_LEFT)) {
Mouse.release(MOUSE_LEFT);
}
}

// a delay so the mouse doesn't move too fast:
delay(responseDelay);
}

  • Reply
  • Cancel
  • Cancel
Parents
  • Okamiya Yuuki
    Okamiya Yuuki over 2 years ago

    がじぇるね岡宮です。

    ご返信遅くなりすみません。

    USBホスト機能のロースピードがRX63Nでサポートされていないため、マウスやキーボードはライブラリでサポートしていません。

    実際のところライブラリバージョン2.06まではUSBホストのライブラリは存在していたのですが、その後デバイスの評価の結果ロースピードはデバイスとしてサポート外になりましたので、ライブラリから削除いたしました。

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Reply
  • Okamiya Yuuki
    Okamiya Yuuki over 2 years ago

    がじぇるね岡宮です。

    ご返信遅くなりすみません。

    USBホスト機能のロースピードがRX63Nでサポートされていないため、マウスやキーボードはライブラリでサポートしていません。

    実際のところライブラリバージョン2.06まではUSBホストのライブラリは存在していたのですが、その後デバイスの評価の結果ロースピードはデバイスとしてサポート外になりましたので、ライブラリから削除いたしました。

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Children
  • カビらJ
    カビらJ over 2 years ago in reply to Okamiya Yuuki

    承知しました。お答えいただき、ありがとうございました。

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
サイト使用条件
プライバシーポリシー
お問い合わせ
© 2010-2023 Renesas Electronics Corporation. All rights reserved.