SpresenseとIIS3DWBでの通信ができません

O

OrangeJuice

Spresense+Spresense拡張ボードの環境でIIS3DWBの加速度センサを利用したいと考えています.
事前にArduinoでは動作確認済みのコードを使って,Spresenseで動作させようとしたところ「IIS3DWB not functioning!」と出て,getChipID関数で正しくデバイスのIDが取得できません.
ソースコードを添付しますので,何かお気づきの点があればご助言いただきたいです.

なお,拡張ボードの電圧設定は5V,IIS3DWBとSpresenseの結線は以下の通りです.

SpresenseIIS3DWB
3.3V3.3V
SPI CS(D10)SS
SPI MOSI(D11)MOSI
SPI MISO(D12)MISO
SPI SCK(D13)SCK
GNDGND

Code:
    #include <IIS3DWB.h>
    #include "SPI.h"

    #define SerialDebug true  // set to true to get Serial output for debugging
    #define CSPIN    10

    /* Specify sensor parameters (sample rate is same as the bandwidth 6.3 kHz by default)
     * choices are:  AFS_2G, AFS_4G, AFS_8G, AFS_16G  
    */ 
    uint8_t Ascale = AFS_4G;
    
    float aRes;                              // scale resolutions per LSB for the accel 
    float accelBias[3] = {0.0f, 0.0f, 0.0f}; // offset biases for the accel 
    int16_t IIS3DWBData[4] = {0};                  // Stores the 16-bit signed sensor output
    float ax, ay, az, accelTemp;             // variables to hold latest accel data values 
    uint8_t IIS3DWBstatus;
    
    volatile bool IIS3DWB_DataReady = true, IIS3DWB_Wakeup = true;

    IIS3DWB IIS3DWB(CSPIN); // instantiate IIS3DWB class

    void setup() 
    {
      Serial.begin(115200);
      delay(4000);
    
      SPI.begin(); // Start SPI serial peripheral
      Serial.print("SPI Start!\n");
    
      // Configure SPI ship select for sensor breakout
      pinMode(CSPIN, OUTPUT);
      digitalWrite(CSPIN, HIGH); // disable SPI at start
    
      // Read the IIS3DWB Chip ID register, this is a good test of communication
      Serial.println("IIS3DWB accel...");
      uint8_t c = IIS3DWB.getChipID();  // Read CHIP_ID register for IIS3DWB
      Serial.print("IIS3DWB "); Serial.print("I AM "); Serial.print(c, HEX); Serial.print(" I should be "); Serial.println(0x7B, HEX);
      Serial.println(" ");
    
      if(c == 0x7B) // check if all SPI sensors have acknowledged
      {
       Serial.println("IIS3DWB is online...");  
       Serial.println(" ");
    
       // reset IIS3DWB to start fresh
       IIS3DWB.reset();

       // get accel sensor resolution, only need to do this once
       aRes = IIS3DWB.getAres(Ascale);
    
       IIS3DWB.selfTest();
    
       IIS3DWB.init(Ascale); // configure IIS3DWB  

       IIS3DWB.offsetBias(accelBias);
       Serial.println("accel biases (mg)"); Serial.println(1000.0f * accelBias[0]); Serial.println(1000.0f * accelBias[1]); Serial.println(1000.0f * accelBias[2]);
       Serial.println(" ");
       delay(1000); 
    
      }
      else 
      {
      if(c != 0x6A) Serial.println(" IIS3DWB not functioning!"); 
      while(1){};
      }
    
     }
    /* End of setup */

    void loop() {
      
      if(IIS3DWB_DataReady)  // Handle data ready condition
      {
        IIS3DWBstatus = IIS3DWB.DRstatus(); // read data ready status
        if (IIS3DWBstatus & 0x01) {         // if new accel data is available, read it
          IIS3DWB.readAccelData(IIS3DWBData);  
          // Now we'll calculate the accleration value into actual g's
            ax = (float)IIS3DWBData[0]*aRes - accelBias[0];  // get actual g value, this depends on scale being set
            ay = (float)IIS3DWBData[1]*aRes - accelBias[1];   
            az = (float)IIS3DWBData[2]*aRes - accelBias[2];  
           }
         }  // end of data ready interrupt handlin
 
       // end sensor interrupt handling
        
      if(SerialDebug) { // report latest accel data
        Serial.print("ax = "); Serial.print((int)1000*ax);  
        Serial.print(" ay = "); Serial.print((int)1000*ay); 
        Serial.print(" az = "); Serial.print((int)1000*az); Serial.println(" mg");
        }

      IIS3DWBData[3] = IIS3DWB.readTempData(); // get IIS3DWB chip temperature
      accelTemp = ((float) IIS3DWBData[3]) / 256.0f + 25.0f; // Accel chip temperature in degrees Centigrade
      // Print temperature in degrees Centigrade      
      if(SerialDebug) {
        Serial.print("IIS3DWB temperature is ");  Serial.print(accelTemp, 1);  Serial.println(" degrees C"); // Print T values to tenths of a degree C
        }

    }
    /*  End of main loop */
 

Unreplied Threads

When an algebra isomorphism preserves positive involution

Let $A$ be a $K$-algebra where $K$ is a field with a unique ordering. We say a $K$-linear involution $*$ is positive if the map $A \to K$ via $a \mapsto tr(a^*a)$ is positive definite with respect to the ordering. Here, $tr(a)$ is the trace of the left multiplication map $a:x \mapsto ax$.

Suppose there is a $K$-algebra isomorphism $$\varphi: A \to B.$$

If there is a unique (up to isomorphism) positive involution in $A$ and $B$, can we say the involution must be preserved by the isomorphism $\varphi$: $$\varphi: (A, *_A) \to (B, *_B)?$$

Motivation:​


My question is motivated from representation theory. When $W$ is a real irreducible representation (irrep) of a finite group $G$, then $D:=End_G(W)$ is a division algebra by Schur's lemma. Additionally, Frobenius theorem on real associative division algebras implies that $D$ is isomorphic to either the reals $\mathbb{R}$, complexes $\mathbb{C}$, or quaternions $\mathbb{H}$. Let's call this isomorphism $\varphi$.

Suppose $W$ is endowed with an $G$-invariant inner product (i.e. $\langle g\cdot u, g\cdot v \rangle=\langle u , v \rangle$ for all $u,v \in W$ and $g \in G$). So, $W$ is an orthogonal irrep, and $D$ has the involution that acts as the adjoint corresponding to the $G$-invariant inner product. We know that $\mathbb{R}$, $\mathbb{C}$, and $\mathbb{H}$ all have involution. Furthermore, they are normed division algebras. The involution is the trivial map in $\mathbb{R}$, complex conjugate in $\mathbb{C}$, and the standard involution in $\mathbb{H}$ $\left((a+ib+jc+dk)^*=a-ib-jc-dk\right).$ We even do not need to define the involution in $\mathbb{R}$, $\mathbb{C}$, and $\mathbb{H}$ because the involution must be positive when we want to correspond involution to adjoint and there is a unique positive involution up to isomorphism in real central division algebras. My original question is how to prove that $\varphi$ preserves involution. Is this even true?

problem with armature after mirroring part of object

first of all, I'm totally new to blender, but couldn't find my answer after searching a lot. here is my problem in blender 4.2: in object edit mode, I've duplicated left shoulder top armor, mirrored, moved over right shoulder.

copied image

now the problem is; in pose mode if i rotate or modify left shoulder bone, that right mirrored armor part is moving too as in image:

bone rotate

I've tried to separate all object parts, then clear all parents from it, re-assign right shoulder bone as parent. but still it move with left shoulder bone as well as right shoulder bone.

any help appreciated.

blender file:

ps: is there anyway to select a bone and see which objects assigned to that bone? I know about weights and vertex groups, but in this object, non assigned to mirrored object.

What the garlic is that pt.2? (Plant identification help needed)

  • Derptastic
  • Social
  • Replies: 0
I have sown some garlic cloves in a pot (I only have a balcony, don't judge). And... something came out of the pot, but it's not garlic, and I'm very curious what it might be: Mystery plant Mystery plant, image two

I even mistook it for garlic initially, but it's completely inedible, and in fact, can barely be chewed through in any manner - the leaves are pretty tough. As far as I could tell by rummaging in the ground, there are no cloves to this beastie, and the roots seem to go quite far down. Google Lens identifies that as Chives, but I can guarantee you it's not (I actually do have chives, in a pot beside this one). In this case, you can see some actual garlic that caught on, chilling in the background, wondering what kind of neighbor is that. It definitely feels like a weed, but I still wanted to find out what it could be before it goes out.

Any educated guesses?

What would happen if you use warm base on a compressor ice cream machine?

  • Lenny Markus
  • Social
  • Replies: 0
Note: This question is for an ice cream machine WITH a compressor

Pretty much all recipes for ice cream/gelato call for completely chilling the mixture before starting to churn.

I get that for "passively" cooled machines (compressorless) it's important, so that you don't loose any of the pre-cooling you've done to the hardware.

Does it actually matter for a compressor-based machine? The machine can certainly cool it down without a hitch, but would it impact the final texture?

Attempting to simplify Fiege-Fiat-Shamir Identification

  • deeplyconfused
  • Technology
  • Replies: 0
My understanding of the Fiege-Fiat-Shamir protocol, sourced from "RSA and Public-Key Cryptography" by Richard A. Mollin is as below:

  1. A third party chooses two large primes $p$ and $q$, sharing $n = pq$.
  2. Alice has a secret value $s_a$ and shares a number $t_a = s_a^2 \mod n$.
  3. Alice picks a random $m \in \mathbb{N}$ and sends $w = m^2 \mod n$ to Bob.
  4. Bob picks a challenge $c \in \{0, 1\}$ and sends that to Alice.
  5. Alice computes $r = ms_a^c \mod m$ and sends that to Bob.
  6. Bob computes $r^2 = m^2s_a^{2c}$, and he can compare that to the publicly known $wt_a^2$, which should be identical if Alice does indeed know $s_a$. The security of this protocol is based on the fact that it is difficult to solve quadratic modular congruences with unfactored moduli.

My text elaborates that there is a method that an attacker can use to impersonate Alice with a 50% success rate, so this is done $a$ times and the probability that this works becomes $2^{-a}$.



If my understanding of this is correct, then one could use a similar protocol, but without the 50% chance of failure:

  1. As before, a third party selects $p$ and $q$, sharing $n = pq$.
  2. Alice picks a random $m$ and sends $w = m^2 \mod n$ to Bob.
  3. Alice sends $r = ms_a \mod n$ to Bob.
  4. Bob computes $r^2 \mod n$ and confirms that it's equal to $mt_a$.

Again, because neither $w$ nor $t_a$ are easy to compute, this seems secure.

I assume that this doesn't work. Why not? Why does Fiege-Fiat-Shamir require that Bob send a challenge?

Zencash uses your passphrase to identify AND unlock a wallet - how is this secure?

When looking into Zencash I stumbled into myzenwallet.io (by the Zencash creators), which gives you the option to enter a passphrase to generate a wallet (seems normal), but then after creating your wallet you can come back later and open your wallet by simply re-entering your passphrase again... this was unexpected and had me not only wondering about how it worked, but also wondering whether whatever means were used to achieve this would remain secure in the future.

Given that I don't need to identify the resource I'm unlocking, but rather just hand over the passphrase, I'm left to assume that their system generates a token by hashing my passphrase a number of times to generate my "master address" or "account ID" (I just made those terms up, because Zencash gives you many addresses, so I also assume you have some sort of master address / account ID), and then also using that same passphrase to lock / authenticate (not to encrypt though, right?) the wallet.

What common proverb does this string refer to?

What common proverb is referenced by this three-character string?

ᚷᛖᚨ
Top