Skip to content

Commit

Permalink
update to v1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
a10036gt committed Nov 16, 2024
1 parent 69f0ffc commit de05f7f
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Help/en/0_0_OFDLMods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<members>
<member name="W:OFDL_Module_Version">
<summary>
Version: 1.3, 2023-09-27
Version: 1.4, 2024-11-16
Thanks for using OFDL clev3r modules, when you see this section means the module help is installed!
If have any issue of the modules or help, please contact us:
Github: github.com/ofdl-robotics-tw
Expand Down
1 change: 1 addition & 0 deletions Help/en/0_Gyro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<member name="M:resetHard">
<summary>
This method marked as deprecated!
Reset the Gyro sensor to zero degrees. (Need 500ms)
(Hard Reset with GYRO-CAL mode, still need test.)
</summary>
Expand Down
13 changes: 13 additions & 0 deletions Help/en/0_Pixy2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
<param name="hOut">The Height (0-255) output.</param>
</member>

<member name="M:getRGB">
<summary>
Gets specific RGB info from Pixy2.
</summary>
<param name="port">The port (1~4) you connect to device.</param>
<param name="xIn">X Image Location.</param>
<param name="yIn">Y Image Location.</param>
<param name="isSaturated">Saturated, 0 is false, 1 is true.</param>
<param name="rOut">The Red Value output.</param>
<param name="gOut">The Green Value output.</param>
<param name="bOut">The Blue Value output.</param>
</member>

<member name="M:setLampOn">
<summary>
Set Pixy2 Lamp On.
Expand Down
2 changes: 1 addition & 1 deletion Help/ru/0_0_OFDLMods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<members>
<member name="W:OFDL_Module_Version">
<summary>
Version: 1.3, 2023-09-27
Version: 1.4, 2024-11-16
Thanks for using OFDL clev3r modules, when you see this section means the module help is installed!
If have any issue of the modules or help, please contact us:
Github: github.com/ofdl-robotics-tw
Expand Down
1 change: 1 addition & 0 deletions Help/ru/0_Gyro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<member name="M:resetHard">
<summary>
This method marked as deprecated!
Reset the Gyro sensor to zero degrees. (Need 500ms)
(Hard Reset with GYRO-CAL mode, still need test.)
</summary>
Expand Down
13 changes: 13 additions & 0 deletions Help/ru/0_Pixy2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
<param name="hOut">The Height (0-255) output.</param>
</member>

<member name="M:getRGB">
<summary>
Gets specific RGB info from Pixy2.
</summary>
<param name="port">The port (1~4) you connect to device.</param>
<param name="xIn">X Image Location.</param>
<param name="yIn">Y Image Location.</param>
<param name="isSaturated">Saturated, 0 is false, 1 is true.</param>
<param name="rOut">The Red Value output.</param>
<param name="gOut">The Green Value output.</param>
<param name="bOut">The Blue Value output.</param>
</member>

<member name="M:setLampOn">
<summary>
Set Pixy2 Lamp On.
Expand Down
2 changes: 1 addition & 1 deletion Help/ua/0_0_OFDLMods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<members>
<member name="W:OFDL_Module_Version">
<summary>
Version: 1.3, 2023-09-27
Version: 1.4, 2024-11-16
Thanks for using OFDL clev3r modules, when you see this section means the module help is installed!
If have any issue of the modules or help, please contact us:
Github: github.com/ofdl-robotics-tw
Expand Down
1 change: 1 addition & 0 deletions Help/ua/0_Gyro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<member name="M:resetHard">
<summary>
This method marked as deprecated!
Reset the Gyro sensor to zero degrees. (Need 500ms)
(Hard Reset with GYRO-CAL mode, still need test.)
</summary>
Expand Down
13 changes: 13 additions & 0 deletions Help/ua/0_Pixy2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
<param name="hOut">The Height (0-255) output.</param>
</member>

<member name="M:getRGB">
<summary>
Gets specific RGB info from Pixy2.
</summary>
<param name="port">The port (1~4) you connect to device.</param>
<param name="xIn">X Image Location.</param>
<param name="yIn">Y Image Location.</param>
<param name="isSaturated">Saturated, 0 is false, 1 is true.</param>
<param name="rOut">The Red Value output.</param>
<param name="gOut">The Green Value output.</param>
<param name="bOut">The Blue Value output.</param>
</member>

<member name="M:setLampOn">
<summary>
Set Pixy2 Lamp On.
Expand Down
4 changes: 2 additions & 2 deletions Mods/.version
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Modules]
name=OFDL EV3 CLEV3R Modules
ver=1.3
date=2023-09-27
ver=1.4
date=2024-11-16
url=github.com/ofdl-robotics-tw
28 changes: 15 additions & 13 deletions Mods/Gyro.bpm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'Name: EV3 Adv Gyro module
'Version: 1.0
'Author: OFDL Anthony 2023/08/29
'Version: 1.1
'Author: OFDL Anthony 2024/11/16
'---------------------------------

Function getAngle(in number port, out number value)
Expand All @@ -26,15 +26,10 @@ Function getTiltRate(in number port, out number value)
EndFunction

Function getHeading(in number port, in number rpx_bias, out number rpx, out number rpx_360)
'bias
If rpx_bias <= 180 Then
bias = 0 - rpx_bias
Else
bias = 360 - rpx_bias
EndIf

'By OFDL HYT
'https://www.geogebra.org/calculator/kd4pn2j6
'rpx 0 ~ 360
rpx_360= bias + Math.Remainder(Math.Remainder(Sensor.ReadRawValue(port, 0), 360) + 360, 360)
rpx_360= Math.Remainder(Math.Remainder(Sensor.ReadRawValue(port, 0) - rpx_bias , 360) + 360, 360)

'rpx -180 ~ 180
If rpx_360 <= 180 Then
Expand All @@ -56,12 +51,19 @@ Function reset(in number port)
EndFunction

Function resetHard(in number port)
''As test result, This reset method may broke sensors factory setting. So disabled.
LCD.Clear()
LCD.Text(1, 0, 10, 1, "resetHard() is deprecated")
Speaker.Note(100, "C5", 100)
Speaker.Wait()
LCD.Update()

'put the gyro into CAL mode.
Sensor.SetMode(port, 4)
''Sensor.SetMode(port, 4)
'wait it apply
Program.Delay(550)
''Program.Delay(550)
'put the gyro into angle mode.
Sensor.SetMode(port, 0)
''Sensor.SetMode(port, 0)
EndFunction

Function resetCheck(in number port, out string result)
Expand Down
16 changes: 14 additions & 2 deletions Mods/Pixy2.bpm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'Name: Pixy2 module
'Version: 1.0
'Author: OFDL Anthony 2023/08/29
'Version: 1.1
'Author: OFDL Anthony 2024/11/16
'---------------------------------
'
' Please make sure pixy2 is in "LEGO I2C" mode.
Expand All @@ -26,6 +26,18 @@ Function getSignature(in number port, in number sig, out number x, out number y,
h = values[4]
EndFunction

Function getRGB(in number port, in number xIn, in number yIn, in number isSaturated, out number r, out number g, out number b)
'TESSLAB Darren test Pass
writeBuffer[0] = 94
writeBuffer[1] = Math.Remainder((xIn * 0.80952380952) + 128, 256) - 128
writeBuffer[2] = Math.Remainder((yIn * 1.23188405797) + 128, 256) - 128
writeBuffer[3] = isSaturated
values = Sensor.CommunicateI2C(port, 1, 4, 3, writeBuffer)
r = values[0]
g = values[1]
b = values[2]
EndFunction

Function setLampOn(in number port)
Sensor.WriteI2CRegister(port, 0, 98, 1)
EndFunction
Expand Down

0 comments on commit de05f7f

Please sign in to comment.